sechecker(1) | SETools: SELinux Policy Analysis Tools | sechecker(1) |
sechecker - Configuration-driven automated SELinux policy analysis
sechecker [OPTIONS] config.ini [POLICY]
sechecker is an automated SELinux policy analysis tool. It uses a configuration file to define one or more analysis checks.
A single file containing a binary policy. This file is usually named by version on Linux systems, for example, policy.30. This file is usually named sepolicy on Android systems. If not provided, sechecker will attempt to locate and open the current policy running on the system.
sechecker has the following return codes:
The configuration file is in the .ini format. Each section is considered a check, with the configuration section name being the name of the check. All checks have the following options:
This checks for the nonexistence of type enforcement allow rules. The check_type is assert_te. It will run the query and any unexpected results from the query, removing any exempted sources or targets, will be listed as failures. Any expected results that are not seen will also be listed as failures. If a rule has an empty attribute, rendering it useless, it will be ignored. If a rule has an attribute, it will be considered a failure unless all of the member types are exempted.
Criteria options:
A least one of the above options must be set in this check.
Additional Options:
Note: If a rule has an attribute source, all of the member types must be in the expect_source list or exempt_source list to pass. Similarly, if a rule has an attribute target, all of the member types must be in the expect_target list or exempt_target list to pass.
This checks for the nonexistence of role based access control (RBAC) allow rules. The check_type is assert_rbac. It will run the query and any unexpected results from the query, removing any exempted sources or targets, will be listed as failures. Any expected results that are not seen will also be listed as failures.
Criteria options:
A least one of the above options must be set in this check.
Additional Options:
This checks that the specified attribute is empty. This can optionally be set to also pass if the attribute does not exist. The check_type is empty_typeattr.
Options:
This checks that all file types that are executable are read-only. The check_type is ro_execs.
Options:
Example 1. A check called "no_unconfined" that will determine if the domain_unconfined_type attribute is empty or missing.
[no_unconfined] check_type = empty_typeattr desc = Verify that the domain_unconfined_type attribute is missing or empty. attr = domain_unconfined_type missing_ok = True
Example 2. A check called "ro_execs" that will determine if all executable types are read-only.
[ro_execs] check_type = empty_typeattr desc = Verify that the all executables and libraries are read-only.
Example 3. A check called "execheap" that will determine that there are no domains with the execheap permission except for unconfined_execheap_t.
[execheap] check_type = assert_te desc = Verify no domains have executable heap. tclass = process perms = execheap exempt_source = unconfined_execheap_t
Chris PeBenito <chpebeni@linux.microsoft.com>
Please report bugs via the SETools bug tracker, https://github.com/SELinuxProject/setools/issues
apol(1), sediff(1), sedta(1), seinfo(1), seinfoflow(1), sesearch(1)
2020-06-09 | SELinux Project |