Network address conditionals

ip, port, interface for application developers for administrators for security researchers

Network rules for inet and inet6 accept ip= port= interface= and label= and a peer=( ) group for the remote end. The parser checks and compiles them only for a feature set that has af_inet. The mainline kernel has none and checks family type and protocol only so there the conditionals are dropped at compile time without a message.

On the map: rule classes

▶ Watch this deck — 9 scenes, ~6 min

Worth seeing first

Part of journeys

01 Only this address, only this port

NETWORK ADDRESS CONDITIONALS network inet stream, demo bind 127.0.0.1:8080 bind 0.0.0.0:22 connect 203.0.113.9:443 all three allowed network (bind, listen, accept) inet stream ip=127.0.0.1 port=8080, local address local port what the rule is meant to exclude enforced only by a kernel that has af_inet: see "Compiled only for a kernel that has af_inet"
With network inet stream demo may bind 127.0.0.1:8080, bind 0.0.0.0:22 and connect to 203.0.113.9:443. The rule with ip=127.0.0.1 port=8080 is meant to leave only the first. A note says that it is enforced only by a kernel that has af_inet.

ip= and port= restrict an inet or inet6 network rule to a local address and port. Whether they are enforced depends on the kernel's feature set.

Line eleven of demo's profile lets it use any TCP socket over IP version four: any local port, any remote host. Often you know more than that. Demo listens on localhost, port 8080, and nowhere else. The network rule has conditionals for it: ip= an address, port= a number. They restrict the rule to sockets with that local address and port. Hold on to one thing before you rely on them, though. Whether they're enforced depends on the kernel, and we'll get to that in a moment.

Details and sources

Details

  • The conditionals exist for inet and inet6 only. With one of them and no family word, the rule covers inet and inet6 (network.cc:503-511). With any other family it is an error: network family does not support local or peer conditionals (network.cc:551-554).
  • They are compiled only when the feature set has network_v8/af_inet or network_v9/af_inet (network.cc:1031); see "Compiled only for a kernel that has af_inet" in this deck.
  • The slide shows what the rule means as written. The addresses are documentation examples.
  • Test file: network/network_ok_20.sd.

02 Local conditionals, then the peer group

GRAMMAR networkPERMISSIONSinet | inet6TYPELOCALpeer=( PEER ), LOCAL ip=ADDRport=N | N-Minterface=NAMElabel=PATTERN PEER ip=ADDRport=N | N-Mlabel=PATTERN no interface here network (bind, listen) inet stream ip=127.0.0.1 port=8080,network (connect, send, receive) inet stream peer=(ip=203.0.113.9 port=443), a server: its local port a client: its peer each conditional once; = is the only operator, except label:= inside peer=( )
The syntax diagram: network, optional permissions, inet or inet6, type, the local conditionals, the peer group, a comma. Local conditionals are ip=, port=, interface= and label=. The peer group holds ip=, port= and label=, and no interface. Two examples: a server rule with a local address and port, and a client rule with a peer address and port.

network [PERMS] [inet|inet6] [TYPE] [ip=A] [port=N|N-M] [interface=I] [label=L] [peer=(ip=A port=N label=L)],.

The conditionals come after the family and the type. First the ones about your own socket: ip, port, interface and label. Then, last, the peer group in parentheses, with the remote address, the remote port and a label. So a server rule talks about its local port, and a client rule talks about the peer it dials. Each conditional can appear once, and the operator is the plain equals sign. The peer group follows the rules of the conditionals deck: it goes last, and there's only one.

Details and sources

Details

  • Accepted by the tree's parser: network inet ip=::1 port=80-90,, network inet ip=none,, network inet6 ip=1.2.3.4,, network stream ip=1.2.3.4,, network (connect) inet peer=(ip=1.2.3.4 port=80),.
  • A conditional given twice: network conditional "ip" can only be specified once (parser_misc.c:1243).
  • interface is local only: interface cannot be set for peer in network rules (network.cc:497-498).
  • label:=NAME is accepted only inside the group, and the parser marks its value unused (network.h:144; network/skb/ok_setlabel_peer_1.sd).

for AppArmor developers for security researchers

In the code

03 One address, one port or one range

