You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rules containing a space in a dir, path, or exe value were split at the space. The truncated attribute could produce an unintended prefix match, so rule order appeared to override policy.
Add a rule token lexer that removes double-quote delimiters and preserves glob escapes. Apply it to subject and object parsing, reject malformed quotes, and document quote, percent-escape, glob, CLI, and trust-file behavior.
Add regression coverage for quoted dir, path, exe, sets, glob patterns, literal percent escapes, and parent-directory ordering.
Copy file name to clipboardExpand all lines: doc/fapolicyd.rules.5
+43Lines changed: 43 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -162,6 +162,34 @@ is still accepted)
162
162
This option matches against the hash of the file being accessed. The accepted hash length follows the trust source, so RPM entries built with SHA512 store SHA512 digests while other sources may continue to provide SHA256. The hash in the rules should be all lowercase letters and do NOT start with 0x. Lowercase is the default output of sha256sum and sha512sum. The SHA256HASH keyword remains for compatibility but is deprecated; prefer FILE_HASH for new rules.
163
163
.RE
164
164
165
+
.SH QUOTED VALUES
166
+
Rule fields are separated by spaces. Enclose a complete string value in double
167
+
quotes when it contains a space. The surrounding quotes are syntax and are not
168
+
part of the value used for matching. This applies consistently to subject
169
+
.Bexe,
170
+
subject and object
171
+
.Bdir,
172
+
and object
173
+
.BR path :
174
+
175
+
.nf
176
+
.Ballowperm=executeall:dir="/tmp/firstlast/"
177
+
.Ballowperm=executeexe="/tmp/firstlast/tool":all
178
+
.Ballowperm=executeall:path="/tmp/firstlast/tool"
179
+
.fi
180
+
181
+
Double quotes can also be used in named string-set definitions and in each
182
+
comma-separated string value. Within a quoted value, a backslash before a
183
+
double quote or another backslash represents that character. Other backslashes
184
+
are preserved, so glob patterns retain their normal backslash behavior.
185
+
186
+
Percent escapes are not interpreted in rules. For example,
187
+
.Bdir="/tmp/first%20last/"
188
+
matches a literal percent sign followed by \fB20\fP, not a space. A backslash
189
+
before a space and shell-style single quotes are not rule-file quoting forms;
190
+
double quotes are the only supported way to include a literal space in a rule
191
+
value.
192
+
165
193
.SH PATH GLOBBING
166
194
Rule values use exact matching by default. Prefix a value with
167
195
.Bglob:
@@ -223,6 +251,21 @@ pattern. Backslash quotes a metacharacter. Recursive
223
251
.B**
224
252
globstar matching is not supported.
225
253
254
+
When a glob value contains a space, quote the complete value, including the
Copy file name to clipboardExpand all lines: doc/fapolicyd.trust.5
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,17 @@ fapolicyd.trust \- fapolicyd's file of trust
5
5
The file
6
6
.I/etc/fapolicyd/fapolicyd.trust
7
7
contains list of trusted files/binaries for the application whitelisting daemon. You may add comments to the file by starting the line with a '#' character.
8
-
Each line has to contain three columns and space is a valid separator. The first column contains full path to the file, the second is size of the file in bytes
9
-
and the third is valid sha256 hash.
8
+
Each non-comment line contains a full path, size in bytes, and a valid SHA256
9
+
hash. Version 3 trust files write paths without escaping and find the size and
10
+
hash by splitting at the final two spaces. A path may therefore contain spaces.
11
+
The \fBfapolicyd-cli--file\fP commands receive ordinary shell arguments; quote
12
+
a path containing a space in the shell, for example
13
+
\fBfapolicyd-cli--fileadd"/tmp/firstlast/"\fP. In a version 3 trust file,
14
+
\fB%20\fP is a literal percent sign followed by \fB20\fP, not a space.
15
+
.sp
16
+
Version 2 trust files are accepted for compatibility and use their legacy
17
+
percent escaping, including \fB%20\fP for a space. Newly rewritten trust files
18
+
use version 3, so do not use version-2 percent escapes in new entries.
10
19
.sp
11
20
The directory \fI/etc/fapolicyd/trust\&.d\fR can be used to store multiple trust files\&.
12
21
This way a privileged user can split the trust database into multiple files and manage them separately through \fBfapolicyd\-cli\fR\&.
0 commit comments