2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
11 .\" Copyright 2015, Richard Lowe.
13 .TH "PSECFLAGS" "1" "June 6, 2016"
15 \fBpsecflags\fR - inspect or modify process security flags
19 \fB/usr/bin/psecflags\fR \fI-s\fR \fIspec\fR \fI-e\fR \fIcommand\fR \
24 \fB/usr/bin/psecflags\fR \fI-s\fR \fIspec\fR [\fI-i\fR \fIidtype\fR] \
29 \fB/usr/bin/psecflags\fR [\fI-F\fR] { \fIpid\fR | \fIcore\fR }
33 \fB/usr/bin/psecflags\fR \fI-l\fR
37 The first invocation of the \fBpsecflags\fR command runs the specified
38 \fIcommand\fR with the security-flags modified as described by the \fI-s\fR
41 The second invocation modifies the security-flags of the processes described
42 by \fIidtype\fR and \fIid\fR according as described by the \fI-s\fR argument.
44 The third invocation describes the security-flags of the specified processes
45 or core files. The effective set is signified by '\fBE\fR', the inheritable
46 set by '\fBI\fR', the lower set by '\fBL\fR', and the upper set by '\fBU\fR'.
48 The fourth invocation lists the supported process security-flags, documented
49 in \fBsecurity-flags\fR(5).
52 The following options are supported:
59 Interpret the remaining arguments as a command line and run the command with
60 the security-flags specified with the \fI-s\fR flag.
69 Force. Grab the target process even if another process has control.
78 This option, together with the \fIid\fR arguments specify one or more
79 processes whose security-flags will be modified. The interpretation of the
80 \fIid\fR arguments is based on \fIidtype\fR. If \fIidtype\fR is omitted the
83 Valid \fIidtype\fR options are:
90 The \fBpsecflags\fR command applies to all processes
96 \fBcontract\fR, \fBctid\fR
99 The security-flags of any process with a contract ID matching the \fIid\fR
100 arguments are modified.
106 \fBgroup\fR, \fBgid\fR
109 The security-flags of any process with a group ID matching the \fIid\fR
110 arguments are modified.
119 The security-flags of any process with a process ID matching the \fIid\fR
120 arguments are modified. This is the default.
129 The security-flags of any processes whose parent process ID matches the
130 \fIid\fR arguments are modified.
136 \fBproject\fR, \fBprojid\fR
139 The security-flags of any process whose project ID matches the \fIid\fR
140 arguments are modified.
146 \fBsession\fR, \fBsid\fR
149 The security-flags of any process whose session ID matches the \fIid\fR
150 arguments are modified.
159 The security-flags of any process whose task ID matches the \fIid\fR arguments
166 \fBuser\fR, \fBuid\fR
169 The security-flags of any process belonging to the users matching the \fIid\fR
170 arguments are modified.
176 \fBzone\fR, \fBzoneid\fR
179 The security-flags of any process running in the zones matching the given
180 \fIid\fR arguments are modified.
190 List all supported process security-flags, described in
191 \fBsecurity-flags\fR(5).
197 \fB-s\fR \fIspecification\fR
200 Modify the process security-flags according to
201 \fIspecification\fR. Specifications take the form of a comma-separated list of
202 flags, optionally preceded by a '-' or '!'. Where '-' and '!' indicate that the
203 given flag should be removed from the specification. The pseudo-flags "all",
204 "none" and "current" are supported, to indicate that all flags, no flags, or
205 the current set of flags (respectively) are to be included.
207 By default, the inheritable flags are changed. You may optionally specify the
208 set to change using their single-letter identifiers and an equals sign.
210 For a list of valid security-flags, see \fBpsecflags -l\fR.
215 \fBExample 1\fR Display the security-flags of the current shell.
219 example$ \fBpsecflags $$\fR
224 U: aslr,forbidnullmap,noexecstack
230 \fBExample 2\fR Run a user command with ASLR enabled in addition to any
231 inherited security flags.
235 example$ \fBpsecflags -s current,aslr -e /bin/sh\fR
241 U: aslr,forbidnullmap,noexecstack
247 \fBExample 3\fR Remove aslr from the inheritable flags of all Bob's processes.
251 example# \fBpsecflags -s current,-aslr -i uid bob\fR
256 \fBExample 4\fR Add the aslr flag to the lower set, so that all future
257 child processes must have this flag set.
261 example# \fBpsecflags -s L=current,aslr $$\fR
266 The following exit values are returned:
276 An error has occurred.
280 See \fBattributes\fR(5) for descriptions of the following attributes:
288 ATTRIBUTE TYPE ATTRIBUTE VALUE
290 Interface Stability Volatile
297 .BR security-flags (5),