VALUES ip=127.0.0.1ip=::1ip=none accepted one IPv4 or IPv6 address, or none ip=127.0.0.1/8 network invalid ip='127.0.0.1/8' no prefix length, no range, no host name port=8080port=8000-8099 accepted decimal, 0 to 65535 port=70000port=90-80 network invalid port='70000' refused the low number goes first port=0 any port port 0 is compiled as "any port number"
Accepted and refused values. ip=127.0.0.1, ip=::1 and ip=none are accepted; ip=127.0.0.1/8 is an invalid ip. port=8080 and port=8000-8099 are accepted; port=70000 is an invalid port and port=90-80 is refused. port=0 means any port.

ip= takes one IPv4 or IPv6 address or none: no prefix, no range. port= takes N or N-M up to 65535; port=0 means any port.

The values are deliberately simple. Ip takes one address, version four or version six, or the word none. There's no slash prefix and no range, so you can't write a subnet. Port takes a decimal number up to sixty-five thousand five hundred and thirty-five, or two numbers with a dash for a range, low one first. Port zero is special: it compiles as any port, which fits a socket that hasn't been bound yet. Get a value wrong and the message quotes it back to you.

Details and sources

Details

  • ip= is parsed as one address (network.cc:335-361, network.cc:415-423): ip=1.2.3 gives network invalid ip='1.2.3'. An IPv4 address is accepted in an inet6 rule.
  • port=0 is compiled as any port number (network.cc:725-731).
  • Test files: network ip=127.0.0.1 port=8080,, port=0 and port=65535 in network/network_ok_20.sd; network port=0-65534, and network peer=(port=1-65535), in network/port-torture.sd.
  • The messages on the slide were produced by the tree's parser.
  • Known discrepancy: a value list is accepted and only its first value is used: network inet port=(80 81), and network inet port=80, give byte-identical output (run with the tree's parser).

04 Which permissions go with which side

TWO SIDES demo 127.0.0.1:8080 203.0.113.9:443 remote host local: ip= port= create bind listen setopt getopt getattr shutdown about your own socket peer=(ip= port=) connect accept send receive involve the other end network (bind) inet peer=(port=8080), ... 'bind', ... accesses cannot be used with peer socket conditionals network (bind) inet stream port=80, a port below 1024 in a bind rule also needs capability net_bind_service,
demo with the local socket 127.0.0.1:8080 connected to a remote host at 203.0.113.9:443. Local conditionals go with create, bind, listen, setopt, getopt, getattr and shutdown. The peer group goes with connect, accept, send and receive. bind with a peer port is refused. Binding port 80 also needs capability net_bind_service.

Local conditionals narrow any permission. peer=( ) can be combined only with connect, accept, send and receive.

A connection has two ends, and the conditionals follow that. Things you do to your own socket, like bind, listen and setting options, can only be narrowed by the local address and port. Things that involve the other end, connect, accept, send and receive, can also be narrowed by the peer group. Mix them the wrong way and the parser refuses: you can't bind with a condition on the peer. And a reminder from the capability deck. A rule that lets demo bind port eighty doesn't give it the capability for low ports.

Details and sources

Details

  • The local and peer permission sets: network.h:66-77.
  • The full message: network 'create', 'shutdown', 'setattr', 'getattr', 'bind', 'listen', 'setopt', and/or 'getopt' accesses cannot be used with peer socket conditionals (network.cc:526); produced by the tree's parser. Test file: network/perms/bad_opt_2.sd.
  • network (accept) inet peer=(ip=1.2.3.4), is accepted.
  • In the compiled layout a bind rule with a port below 1024 is marked as a privileged port (network.cc:815-868). The capability is a separate rule: Capability rules.
  • Known discrepancy: a peer label alone does not count as a peer conditional, so network (bind) peer=(label=foo), is accepted and the rule is not limited to inet and inet6 (network.h:226; run with the tree's parser).

05 Compiled only for a kernel that has af_inet

DEPENDS ON THE KERNEL network inet stream ip=127.0.0.1 port=8080, a feature set with network_v8/af_inet the tree's abi/5.0 lists it family + type + address + port the mainline kernel no af_inet network_v8: af_mask tcp-fast-open sctp network_v9: af_mask af_unix tcp-fast-open family + type == network inet stream, identical compiled policy $ ls /sys/kernel/security/apparmor/features/network_v8/ no af_inet file: ip= and port= are not enforced the parser prints no warning for this, at any warning level; other kernels: Upstream and Ubuntu
The rule network inet stream ip=127.0.0.1 port=8080 for two feature sets. With network_v8/af_inet, which the abi/5.0 file lists, it compiles to family, type, address and port. The mainline kernel exports no af_inet, so it compiles to family and type, identical to network inet stream. The features directory shows whether af_inet is there. The parser prints no warning.

Without af_inet in the feature set, ip=, port= and the peer group are dropped at compile time and the rule is network FAMILY TYPE,. The mainline kernel exports no af_inet. No warning is printed.

Here's the catch. The parser only compiles addresses and ports when the kernel's feature set says it can check them, with a feature called af_inet. The ABI file that ships with AppArmor lists it. The mainline kernel doesn't export it, and its inet code checks family, type and protocol, and nothing more. So for that kernel your carefully narrowed rule compiles to exactly the same policy as plain network inet stream. And the parser doesn't tell you, whatever warnings you turn on. Look in the features directory: if there's no af_inet file, these conditionals do nothing.

Details and sources

Details

  • Run with the tree's parser: with the mainline kernel's feature file as kernel and policy features, network inet, and network inet ip=1.2.3.4 port=80, give byte-identical output and no warning with --warn=all; with abi/5.0 they differ. Nothing was loaded into a kernel.
  • The feature tests are network_v8/af_inet and network_v9/af_inet, each the intersection of the kernel feature set and the policy ABI (parser_main.c:1044-1073). The tree's abi/5.0 lists af_inet (abi/5.0:66-80).
  • What the mainline kernel exports: net.c:24-36, apparmorfs.c:2688-2689.
  • Its inet code gathers the local and remote address for the audit record and then calls the family, type and protocol check without using them (af_inet.c:62-230, af_inet.c:233-325). Denial records therefore carry laddr, lport, faddr and fport although no rule can match on them.
  • Malformed addresses are refused with EINVAL or EAFNOSUPPORT before the policy check (af_inet.c:116-135, af_inet.c:176-224).
  • interface= needs network_v9_skb/iface, which only profiles/apparmor.d/abi/5.0-interface lists and the mainline kernel does not export. label= on inet sockets is not matched by the mainline kernel.
  • Check a running kernel with ls /sys/kernel/security/apparmor/features/network_v8/ or aa-features-abi -x.
  • Kernel statements are read from the kernel source and were not run.

06 Known discrepancies: rules that end up wider for security researchers

ATTACK SURFACE feature set: the mainline kernel's (no af_inet) Known discrepancies, not intended behaviour network inet ip=127.0.0.1 port=8080, network inet, allows every inet socket deny network inet ip=10.0.0.1, deny network inet, denies all inet networking network peer=(label=foo), network, every family a peer label alone is no limit network inet port=(80 443), network inet port=80, on any feature set: only the first value is used exit status 0 and no warning with --warn=all in each case; compare compiled output to find out
Four rules as written and as compiled, known discrepancies. With a feature set without af_inet: network inet ip=127.0.0.1 port=8080 compiles as network inet; deny network inet ip=10.0.0.1 compiles as deny network inet; network peer=(label=foo) compiles as network. On any feature set network inet port=(80 443) keeps only port 80. No warning is printed.

Known discrepancies: without af_inet, address conditionals are dropped from allow and deny rules alike; peer=(label=...) alone compiles to network,; a value list keeps its first value. The parser prints nothing.

For a reviewer this is the part that matters. When the feature set can't express a conditional, the parser doesn't refuse the rule and doesn't warn. It drops the conditional. An allow rule becomes broader: every inet socket. A deny rule becomes broader too, and that one can break things: a deny for one address denies the whole family. The unix rules don't widen a deny; they drop it. Network rules widen it. Two more: a peer label on its own turns into a rule for every family, and a list of ports keeps only the first. All four are on the known bugs list.

Details and sources

for security researchers

Details

  • All four rows were run with the tree's parser: the two lines of a row give identical compiled output, with exit status 0 and no warning. The first three use the mainline kernel's feature set. The addresses on the slide are illustrative; the runs used ip=1.2.3.4 port=80 and peer=(label=foo). Nothing was loaded into a kernel.
  • Where it happens: the early return for the generic form (network.cc:1031-1039, network.cc:1138-1167).
  • The unix class does not downgrade deny rules, because the downgrade makes the rule less specific (af_unix.cc:204-229).
  • has_peer_conds() tests only the peer address and port (network.h:226).
  • To check a profile: compile it with apparmor_parser -S -K (or -Q -D rule-exprs) with and without the conditional, and compare.
  • Enforcement exists on kernels that export af_inet: see Upstream and Ubuntu kernels.

for security researchers

Attack surface

  • A profile audited on paper as "may only talk to 10.0.0.5:5432" grants all of inet stream on a kernel without af_inet.
  • A profile whose author added deny network inet ip=... as a block list loses all inet networking, which invites replacing it with a broad allow.
  • The feature set is the kernel's, or the pinned abi: a profile pinned to abi/5.0 and loaded on a kernel without af_inet is compiled for the intersection.
  • interface= behaves the same without network_v9_skb/iface.
  • Known discrepancy: the manual page documents a local label:= that cannot be written.

07 The inet layout after the type for AppArmor developers for security researchers

IN THE PARSER network (connect) inet stream peer=(ip=10.0.0.1 port=80), feature set abi/5.0 0f class 00 02 family 00 01 type .. protocol 02 remote 00 50 port 80 01 IPv4 0a 00 00 01 address 00 [^\000]* label 00 01 CMD_ADDR, then the same layout for the local address: three alternatives (none, IPv4, IPv6) perms 0x40 after the local address: 02 + .. for listen (backlog), 04 + .... for getopt/setopt af_inet.c map_addr() / set_ad_addr(): addresses for the audit record aa_profile_af_sk_perm(): family, type, protocol the walk stops where the generic rule ends
The match string of network (connect) inet stream peer=(ip=10.0.0.1 port=80) under abi/5.0: class 0f, family 00 02, type 00 01, any protocol, port type 02 remote, port 00 50, size 01 IPv4, address 0a 00 00 01, a label pattern, then command 01 and the same layout for the local address. In the kernel af_inet.c collects the addresses for the audit record and checks family, type and protocol.

network.cc:870-998, 1058-1133 writes the inet layout; af_inet.c:233-325 in the mainline kernel checks only family, type and protocol.

When af_inet is in the feature set, gen_net_rule keeps going after the type. A protocol, then the peer's port type and port, an address size byte and the address, a label pattern. Then a command byte, and the same layout again for the local side, with extra commands for listen and for socket options. A port range is split into byte ranges. That's the encoding. On the kernel side of this tree, af_inet.c collects both addresses, but only for the audit record, and every permission function ends in the plain family, type and protocol check.

Details and sources

for AppArmor developers for security researchers

Details

  • The byte string was produced with the tree's parser, abi/5.0 and -D rule-exprs: \x0f\x00\x02\x00\x01..\x02\x00\x50\x01\x0a\x00\x00\x01\x00[^\000]*\x00\x01..., followed by the three alternatives for the local address, with permission 0x40. demo's own line 11 under abi/5.0 gives a create rule on \x0f\x00\x02\x00\x01 and the address layout with 0x1fc076.
  • Port type bytes: 0 unprivileged, 1 privileged, 2 remote (network.cc:815-868). Address-size byte: 0 none, 1 IPv4, 2 IPv6 (network.h:83-87).
  • Port ranges are split into byte ranges (network.cc:719-765); port=0 becomes .. (network.cc:725-731).
  • Command bytes: CMD_ADDR 1, listen 2, option 4 (network.cc:1096-1133). The layout: network.cc:870-998, network.cc:1058-1133.
  • The interface pattern lives in a second rule set of class AA_CLASS_NETV9_SKB, 30 (network.cc:929-962, network.cc:1163-1165), which the kernel defines (apparmor.h:39) and uses nowhere else. set_label and the AA_SET_LABEL permission for send rules belong to that class (network.cc:955-956).
  • The kernel's inet functions: af_inet.c:233-325.
  • Known discrepancy: network inet icmp, writes protocol value 2 where protocols are emitted.
  • Kernel statements are read from the kernel source and were not run.

for AppArmor developers for security researchers

Read more

08 Mistakes and their messages

MISTAKES network inet ip=127.0.0.1/8, network invalid ip='127.0.0.1/8' one address, no prefix network inet port=70000, network invalid port='70000' sixteen bits network unix port=80, network family does not support local or peer conditionals inet and inet6 only network inet stream peer=(interface=eth0), interface cannot be set for peer in network rules interface is local only network inet peer=(ip:=1.2.3.4), unsupported operator used in conditions of network rules := is only for a label network inet label:=foo, Lexer found unexpected character: ':' (0x3a) in state: NETWORK_MODE
Six refused rules with the message of the parser: an address with a prefix length; a port above 65535; a port on a unix rule; interface inside the peer group; := on an address; label:= outside the peer group.

Values and placement are checked at parse time. A rule that parses is not proof that its conditionals are enforced.

The parser validates these conditionals even when it's going to drop them. An address with a prefix length isn't an address. A port has to fit in sixteen bits. The conditionals only belong to inet and inet6, so a unix or netlink rule with a port is refused. Interface is local only. := is only for a label, and outside the peer group it can't be written at all. An accepted rule, then, tells you the syntax is right. It doesn't tell you the kernel enforces it.

Details and sources

Details

  • The parser prints an error as AppArmor parser error for FILE in profile FILE at line N: MESSAGE; the slide shows MESSAGE, produced by the tree's parser.
  • Sources of the messages: network.cc:551-554 (family), network.cc:497-498 (interface in the group), network.cc:459 (operator).
  • network invalid interface='NAME' (network.cc:471).
  • unsupported operator in label conditional of network rules for label in (...) (network.cc:457).
  • network inet port=90-80, gives network invalid port='90-80'. A conditional given twice: network conditional "ip" can only be specified once.

09 Check the kernel before you rely on it

ROADS ip= port= peer=( ) syntax in the parser; enforcement is a property of the kernel upstream-and-ubuntu which kernels enforce this adm-features look for af_inet syn-network family and type apply syn-unix fine-grained and enforced syn-rule-conditionals the shared syntax syn-abi the pinned feature set
Network address conditionals in the centre with roads to upstream-and-ubuntu and adm-features, to syn-network and syn-unix, and to syn-rule-conditionals and syn-abi.

Address conditionals need af_inet in the kernel's feature set. Family and type are enforced everywhere network mediation exists.

So: the conditionals are real syntax, the parser checks them carefully, and a kernel with af_inet enforces them. On the mainline kernel, what holds is family and type. The upstream and Ubuntu deck says which kernels have what, and the features deck shows how to look. If you want fine-grained socket rules that the mainline kernel does enforce, that's the unix deck.

Details and sources

Details

  • ip=, port=, interface=, label= and peer=(ip= port= label=) on inet and inet6 network rules.
  • Compiled only for a feature set with af_inet; otherwise dropped without a message, and the rule is its family and type.
  • Commits read for this deck: AppArmor 836052d21 (6.0.0~alpha2) and the kernel tree named on the page. The kernel behaviour was read from the source, not observed on a running kernel.

Read more

Basis of the statements on this page: "tree" means the parser built from the AppArmor commit above was run on the line (-Q -K --skip-kernel-load --warn=all), with nothing loaded into a kernel; "code" means the parser source or the kernel source was read, not run. Nothing here was observed on a running kernel. "The mainline kernel" is the kernel tree named on the page; other kernels are in upstream-and-ubuntu.

Grammar

NETWORK RULE:  [QUALIFIERS] network [PERMISSIONS] [inet|inet6] [TYPE] [LOCAL ...] [peer=( PEER ... )] ,
LOCAL:         ip=ADDRESS | port=N | port=N-M | interface=NAME | label=PATTERN
PEER:          ip=ADDRESS | port=N | port=N-M | label=PATTERN | label:=NAME
  • The conditionals follow family and type; the peer group is last and written once (tree).
  • With a conditional and no family word the rule covers inet and inet6; any other family is an error (tree).
  • Each conditional may appear once (tree).
  • The rest of the rule is in syn-network; the shared syntax in syn-rule-conditionals.

Conditionals

NameSideValueOperatorNeeds in the feature setOn the mainline kernel
iplocal, peerone IPv4 or IPv6 address, or none=af_inetdropped at compile time
portlocal, peerN or N-M, 0 to 65535; 0 is any port=af_inetdropped at compile time
interfacelocala pattern=network_v9_skb/ifacedropped at compile time
labellocal, peera pattern=; := inside peer=( )af_inetnot matched

"Dropped" is from runs of the tree's parser with the mainline kernel's feature file; that the kernel checks only family, type and protocol for inet sockets is from its source (linux:security/apparmor/af_inet.c:233-325).

Values

  • ip: parsed as a single address. No prefix length, no range, no host name. An IPv4 address is accepted in an inet6 rule (tree).
  • port: decimal. A range is LOW-HIGH. port=0 compiles as any port number (code).
  • interface, label: patterns in the globbing syntax (code).
  • label:=NAME: accepted only inside peer=( ); the parser marks the value unused (code).
  • Known discrepancy: a value list such as port=(80 81) is accepted and only the first value is used (tree).

Permissions per side

SidePermissions
localcreate, shutdown, setattr, getattr, bind, listen, setopt, getopt
peerconnect, accept, send, receive
  • Local conditionals may narrow any permission. The peer group may be combined only with the peer permissions: otherwise network 'create', 'shutdown', 'setattr', 'getattr', 'bind', 'listen', 'setopt', and/or 'getopt' accesses cannot be used with peer socket conditionals (tree).
  • A bind rule for a port below 1024 does not replace capability net_bind_service,; see syn-capability.

Feature sets

Feature setaf_inetnetwork_v9_skb/iface
the tree's abi/5.0listednot listed
the tree's abi/5.0-interfacelistedlisted
the mainline kernelnot exportednot exported
  • The parser uses the intersection of the kernel feature set and the policy ABI of the abi rule (code).
  • Check a running kernel: ls /sys/kernel/security/apparmor/features/network_v8/ or aa-features-abi -x.
  • Check a profile: compile it with apparmor_parser -S -K with and without the conditional and compare the output. The parser prints no warning when it drops a conditional, at any warning level (tree).

Errors

RuleMessage
network inet ip=127.0.0.1/8,network invalid ip='127.0.0.1/8'
network inet ip=1.2.3,network invalid ip='1.2.3'
network inet port=70000,network invalid port='70000'
network inet port=90-80,network invalid port='90-80'
network unix port=80,network family does not support local or peer conditionals
network inet stream peer=(interface=eth0),interface cannot be set for peer in network rules
network inet peer=(ip:=1.2.3.4),unsupported operator used in conditions of network rules
network inet label:=foo,Lexer found unexpected character: ':' (0x3a) in state: NETWORK_MODE
network inet label in (a),unsupported operator in label conditional of network rules (code)
network inet ip=1.2.3.4 ip=1.2.3.5,network conditional "ip" can only be specified once
network (bind) inet peer=(port=8080),the peer permission message above
a bad interface namenetwork invalid interface='NAME' (code)

All rows are from the tree's parser unless marked.

for AppArmor developers

The inet layout

  • With af_inet, after class, family and type the match string continues: protocol; peer port type (0 unprivileged, 1 privileged, 2 remote) and two port bytes; an address-size byte (0 none, 1 IPv4, 2 IPv6) and the address; NUL, the label pattern, NUL; then the command byte CMD_ADDR (1) and the same layout for the local address; command 2 with two bytes for listen, command 4 with four bytes for socket options (parser/network.cc:870-998, 1058-1133).
  • Example (tree, abi/5.0): network (connect) inet stream peer=(ip=10.0.0.1 port=80), gives \x0f\x00\x02\x00\x01..\x02\x00\x50\x01\x0a\x00\x00\x01\x00[^\000]*\x00\x01... with permission 0x40.
  • Port ranges are split into byte ranges (parser/network.cc:719-765).
  • The interface pattern is a second rule set in class AA_CLASS_NETV9_SKB (30) (parser/network.cc:929-962).
  • Without af_inet the function returns after the generic form (parser/network.cc:1031-1039).
  • The mainline kernel's af_inet.c collects local and remote addresses for the audit record and ends every permission function in the family, type and protocol check (linux:security/apparmor/af_inet.c:62-325).

for security researchers

Known discrepancies

None of these is taught as intended behaviour; the verdicts come from the review (sec-bugs). Each was run with the tree's parser unless marked.

  • Without af_inet, inet conditionals are dropped without a message, also from deny rules: deny network inet ip=1.2.3.4, compiles as deny network inet,.
  • A peer label is not treated as a peer conditional: network peer=(label=foo), compiles as network,, and network (bind) peer=(label=foo), is accepted.
  • network inet icmp, carries protocol value 2 where protocols are emitted (code).
  • The manual page documents a local label:=; network inet label:=foo, fails in the scanner.
  • A value list keeps its first value: network inet port=(80 81), equals network inet port=80,.

Roads from here

START HERE

PREAMBLE AND REUSE

QUALIFIERS

  • allow and deny — deny rules and why a dropped conditional widens them

RULE CLASSES

SECURITY · threat model and limits

RUNNING THE PARSER