blob: 0c5f998f541212220f7fabd08e202b44859b453d [file] [log] [blame]
Eric Paris1dce0bf2013-01-11 14:23:09 -05001.TH "sepolicy-generate" "8" "20121005" "" ""
2.SH "NAME"
3sepolicy-generate \- Generate an initial SELinux policy module template.
4
5.SH "SYNOPSIS"
6
Dan Walshe6a12982013-10-11 10:16:57 -04007Common options
8
9.B sepolicy generate [\-h ] [\-p PATH]
10
Eric Paris1dce0bf2013-01-11 14:23:09 -050011.br
Dan Walshe6a12982013-10-11 10:16:57 -040012
13Confined Applications
14
15.br
Dan Walshc0ec8822017-05-03 12:30:23 +020016.B sepolicy generate \-\-application [\-n NAME] [\-u USER ]command [\-w WRITE_PATH ]
Dan Walshe6a12982013-10-11 10:16:57 -040017.br
18.B sepolicy generate \-\-cgi [\-n NAME] command [\-w WRITE_PATH ]
19.br
20.B sepolicy generate \-\-dbus [\-n NAME] command [\-w WRITE_PATH ]
21.br
22.B sepolicy generate \-\-inetd [\-n NAME] command [\-w WRITE_PATH ]
23.br
24.B sepolicy generate \-\-init [\-n NAME] command [\-w WRITE_PATH ]
25
26Confined Users
27
28.br
29.B sepolicy generate \-\-admin_user [\-r TRANSITION_ROLE] \-n NAME
30.br
31.B sepolicy generate \-\-confined_admin \-n NAME [\-a ADMIN_DOMAIN] [\-u USER] [\-n NAME] [\-w WRITE_PATH]
32.br
33.B sepolicy generate \-\-desktop_user \-n NAME [\-w WRITE_PATH]
34.br
35.B sepolicy generate \-\-term_user \-n NAME [\-w WRITE_PATH]
36.br
37.B sepolicy generate \-\-x_user \-n NAME [\-w WRITE_PATH]
38.br
39
40Miscellaneous Policy
41
42.br
43.B sepolicy generate \-\-customize \-d DOMAIN \-n NAME [\-a ADMIN_DOMAIN]
44.br
45.B sepolicy generate \-\-newtype \-t type \-n NAME
46.br
47.B sepolicy generate \-\-sandbox \-n NAME
Eric Paris1dce0bf2013-01-11 14:23:09 -050048
49.SH "DESCRIPTION"
Dan Walshe6a12982013-10-11 10:16:57 -040050Use \fBsepolicy generate\fP to generate an SELinux policy Module.
51
52.br
53\fBsepolicy generate\fP will create 5 files.
54
55When specifying a \fBconfined application\fP you must specify a
56path. \fBsepolicy generate\fP will use the rpm payload of the
Laurent Bigonville2e938332013-11-06 13:24:01 +010057application along with \fBnm \-D APPLICATION\fP to help it generate
Dan Walshe6a12982013-10-11 10:16:57 -040058types and policy rules for your policy files.
Eric Paris1dce0bf2013-01-11 14:23:09 -050059
60.B Type Enforcing File NAME.te
61.br
62This file can be used to define all the types rules for a particular domain.
63
Dan Walshe6a12982013-10-11 10:16:57 -040064.I Note:
65Policy generated by \fBsepolicy generate\fP will automatically add a permissive DOMAIN to your te file. When you are satisfied that your policy works, you need to remove the permissive line from the te file to run your domain in enforcing mode.
66
Eric Paris1dce0bf2013-01-11 14:23:09 -050067.B Interface File NAME.if
68.br
69This file defines the interfaces for the types generated in the te file, which can be used by other policy domains.
70
71.B File Context NAME.fc
72.br
73This file defines the default file context for the system, it takes the file types created in the te file and associates
74file paths to the types. Tools like restorecon and RPM will use these paths to put down labels.
75
76.B RPM Spec File NAME_selinux.spec
77.br
Laurent Bigonville2e938332013-11-06 13:24:01 +010078This file is an RPM SPEC file that can be used to install the SELinux policy on to machines and setup the labeling. The spec file also installs the interface file and a man page describing the policy. You can use \fBsepolicy manpage \-d NAME\fP to generate the man page.
Eric Paris1dce0bf2013-01-11 14:23:09 -050079
80.B Shell File NAME.sh
81.br
82This is a helper shell script to compile, install and fix the labeling on your test system. It will also generate a man page based on the installed policy, and
83compile and build an RPM suitable to be installed on other machines
84
85If a generate is possible, this tool will print out all generate paths from the source domain to the target domain
86
87.SH "OPTIONS"
88.TP
89.I \-h, \-\-help
90Display help message
91.TP
Dan Walshe6a12982013-10-11 10:16:57 -040092.I \-d, \-\-domain
93Enter domain type(s) which you will be extending
94.TP
Eric Paris1dce0bf2013-01-11 14:23:09 -050095.I \-n, \-\-name
Dan Walshe6a12982013-10-11 10:16:57 -040096Specify alternate name of policy. The policy will default to the executable or name specified
Eric Paris1dce0bf2013-01-11 14:23:09 -050097.TP
98.I \-p, \-\-path
99Specify the directory to store the created policy files. (Default to current working directory )
100optional arguments:
101.TP
Dan Walshe6a12982013-10-11 10:16:57 -0400102.I \-r, \-\-role
103Enter role(s) to which this admin user will transition.
104.TP
105.I \-t, \-\-type
106Enter type(s) for which you will generate new definition and rule(s)
107.TP
Eric Paris1dce0bf2013-01-11 14:23:09 -0500108.I \-u, \-\-user
109SELinux user(s) which will transition to this domain
110.TP
111.I \-w, \-\-writepath
112Path(s) which the confined processes need to write
113.TP
114.I \-a, \-\-admin
Dan Walshe6a12982013-10-11 10:16:57 -0400115Domain(s) which the confined admin will administrate
Eric Paris1dce0bf2013-01-11 14:23:09 -0500116.TP
117.I \-\-admin_user
118Generate Policy for Administrator Login User Role
119.TP
120.I \-\-application
121Generate Policy for User Application
122.TP
123.I \-\-cgi
124Generate Policy for Web Application/Script (CGI)
125.TP
126.I \-\-confined_admin
127Generate Policy for Confined Root Administrator Role
128.TP
129.I \-\-customize
130Generate Policy for Existing Domain Type
131.TP
132.I \-\-dbus
133Generate Policy for DBUS System Daemon
134.TP
135.I \-\-desktop_user
136Generate Policy for Desktop Login User Role
137.TP
138.I \-\-inetd
139Generate Policy for Internet Services Daemon
140.TP
141.I \-\-init
142Generate Policy for Standard Init Daemon (Default)
143.TP
144.I \-\-newtype
145Generate new policy for new types to add to an existing policy.
146.TP
147.I \-\-sandbox
148Generate Policy for Sandbox
149.TP
150.I \-\-term_user
151Generate Policy for Minimal Terminal Login User Role
152.TP
153.I \-\-x_user
154Generate Policy for Minimal X Windows Login User Role
155
156.SH "EXAMPLE"
Dan Walshe6a12982013-10-11 10:16:57 -0400157.B > sepolicy generate --init /usr/sbin/rwhod
Eric Paris1dce0bf2013-01-11 14:23:09 -0500158.br
159Generating Policy for /usr/sbin/rwhod named rwhod
160.br
Laurent Bigonville2e938332013-11-06 13:24:01 +0100161Created the following files:
Eric Paris1dce0bf2013-01-11 14:23:09 -0500162.br
163rwhod.te # Type Enforcement file
164.br
165rwhod.if # Interface file
166.br
167rwhod.fc # File Contexts file
168.br
169rwhod_selinux.spec # Spec file
170.br
171rwhod.sh # Setup Script
172
173.SH "AUTHOR"
174This man page was written by Daniel Walsh <dwalsh@redhat.com>
175
176.SH "SEE ALSO"
177sepolicy(8), selinux(8)