summaryrefslogtreecommitdiffstats
path: root/man/sesearch.1
blob: 573aeddae6c294778ea8beac4a6b58d45848a09e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
.TH sesearch 1
.SH NAME
sesearch \- SELinux policy query tool
.SH SYNOPSIS
.B sesearch
[OPTIONS] RULE_TYPE [RULE_TYPE ...] [EXPRESSION] [POLICY ...]
.SH DESCRIPTION
.PP
.B sesearch
allows the user to search the rules in a SELinux policy.
.SH POLICY
.PP
.B
sesearch
supports loading a SELinux policy in one of four formats.
.IP "source"
A single text file containing policy source for versions 12 through 21. This file is usually named policy.conf.
.IP "binary"
A single file containing a monolithic kernel binary policy for versions 15 through 21. This file is usually named by version - for example, policy.20.
.IP "modular"
A list of policy packages each containing a loadable policy module. The first module listed must be a base module.
.IP "policy list"
A single text file containing all the information needed to load a policy, usually exported by SETools graphical utilities.
.PP
If no policy file is provided,
.B
sesearch
will search for the system default policy: checking first for a source policy, next for a binary policy matching the running kernel's preferred version, and finally for the highest version that can be found.
In the latter case, the policy will be downgraded to match the running system.
If no policy can be found,
.B
sesearch
will print an error message and exit.
.SH RULE TYPE OPTIONS
.P
.B
sesearch
is capable of searching multiple types of rules. At least one of the following
must be provided to specify the desired type(s) of rules to search.
.IP "-A, --allow"
Search for allow rules.
.IP "--neverallow"
Search for neverallow rules.
.IP "--auditallow"
Search for auditallow rules.
.IP "--dontaudit"
Search for dontaudit rules.
.IP "-T, --type"
Search for type_transition, type_member, and type_change rules.
.IP "--role_allow"
Search for role allow rules.
.IP "--role_trans"
Search for role_transition rules.
.IP "--range_trans"
Search for range_transition rules.
.IP "--all"
Search all rule types.
.SH EXPRESSIONS
.P
The user may specify an expression containing values for a given field(s) in a rule.
Only those fields applicable to a given rule type will be used; all other fields will be ignored.
(For example, type_transition rules will ignore the permissions field.)
If no expression is specified or if none of the specified fields apply to a given rule type,
all rules of that type are considered to match the expression.
.IP "-s NAME, --source=NAME"
Find rules with type/attribute NAME as their source.
.IP "-t NAME, --target=NAME"
Find rules with type/attribute NAME as their target.
.IP "-D NAME, --default=NAME"
Find rules with type NAME as their default.
.IP "--role_source=NAME"
Find rules with role NAME as their source.
.IP "--role_target=NAME"
Find rules with role NAME as their target.
.IP "-c NAME, --class=NAME"
Find rules with class NAME as their object class.
.IP "-p P1[,P2,...] --perm=P1[,P2...]"
Find rules with at least one of the specified permissions.
Multiple permissions may be specified as a comma separated list;
it is recommended that this list be quoted for shells that interpret comma as a special character.
.IP "-b NAME, --bool=NAME"
Find conditional rules with NAME in their conditional expression.
This option will include rules in both the true and false lists of the conditional.
.SH OPTIONS
.P
The following additional options exist to modify how the search is performed and the amount of information printed for each result.
.IP "-d, --direct"
Normally rules are matched using the type given or any of that type's
attributes (or an attribute's types).  This "indirect" matching also
considers types used in complemented sets, the special set "*", and
the special target "self".  When the direct flag is given, matching is
done literally.  The rule must explicitly contain the given type (or
attribute) for it to be returned.
.IP "-R, --regex"
Use regular expressions to match symbol names.  By default only exact
string matches will be considered.
.IP "-n, --linenum"
Print the line number for each rule.  This option is ignored if using the --semantic option or if line numbers are not available for the given policy.
.IP "-S, --semantic"
Search rules semantically instead of syntactically. This option is implied for policies for which syntactic rules are not available.
.IP "-C, --show_cond"
Print the conditional expression and state for all conditional rules found.
This option has no effect on unconditional rules.
.IP "-h, --help"
Print help information and exit.
.IP "-V, --version"
Print version information and exit.
.SH AUTHOR
This manual page was written by Jeremy A. Mowery <jmowery@tresys.com>.
.SH COPYRIGHT
Copyright(C) 2003-2008 Tresys Technology, LLC
.SH BUGS
Please report bugs via an email to setools-bugs@tresys.com.
.SH SEE ALSO
seinfo(1), apol(1)