Qualifier blocks
nesting and conflicts for application developers
A brace block inside a profile applies the qualifiers written in front of it to every rule inside. Blocks nest and their qualifiers combine with those of the rules. Contradicting access types and a priority on a block are errors.
On the map: qualifiers
▶ Watch this deck — 8 scenes, ~6 min
Worth seeing first
- allow and deny — the row of qualifier seats and the access type
- The audit qualifier — the audit qualifier a block can hand to its rules
- The owner qualifier — the owner qualifier and which rules accept it
01 The same qualifier on line after line
QUALIFIERS { RULES } applies the qualifiers to every rule inside the braces. No comma follows the closing brace.
The profile for demo denies writing to a few kernel directories. Three rules, and three times the word deny. A qualifier block lets you say it once. You write the qualifier, an opening brace, the rules just as usual, and a closing brace. The parser gives the qualifier to every rule inside, so the block and the three separate rules compile to the same policy. One detail: there's no comma after the closing brace. A block isn't a rule. It's a container for rules. The example profile already uses this shape.
Details and sources
Details
- A qualifier block is
QUALIFIERS { RULES }inside a profile body. The qualifiers in front of the opening brace are applied to every rule inside when the block is parsed (parser_yacc.y:738-759, block.cc:273-284). - The slide's three-rule
deny { ... }block is accepted by the parser built from AppArmor 836052d21 (run with-Q -K --skip-kernel-load --warn=all; nothing was loaded into a kernel). - That a block and its expanded form compile to the same binary policy is what the tree's equality tests check, for example
prompt { /foo r, audit /bar w, owner /baz rw, }against the three separate rules (equality.sh:1445-1447). - No comma after the closing brace.
deny { /sys/** w, },is rejected by the same parser: "syntax error, unexpected TOK_END_OF_RULE, expecting TOK_ID or TOK_MODE or TOK_SET_VAR". - Full form of a parser error:
AppArmor parser error for FILE in profile FILE at line N: MESSAGE. The slides of this deck show MESSAGE only. - Line 34 of the map's example profile is
deny { /proc/sys/** w, /sys/** w, }. The rule/boot/** w,is added on the slide to make the repetition visible.
Read more
- apparmor.d(5) Qualifier Blocks and apparmor.d(5) Rule Qualifiers
- why-apparmor: the program
demoand its profile. - syn-allow-deny: what
denydoes to a rule.
02 Qualifiers, brace, rules, brace
[audit] [allow|deny|prompt] [owner|other] { RULES }. No priority. Blocks may be empty, bare and nested.
The grammar is the row of qualifier seats you already know, then braces. One seat is missing: priority can't go on a block. Audit, an access type, and owner or other can stand in front, alone or together, in the usual order. A block with no qualifier at all is legal too, and simply groups rules. So is an empty one. Inside the braces you can write whatever a profile body allows: rules of any class, conditional blocks, and more qualifier blocks. The rules inside still end with their commas.
Details and sources
Details
- Grammar:
[audit] [allow|deny|prompt] [owner|other] '{' RULES '}'. The qualifiers keep the order they have in front of a rule;priority=Nis refused on a block with "priority is not allowed on rule blocks" (block.h:46-51). - The manual's grammar line is
BLOCK = '{' ( RULES )* '}'(apparmor.d.pod:196). - A block holds whatever the profile body holds: rules of any class, nested qualifier blocks,
ifblocks, and by the grammar also hats and child profiles (parser_yacc.y:738-759). - Accepted in one profile by the parser built from AppArmor 836052d21 (
-Q -K --skip-kernel-load --warn=all):deny { audit /a r, },audit { deny /b r, },allow { /c r, },{ /d r, },owner { }andaudit deny { /proc/sys/** w, /sys/** w, }. - Test fixtures in the tree: ok_block1.sd (
deny,auditand bare blocks), ok_1.sd (owner { ... }and an emptyowner { }), entry_mods_audit_ok1.sd (audit { ... }). allow { R }around a rule with no access type is the same asR. The difference between a plain rule and anallowrule shows only in adenyblock: the plain rule becomes a deny, theallowrule is an error (see the conflicts scene of this deck).
Read more
- apparmor.d(5) Qualifier Blocks and apparmor.d(5) Rule Qualifiers
- syn-priority: the qualifier a block does not take.
- syn-boolean-conditionals:
ifblocks. - syn-hats and syn-child-profiles: the other things braces enclose.
03 The qualifier travels to each rule
A block's qualifiers are applied to each contained rule when the block is parsed. Compiled policy contains no blocks.
So what does the parser do with a block? When it reaches the closing brace, it takes the block's qualifiers and hands a copy to each rule inside, whatever the rule's class. Here a file rule, a capability rule and a signal rule all become audited. After that the block is gone: the compiled policy holds rules, not blocks. That has one consequence worth remembering. A qualifier that a rule class refuses on its own is refused through a block as well. So an owner block may contain only file rules, and a capability inside one is an error.
Details and sources
Details
- When the parser reaches the closing brace it applies the block's qualifiers to the contents, then attaches the contents to the enclosing block or profile (parser_yacc.y:754-757).
- The qualifiers reach every rule class: file rules, the rule classes with their own keyword, capabilities and rlimits (block_rules.cc:612-640).
- The slide's
audit { }block with a file rule, a capability rule and a signal rule is accepted by the parser built from AppArmor 836052d21 (-Q -K --skip-kernel-load --warn=all). - Blocks do not exist in compiled policy. Nothing in the binary profile records that a rule came from a block (from the code: each rule is compiled with its own qualifiers).
- A rule class that refuses a qualifier refuses it through a block as well. Run with the same parser:
owner { capability chown, }gives "owner prefix not allowed on capability rules" (block_rules.h:69, fixture bad_7.sd);deny { set rlimit cpu <= 10, }gives "prefix not allowed on rlimit rules". - Run with the same parser (
audit { ^hat { /a r, } }compiles to the same binary as^hat { audit /a r, }, and likewise for a child profile): a hat or child profile defined inside a qualifier block receives the block's qualifiers on its own rules (block.cc:259-268).
for AppArmor developers for security researchers
Internals
rules: rules opt_prefix blockcallssubblock->add_prefix($2, error)and thencurrent->add_subblock(subblock, error).block::add_prefix(block.cc:273-284) visits the block, nested blocks, every conditional branch and hats throughfor_each_recursive(block.cc:228-271). The next developer scene follows this path.
Read more
- apparmor.d(5) Qualifier Blocks
- syn-owner: why
owneris for file rules only. - syn-audit: what an audited rule logs.
04 Block qualifier meets rule qualifier
Qualifiers from the block and from the rule combine. deny { audit R } and audit { deny R } both mean audit deny R.
Rules inside a block can bring qualifiers of their own, and the two sets are merged. The pair to understand is audit and deny. A deny block around a plain rule gives a quiet deny. A deny block around an audit rule gives audit deny: a refusal that is logged. An audit block around a deny rule gives the same. Different seats simply add up, so an audit block around an owner rule is audit owner. In a deny block, then, you choose rule by rule which refusals you want to hear about. One of the parser's own tests does that with two capabilities.
Details and sources
Details
- Combination rules, from the code (rule.h:397-440 for rule classes with their own keyword, parser_misc.c:1111-1142 for file rules):
| Block | Rule inside | Result |
|---|---|---|
| any | no qualifier in that seat | the block's qualifier |
deny | plain | deny (quiet) |
deny | audit | audit deny |
audit | deny | audit deny |
audit | owner (file rule) | audit owner |
allow | plain or allow | allow |
deny | allow, prompt | error: "conflicting mode prefix" |
allow, prompt | deny | error: "conflicting mode prefix" |
- Rows 2 and 3 of the slide (
deny { audit /sys/** w, },audit { deny /sys/** w, }) are accepted by the parser built from AppArmor 836052d21 (-Q -K --skip-kernel-load --warn=all). That both compile likeaudit denyfollows from the combination code above and is what the manual states (apparmor.d.pod:2679-2684); the three forms compile to the same binary with the parser built from this commit. - A plain
denyis quiet: the refusal leaves no log record.audit denyis a refusal that is logged. See syn-allow-deny and syn-audit. - Capabilities are kept as four groups (allowed, allowed and audited, denied quietly, denied and audited) and regrouped when a block's qualifiers arrive. A
denyblock turns all of them into denials and keeps "audited" for those that had it (block_rules.h:76-110). The fixture on the slide is ok_block1.sd. - Known discrepancy, not intended behaviour: a
deny { }block around a rule that is alreadyaudit deny, anddeny { deny { audit R } }, lose the audit for rules other than capabilities, so the denial is quiet. The manual says the result is an audited denial. Confirmed with the parser built from this commit, for file, signal and ptrace rules, by comparing binary output and rule dumps; the code is rule.h:428-438, parser_misc.c:1132-1142. Writeaudit denyon the rule, in anauditblock or in no block, and do not rely on this.
for security researchers
Attack surface
- A
deny { }block silently removes an audit trail.deny { audit deny R }anddeny { deny { audit R } }compile to a quiet deny for file, signal and ptrace rules: the access is still refused, but the record the author asked for is never written (run with the parser built from the AppArmor tree at 836052d21, nothing loaded into a kernel; rule.h:428-438, parser_misc.c:1132-1140). Capability rules keep the audit. - A block changes the meaning of text far below it. Wrapping an included file or a long group of rules in
deny { },audit { }orowner { }changes every rule inside, including rules inifbranches, hats and child profiles defined in the block (same run). prompt { capability X, }grants the capability: see prompt.owner { change_profile -> x, }is accepted and compiles like the rule without the block, although the direct form is an error.
Read more
- apparmor.d(5) Qualifier Blocks and apparmor.d(5) Rule Qualifiers
- syn-allow-deny: quiet denials.
- syn-audit:
auditandaudit deny. - syn-capability: capability rules.
05 Blocks inside blocks
Nested blocks apply inner qualifiers first, then outer ones. audit { deny { R } } equals deny { audit { R } } equals audit deny R.
Blocks nest. Put a rule in a deny block, and that inside an audit block, and the rule gets both qualifiers. The inner block is finished first, so the rule receives deny, then audit. Turn the nesting around and it receives audit, then deny. The result is the same either way: audit deny. That's the example the manual uses. Nesting earns its keep when one outer qualifier covers different inner ones: an audit block that holds a deny block for some paths and an owner block for others.
Details and sources
Details
- Blocks nest to any depth. An inner block is complete before the block around it, so a rule receives the innermost qualifiers first and the outermost last (parser_yacc.y:743-759).
- The manual states that the order of nesting does not matter and gives the network example of the slide:
audit { deny { network inet stream, } }anddeny { audit { network inet stream, } }"both resolve to"audit deny network inet stream,(apparmor.d.pod:2600-2624). - The line
audit { deny { /etc/demo/** w, } owner { /var/lib/demo/** rw, } }is accepted exactly as written by the parser built from AppArmor 836052d21 (-Q -K --skip-kernel-load --warn=all). The two rules under it are what the combination code gives, and the two forms compile to the same binary. - Known discrepancy, not intended behaviour: order independence does not hold for
deny { deny { audit R } }, which ends as a quiet deny for rules other than capabilities (see the details of the combining scene and the reference below). - Nested blocks must still agree:
deny { allow { R } }names two access types for R and is refused likedeny { allow R }(both forms run with the same parser:conflicting mode prefix).
Read more
- apparmor.d(5) Qualifier Blocks
- syn-network: the rule in the manual's example.
- syn-owner and syn-allow-deny: the inner blocks of the last example.
06 block::add_prefix for AppArmor developers for security researchers
block::add_prefix (parser/block.cc:273-284) pushes the prefix through nested blocks, conditionals and hats; conflicts are detected in prefix_rule_t::add_prefix (parser/rule.h:385-440) and generic_add_prefix (parser/parser_misc.c:1111-1142).
The block class derives from prefix_rule_t, so a block can itself receive a prefix from an outer block. The grammar action calls add_prefix on the sub block, then attaches it to the enclosing one. The block's add_prefix walks its own rule set, nested blocks, every branch of each conditional without evaluating it, and hats. Each kind of content takes it differently: file entries through entry_add_prefix, rule objects through their own add_prefix, capabilities by recomputing four sets, and rlimits by refusing. The conflict checks sit in the per rule add_prefix. The first rejects any rule that already has a priority. A priority on the block itself is refused by the block's valid_prefix.
Details and sources
for AppArmor developers for security researchers
Details
- Grammar:
block: TOK_OPEN rules TOK_CLOSEandrules: rules opt_prefix block; the action callssubblock->add_prefix($2, error)and thencurrent->add_subblock(subblock, error)(parser_yacc.y:738-759). class block: public prefix_rule_twithsubblocks,conds,rules(ablock_rules) andhats;block::valid_prefixreturns "priority is not allowed on rule blocks" whenp.priority != 0(block.h:34-52).bool block::add_prefix(const prefixes &p, const char *&error)first runsprefix_rule_t::add_prefixon the block itself, thenfor_each_recursive(..., false, true):eval_cond=falsevisits everycond_blockof every conditional set,apply_to_hats=truedescends into each hat'smain_block(block.cc:228-284).bool block_rules::add_prefix(const prefixes &p, const char *&error)setsuses_prompt_rulesfor a prompt prefix, callsentry_add_prefixon eachcod_entry(file and change_profile entries),add_prefixon each rule object,net.apply_compat_prefix(p)for the legacy network table, thencaps.add_prefixandrlimits.add_prefix(block_rules.cc:612-640).prefix_rule_t::add_prefix(rule.h:385-440):valid_prefix, thenpriority != 0gives "priority levels not supported" (the test looks at the rule's own priority, not at the prefix), then the audit, mode and owner conflict tests, then the audit and deny combination.generic_add_prefixandentry_add_prefix(parser_misc.c:1111-1159): mode conflict,if (p.priority != 0) entry->priority = p.priority;, audit conflict, the audit and deny combination, then the owner or other mask andcheck_x_qualifier. There is no owner conflict test and no change_profile test here. That is whyowner { other /foo r, }andowner { change_profile -> x, }are accepted by the parser built from this commit; both are known discrepancies, see the reference below.- Capabilities: the four sets
allow,audit,deny,quietare decomposed into four exclusive groups and rebuilt for the prefix (block_rules.h:62-110). Rlimits: any prefix on a block that sets an rlimit gives "prefix not allowed on rlimit rules" (parser.h:170-180). add_subblockmerges capabilities, rlimits, the legacy network table and the uses-prompt flag into the enclosing block, because those are encoded once per profile (block.cc:155-175, block_rules.cc:181-200). Each block later emits its own rules inblock::gen_policy_re(block.cc:86-110).
for AppArmor developers for security researchers
Read more
- apparmor.d(5) Qualifier Blocks and apparmor.d(5) Rule Qualifiers
- fe-grammar: the grammar and its actions.
- fe-rule-classes:
prefix_rule_tandvalid_prefixper rule class. - fe-post-process: what happens to the rules after parsing.
07 Blocks the parser refuses
"conflicting mode prefix": the block and a rule name different access types. "priority is not allowed on rule blocks". Non-file rules with priority= are rejected inside blocks ("priority levels not supported").
A block and a rule inside it must not contradict each other. Deny around an explicit allow is a conflicting mode prefix. A rule with no access type is fine there: it just becomes a deny. Priority has no place on a block. And at this version a signal rule, or any rule that isn't a file rule, can't carry its own priority inside a block either, while a file rule can. Owner blocks accept only file rules. Rlimit rules take no qualifier at all. And if you forget the closing brace, the profile's last brace is taken for it, and the error arrives at the end of the file.
Details and sources
Details
All six rows were run with the parser built from AppArmor 836052d21 (-Q -K --skip-kernel-load --warn=all), each as the only content of a profile.
| Input | Message |
|---|---|
deny { allow /etc/demo/** r, } | conflicting mode prefix |
priority=1 { /etc/demo/** r, } | priority is not allowed on rule blocks |
audit { priority=1 signal, } | priority levels not supported |
owner { capability chown, } | owner prefix not allowed on capability rules |
deny { set rlimit cpu <= 10, } | prefix not allowed on rlimit rules |
owner { /var/lib/demo/** rw, and no closing brace | syntax error, unexpected end of file, expecting TOK_ID or TOK_MODE or TOK_SET_VAR |
- A rule with no access type inside a
denyblock is not a conflict; it becomes a deny. Only an explicitalloworpromptcontradictsdeny. - Sources of the messages: rule.h:409-416 and parser_misc.c:1113-1120 (mode), block.h:46-51 (priority on a block), rule.h:391-394 (priority inside a block), block_rules.h:69 (owner on capabilities), parser.h:170-180 (rlimits).
- Fixtures: bad_8.sd (missing brace), bad_7.sd, bad_rlimit_block_deny.sd.
- Also run with the same parser: a bare
{ priority=1 signal, }fails like row 3;audit { priority=5 /etc/demo/override.conf r, }andowner { priority=1 /a r, }are accepted, and the tree tests the second (equality.sh:665-669). - Known discrepancy: the different treatment of file rules and all other rule classes for
priority=inside a block. The slide states what the parser does at this commit; whether the restriction or the exception is intended is open. A comment above the test reads like an unfinished feature (rule.h:385-394). - "conflicting owner prefix" and "conflicting audit prefix" exist in the parser (rule.h:397-426), but no input tried produces them:
owner { other /foo r, }andaudit { audit /a r, }are accepted. The first is a known discrepancy (the rule ends with no file permission); see the reference below. - apparmor_parser 5.0.2 accepts
deny { allow R }; the parser built from this commit refuses it.
Read more
- apparmor.d(5) Qualifier Blocks
- syn-priority: priority on rules.
- syn-rlimit: rlimit rules take no qualifiers.
- syn-other:
other, and whatowner { other ... }does. - sec-bugs: the known parser discrepancies in one place.
08 Where to go from here
Next: syn-allow-deny, syn-audit, syn-owner (the qualifiers a block can carry), syn-boolean-conditionals (the other brace block).
A qualifier block changes nothing that a few more keystrokes couldn't. Use it where it makes a profile easier to read: a deny block for the things a program must not touch, an owner block for per-user files, an audit block around what you want a trail of. Each of those qualifiers has its own deck, and so does priority, the one a block can't take. Don't confuse these braces with the ones after if: a conditional block decides whether its rules exist at all. And if you want to see the code that walks a block, the parser decks are one road further.
Details and sources
Details
- A qualifier block is notation: the block and its expanded rules compile to the same policy, which the tree's equality tests check for several block forms (equality.sh:1445-1447).
- Qualifiers a block can carry:
audit, one ofallow,denyorprompt, and one ofownerorother. Notpriority(block.h:46-51). - The braces after
ifbelong to a conditional block, which decides at compile time whether the rules inside are part of the profile. A conditional takes no qualifiers of its own, but it may stand inside a qualifier block and then its rules receive the block's qualifiers (from the code, block.cc:228-284).
Read more
Basis of the statements on this page: "tree" means the parser built from AppArmor 836052d21 (6.0.0~alpha2) was run on the fragment (-Q -K --skip-kernel-load --warn=all), with nothing loaded into a kernel; "5.0.2" means apparmor_parser 5.0.2 was run the same way; "code" means the statement comes from reading the parser source at that commit and was not run. Blocks exist only in the profile text: compiled policy contains rules, so there is no kernel behaviour specific to blocks.
Grammar
BLOCK = [audit] [allow|deny|prompt] [owner|other] '{' ( RULE | BLOCK | CONDITIONAL | HAT | PROFILE )* '}'
- No comma after
}.deny { /sys/** w, },gives "syntax error, unexpected TOK_END_OF_RULE, expecting TOK_ID or TOK_MODE or TOK_SET_VAR" (tree). - An empty block (
owner { }) and a bare block ({ capability setuid, }) are valid (tree). priority=Nis not allowed in front of a block (tree).- Rules inside keep their own syntax, including the trailing comma.
- The manual's grammar line is
BLOCK = '{' ( RULES )* '}'(apparmor.d.pod:196); the parser's productions are at parser_yacc.y:738-759.
How qualifiers combine
| Block | Rule inside | Result | Basis |
|---|---|---|---|
| none (bare) | any | the rule's own qualifiers | tree |
audit | plain | audit | tree |
deny | plain | deny, quiet | tree |
deny | audit | audit deny | accepted: tree; result: code |
audit | deny | audit deny | accepted: tree; result: code |
allow | plain | allow | tree |
allow | deny | error: conflicting mode prefix | code |
deny | allow | error: conflicting mode prefix | tree |
prompt | deny | error: conflicting mode prefix | code |
owner | file rule | owner | tree |
owner | rule of another class | error: owner prefix not allowed on X rules | tree for capability; code for the others |
audit { deny { R } }, deny { audit { R } } | audit deny R | accepted: tree; result: code and the manual |
Nested blocks apply inner qualifiers first, then outer ones. For audit and deny the manual states that the order does not matter (apparmor.d.pod:2600-2624); the exception is listed under known discrepancies.
What a block may contain per qualifier
ownerandotherblocks: file rules, the barefile,rule and link rules only. Any other rule class is an error (code; capability: tree).- Any block with a qualifier: no rlimit rules ("prefix not allowed on rlimit rules", tree). A bare block may hold them (tree).
- Capabilities in a
denyblock all become denied; those written withauditstay audited (code: block_rules.h:76-110; accepted by the tree's fixture ok_block1.sd). - A
promptblock treats capabilities as allowed:prompt { capability chown, }compiles to the same binary ascapability chown,(tree). - Rules with their own
priority=: file rules only (tree); see known discrepancies.
Errors and warnings
The full form of an error is AppArmor parser error for FILE in profile FILE at line N: MESSAGE.
| Message | Example that triggers it | Basis |
|---|---|---|
conflicting mode prefix | deny { allow /etc/demo/** r, } | tree |
priority is not allowed on rule blocks | priority=1 { /etc/demo/** r, } | tree |
priority levels not supported | audit { priority=1 signal, }, { priority=1 signal, } | tree |
owner prefix not allowed on capability rules | owner { capability chown, } | tree |
owner prefix not allowed on X rules (unix, mqueue, ptrace, network, dbus, all, signal, io_uring, mount, userns) | an owner or other block around such a rule | code |
prefix not allowed on rlimit rules | deny { set rlimit cpu <= 10, } | tree |
conflicting audit prefix, conflicting owner prefix | present in the parser; not produced by audit { audit /a r, } or owner { other /foo r, }, which are accepted | tree |
syntax error, unexpected end of file, expecting TOK_ID or TOK_MODE or TOK_SET_VAR | owner { /var/lib/demo/** rw, without } | tree |
syntax error, unexpected TOK_END_OF_RULE, expecting TOK_ID or TOK_MODE or TOK_SET_VAR | deny { /sys/** w, }, | tree |
No warning is specific to blocks.
Known discrepancies
These are not intended behaviour and should not be relied on. The map's sec-bugs deck collects such findings.
deny { audit deny R }anddeny { deny { audit R } }lose the audit for rules other than capabilities: the result is a quiet deny. The manual says a deny applied to a rule that carries audit is an audited denial (apparmor.d.pod:2679-2684). Basis: tree, for file, signal and ptrace rules; the code is rule.h:428-438, parser_misc.c:1132-1142.owner { other R }is accepted and R ends with no file permission, with no message (tree; parser_misc.c:1147-1159 has no conflict test). See syn-other.owner { change_profile -> x, }is accepted althoughowner change_profile -> x,is rejected with "owner conditional not allowed on change_profile rules" (tree). The compiled rule is identical to the one without the block (tree).- A rule of a class other than file with
priority=is rejected in any block, even a bare one, while a file rule withpriority=is accepted (tree; rule.h:385-394 against parser_misc.c:1121-1122). The restriction may be deliberate; the difference between rule classes is the discrepancy. See syn-priority. - apparmor_parser 5.0.2 accepts
deny { allow R }; the tree refuses it with "conflicting mode prefix".
Hats, child profiles and conditionals inside a block
- Hats and child profiles defined inside a qualifier block receive its qualifiers on their rules (block.cc:259-268, block.cc:273-284);
audit { ^hat { /a r, } }compiles to the same binary as^hat { audit /a r, }, and the same holds for a child profile (tree). - Rules inside an
iforelsebranch that stands in a qualifier block receive the qualifiers whichever branch is later chosen (block.cc:240-257); the rule taken fromaudit { if $FOO { /a r, } else { /b r, } }is dumped with the audit mask (tree).
for AppArmor developers for security researchers
Code map
| Step | Where |
|---|---|
productions block and rules: rules opt_prefix block | parser_yacc.y:738-759 |
class block: public prefix_rule_t, block::valid_prefix | block.h:34-52 |
block::for_each_recursive(func, eval_cond, apply_to_hats) | block.cc:228-271 |
block::add_prefix (eval_cond=false, apply_to_hats=true) | block.cc:273-284 |
block_rules::add_prefix | block_rules.cc:612-640 |
prefix_rule_t::add_prefix: priority test, conflict tests, audit and deny combination | rule.h:385-440 |
generic_add_prefix, entry_add_prefix for cod_entry (file and change_profile entries) | parser_misc.c:1111-1159 |
| capability sets recomputed for a prefix | block_rules.h:62-110 |
| rlimits refuse any prefix | parser.h:170-180 |
add_subblock: per-profile data (capabilities, rlimits, legacy network table, uses-prompt flag) merged upward | block.cc:155-175, block_rules.cc:181-200 |
block::gen_policy_re: each block emits its rules | block.cc:86-110 |
Roads from here
START HERE
- The profile language at a glance — every kind of line on one page
PREAMBLE AND REUSE
- Conditional blocks — the other kind of brace block
QUALIFIERS
- allow and deny — the access types a block can carry
- The audit qualifier — audit blocks and audit deny
- The owner qualifier — owner blocks hold only file rules
- Rule priority — why a block has no priority
PROFILE STRUCTURE
- Comments and line structure — braces and commas in the profile body
INSIDE THE PARSER
- The grammar — how blocks are parsed
- Rule objects (no slides yet) — how each rule class takes a prefix