Update manpage for pledge()
[priv_wrapper.git] / doc / priv_wrapper.1
1 '\" t
2 .\"     Title: priv_wrapper
3 .\"    Author: Samba Team
4 .\" Generator: Asciidoctor 2.0.17
5 .\"      Date: 2022-09-14
6 .\"    Manual: \ \&
7 .\"    Source: \ \&
8 .\"  Language: English
9 .\"
10 .TH "PRIV_WRAPPER" "1" "2022-09-14" "\ \&" "\ \&"
11 .ie \n(.g .ds Aq \(aq
12 .el       .ds Aq '
13 .ss \n[.ss] 0
14 .nh
15 .ad l
16 .de URL
17 \fI\\$2\fP <\\$1>\\$3
18 ..
19 .als MTO URL
20 .if \n[.g] \{\
21 .  mso www.tmac
22 .  am URL
23 .    ad l
24 .  .
25 .  am MTO
26 .    ad l
27 .  .
28 .  LINKSTYLE blue R < >
29 .\}
30 .SH "NAME"
31 priv_wrapper \- A library to disable resource limits and other priviledge dropping.
32 .SH "SYNOPSIS"
33 .sp
34 LD_PRELOAD=libpriv_wrapper.so PRIV_WRAPPER=1 [PRIV_WRAPPER_CHROOT_DISABLE=1] [PRIV_WRAPPER_PRCTL_DISABLE=<options>] [PRIV_WRAPPER_SETRLIMIT_DISABLE=<options>]
35 .SH "DESCRIPTION"
36 .sp
37 priv_wrapper aims to help running processes which are dropping privileges or are
38 restricting resources in test environments.
39 It can disable chroot, prctl, pledge and setrlmit system calls. A disabled call always
40 succeeds (i.e. returns 0) and does nothing.
41 The system call pledge exists only on OpenBSD.
42 .SH "ENVIRONMENT VARIABLES"
43 .sp
44 \fBPRIV_WRAPPER\fP
45 .RS 4
46 This variable activates priv_wrapper when set to \fI1\fP.
47 .RE
48 .sp
49 \fBPRIV_WRAPPER_DISABLE_DEEPBIND\fP
50 .RS 4
51 This allows you to disable deep binding in priv_wrapper.
52 This is useful for running valgrind tools or sanitizers like (address, undefined, thread).
53 .RE
54 .sp
55 \fBPRIV_WRAPPER_CHROOT_DISABLE\fP
56 .RS 4
57 If this is set to \fI1\fP then chroot() system call will be disabled.
58 .RE
59 .sp
60 \fBPRIV_WRAPPER_PRCTL_DISABLE\fP
61 .RS 4
62 prctl calls can be disabled using this environment variable. You can either disable all
63 calls using PRIV_WRAPPER_PRCTL_DISABLE=ALL or special options using e.g.
64 PRIV_WRAPPER_PRCTL_DISABLE=PR_SET_SECCOMP|PR_SET_NO_NEW_PRIVS
65 .RE
66 .sp
67 Supported options are:
68 .sp
69 PR_SET_SECCOMP
70 PR_SET_NO_NEW_PRIVS
71 PR_SET_DUMPABLE
72 .sp
73 \fBPRIV_WRAPPER_SETRLIMIT_DISABLE\fP
74 .RS 4
75 Either all resource limits can be disabled using PRIV_WRAPPER_SETRLIMIT_DISABLE=ALL or
76 you can pick specific resources using e.g:
77 .RE
78 .sp
79 PRIV_WRAPPER_SETRLIMIT_DISABLE=RLIMIT_STACK|RLIMIT_CORE
80 .sp
81 Supported options are:
82 .sp
83 RLIMIT_CPU
84 RLIMIT_FSIZE
85 RLIMIT_DATA
86 RLIMIT_STACK
87 RLIMIT_CORE
88 RLIMIT_RSS
89 RLIMIT_NOFILE
90 RLIMIT_AS
91 RLIMIT_NPROC
92 RLIMIT_MEMLOCK
93 RLIMIT_LOCKS
94 RLIMIT_SIGPENDING
95 RLIMIT_MSGQUEUE
96 RLIMIT_NICE
97 RLIMIT_RTPRIO
98 RLIMIT_RTTIME
99 RLIMIT_NLIMITS
100 .sp
101 \fBPRIV_WRAPPER_PLEDGE_DISABLE\fP
102 .RS 4
103 If this is set to \fI1\fP then pledge() system call will be disabled.
104 .RE
105 .sp
106 \fBPRIV_WRAPPER_DEBUGLEVEL\fP
107 .RS 4
108 If you need to see what is going on in priv_wrapper itself or try to find a
109 bug, you can enable logging support in priv_wrapper if you built it with
110 debug symbols.
111 .sp
112 .RS 4
113 .ie n \{\
114 \h'-04'\(bu\h'+03'\c
115 .\}
116 .el \{\
117 .  sp -1
118 .  IP \(bu 2.3
119 .\}
120 0 = ERROR
121 .RE
122 .sp
123 .RS 4
124 .ie n \{\
125 \h'-04'\(bu\h'+03'\c
126 .\}
127 .el \{\
128 .  sp -1
129 .  IP \(bu 2.3
130 .\}
131 1 = WARNING
132 .RE
133 .sp
134 .RS 4
135 .ie n \{\
136 \h'-04'\(bu\h'+03'\c
137 .\}
138 .el \{\
139 .  sp -1
140 .  IP \(bu 2.3
141 .\}
142 2 = DEBUG
143 .RE
144 .sp
145 .RS 4
146 .ie n \{\
147 \h'-04'\(bu\h'+03'\c
148 .\}
149 .el \{\
150 .  sp -1
151 .  IP \(bu 2.3
152 .\}
153 3 = TRACE
154 .RE
155 .RE
156 .SH "EXAMPLE"
157 .sp
158 LD_PRELOAD=libpriv_wrapper.so PRIV_WRAPPER=1 PRIV_WRAPPER_PRCTL_DISABLE="PR_SET_SECCOMP|PR_SET_NO_NEW_PRIVS"
159 .sp
160 LD_PRELOAD=libpriv_wrapper.so PRIV_WRAPPER=1 PRIV_WRAPPER_CHROOT_DISABLE=1 PRIV_WRAPPER_PRCTL_DISABLE=ALL PRIV_WRAPPER_SETRLIMIT_DISABLE="RLIMIT_CPU|RLIMIT_DATA|RLIMIT_NLIMITS"
161 .SH "AUTHOR"
162 .sp
163 Samba Team