selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH testsuite 00/24] Clean up testsuite policy and support running as sysadm_t
@ 2022-07-29 12:02 Ondrej Mosnacek
  2022-07-29 12:02 ` [PATCH testsuite 01/24] keys: change test_newcon_key_t to be just an object context Ondrej Mosnacek
                   ` (22 more replies)
  0 siblings, 23 replies; 37+ messages in thread
From: Ondrej Mosnacek @ 2022-07-29 12:02 UTC (permalink / raw)
  To: selinux

This series aim for two things:
1. Refactor the policy so that it is easier to work with.
2. Leverage the refactoring to fully support running the testsuite
   as sysadm_u:sysadm_r:sysadm_t.

The gist of this work lies in unifying how test domains are defined,
deduplicating the various boilerplate spread out all across the
individual files (and not even used consistently), and in abstracting
the policy caller domain/role away from the individual test policies
into test_general.te. Some tests also had to be massaged to not
hard-code unconfined_* and be generic against the context of the
testsuite caller.

The series also extends the CI to test running the testsuite as sysadm_*
and also verify that no unconfined_t/sysadm_t unexpected denials are
produced (which would usually indicate a missing dontaudit rule in the
testsuite policy).

Ondrej Mosnacek (24):
  keys: change test_newcon_key_t to be just an object context
  test_global.te: remove unused role require
  test_global.te: don't add domains to system_r
  policy: refactor declaring test domains
  policy: get rid of unconfined_runs_test()
  test_policy.if: remove weird rule from testsuite_domain_type_minimal()
  policy: move unconfined_t-related dontaudit rule to where it fits
    better
  policy: move userdom_sysadm_entry_spec_domtrans_to() to general policy
  policy: move miscfiles_domain_entry_test_files() to general policy
  policy: substitute userdom_sysadm_entry_spec_domtrans_to()
  test_general.te: move sysadm-related rules into an optional block
  test_filesystem.te: remove redundant dontaudit rules
  test_filesystem.te: remove suspicious rules
  tests/nnp_nosuid: avoid hardcoding unconfined_t in the policy
  tests/*filesystem: remove weird uses of unconfined_t
  policy: remove last hardcoded references to unconfined_t
  test_general.te: generalize the dontaudit rule
  policy: don't audit testsuite programs searching the caller's keys
  ci: check for unconfined_t AVCs
  tests/binder: check only the type part of the context
  tests/overlay: don't hard-code SELinux user of the caller
  policy: give sysadm_t perms needed to run quotacheck(8)
  tests/vsock_socket: use modprobe to check vsock availability
  ci: add sysadm_t to the test matrix

 .github/workflows/checks.yml         |   4 +
 Vagrantfile                          |  16 +++
 policy/test_atsecure.te              |  15 +--
 policy/test_attrib.te                |   1 -
 policy/test_binder.te                |  38 ++-----
 policy/test_binder_bpf.te            |  22 +---
 policy/test_bounds.te                |  11 +-
 policy/test_bpf.te                   |  30 +----
 policy/test_cap_userns.te            |   9 +-
 policy/test_capable_file.te          |  18 +--
 policy/test_capable_net.te           |   8 +-
 policy/test_capable_sys.te           |   8 +-
 policy/test_dyntrace.te              |  14 +--
 policy/test_dyntrans.te              |  17 +--
 policy/test_entrypoint.te            |   5 +-
 policy/test_execshare.te             |  16 +--
 policy/test_exectrace.te             |  16 +--
 policy/test_execute_no_trans.te      |   5 +-
 policy/test_extended_socket_class.te |  12 +-
 policy/test_fdreceive.te             |  16 +--
 policy/test_fdreceive_bpf.te         |  16 +--
 policy/test_file.te                  |  16 +--
 policy/test_filesystem.te            |  99 ++++-------------
 policy/test_filesystem_name_trans.te |   4 +-
 policy/test_filesystem_notify.te     |  12 +-
 policy/test_global.te                | 157 ++++++++++++++++++---------
 policy/test_ibendport.te             |   8 +-
 policy/test_ibpkey.te                |   8 +-
 policy/test_inet_socket.te           |  44 ++------
 policy/test_inherit.te               |  20 +---
 policy/test_ioctl.te                 |  10 +-
 policy/test_ioctl_xperms.te          |   8 +-
 policy/test_ipc.te                   |  18 +--
 policy/test_key_socket.te            |  26 +----
 policy/test_keys.te                  | 104 ++++--------------
 policy/test_link.te                  |  24 +---
 policy/test_mac_admin.te             |   9 +-
 policy/test_mkdir.te                 |  20 +---
 policy/test_mmap.te                  |  79 ++++----------
 policy/test_module_load.te           |  47 ++------
 policy/test_mqueue.te                |  16 +--
 policy/test_netlink_socket.te        |  12 +-
 policy/test_nnp_nosuid.te            |  46 ++++----
 policy/test_notify.te                |  35 ++----
 policy/test_open.te                  |  16 +--
 policy/test_overlayfs.te             |  15 +--
 policy/test_perf_event.te            |  38 ++-----
 policy/test_policy.if                |  71 ++++++------
 policy/test_prlimit.te               |  20 +---
 policy/test_ptrace.te                |  17 +--
 policy/test_readlink.te              |   8 +-
 policy/test_relabel.te               |  12 +-
 policy/test_rename.te                |  32 ++----
 policy/test_rxdir.te                 |   8 +-
 policy/test_sctp.te                  |  52 ++-------
 policy/test_setattr.te               |   8 +-
 policy/test_setnice.te               |  13 +--
 policy/test_sigkill.te               |  22 +---
 policy/test_stat.te                  |   8 +-
 policy/test_sysctl.te                |   8 +-
 policy/test_task_create.te           |  38 +------
 policy/test_task_getpgid.te          |  16 +--
 policy/test_task_getsched.te         |  16 +--
 policy/test_task_getsid.te           |  16 +--
 policy/test_task_setpgid.te          |  34 +-----
 policy/test_task_setsched.te         |  16 +--
 policy/test_transition.te            |  15 +--
 policy/test_tun_tap.te               |  34 ++----
 policy/test_unix_socket.te           |  20 +---
 policy/test_userfaultfd.te           |   8 +-
 policy/test_vsock_socket.te          |  12 +-
 policy/test_watchkey.te              |  14 +--
 tests/binder/binder_common.h         |   1 +
 tests/binder/service_provider.c      |  31 ++++--
 tests/binder/test                    |   2 +-
 tests/filesystem/test                |   4 +-
 tests/fs_filesystem/test             |   4 +-
 tests/keys/test                      |   2 +-
 tests/nfs_filesystem/test            |   4 +-
 tests/nnp_nosuid/test                |  45 +++++---
 tests/overlay/setup-overlay          |   2 +-
 tests/overlay/test                   |  34 +++---
 tests/vsock_socket/.gitignore        |   1 -
 tests/vsock_socket/Makefile          |   2 +-
 tests/vsock_socket/check_vsock.c     |  47 --------
 tests/vsock_socket/test              |  11 +-
 86 files changed, 550 insertions(+), 1346 deletions(-)
 delete mode 100644 tests/vsock_socket/check_vsock.c

-- 
2.37.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2022-08-11 11:28 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-29 12:02 [PATCH testsuite 00/24] Clean up testsuite policy and support running as sysadm_t Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 01/24] keys: change test_newcon_key_t to be just an object context Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 02/24] test_global.te: remove unused role require Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 03/24] test_global.te: don't add domains to system_r Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 06/24] test_policy.if: remove weird rule from testsuite_domain_type_minimal() Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 07/24] policy: move unconfined_t-related dontaudit rule to where it fits better Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 08/24] policy: move userdom_sysadm_entry_spec_domtrans_to() to general policy Ondrej Mosnacek
2022-08-02 13:55   ` Daniel Burgener
2022-08-03  8:53     ` Ondrej Mosnacek
2022-08-04 11:54       ` Ondrej Mosnacek
2022-08-04 13:31         ` Daniel Burgener
2022-07-29 12:02 ` [PATCH testsuite 09/24] policy: move miscfiles_domain_entry_test_files() " Ondrej Mosnacek
2022-08-02 13:58   ` Daniel Burgener
2022-07-29 12:02 ` [PATCH testsuite 10/24] policy: substitute userdom_sysadm_entry_spec_domtrans_to() Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 11/24] test_general.te: move sysadm-related rules into an optional block Ondrej Mosnacek
2022-08-02 14:03   ` Daniel Burgener
2022-08-03  9:03     ` Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 12/24] test_filesystem.te: remove redundant dontaudit rules Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 13/24] test_filesystem.te: remove suspicious rules Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 14/24] tests/nnp_nosuid: avoid hardcoding unconfined_t in the policy Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 15/24] tests/*filesystem: remove weird uses of unconfined_t Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 16/24] policy: remove last hardcoded references to unconfined_t Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 17/24] test_general.te: generalize the dontaudit rule Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 18/24] policy: don't audit testsuite programs searching the caller's keys Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 19/24] ci: check for unconfined_t AVCs Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 20/24] tests/binder: check only the type part of the context Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 21/24] tests/overlay: don't hard-code SELinux user of the caller Ondrej Mosnacek
2022-08-02 17:16   ` Daniel Burgener
2022-08-03  9:00     ` Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 22/24] policy: give sysadm_t perms needed to run quotacheck(8) Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 23/24] tests/vsock_socket: use modprobe to check vsock availability Ondrej Mosnacek
2022-07-29 12:02 ` [PATCH testsuite 24/24] ci: add sysadm_t to the test matrix Ondrej Mosnacek
2022-07-30 20:13   ` Topi Miettinen
2022-08-01  7:57     ` Ondrej Mosnacek
2022-07-29 12:27 ` [PATCH testsuite 00/24] Clean up testsuite policy and support running as sysadm_t Ondrej Mosnacek
2022-08-01  8:02   ` Ondrej Mosnacek
2022-08-11 11:28     ` Ondrej Mosnacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).