Viewing as everyone topics and scenes not meant for you are faded or hidden

AppArmor map

Every topic is a short narrated deck about AppArmor: the profile language, the policy compiler, libapparmor, the tools and the kernel. Pick any place, follow the roads at the end of each deck, and switch perspective at the top to see only what applies to you.

Source: gitlab.com/zygoon/apparmor-map · report a problem or suggest a change

Journeys

Learning paths through several decks, in order. Pick one to see its route on the map.

START HERE ATTACHMENT, NAMESPACES, STACKING FILE ACCESS PREAMBLE AND REUSE PROFILE HEAD QUALIFIERS RULE CLASSES PROFILE STRUCTURE IN PRACTICE · general-purpose apps IN PRACTICE · security-sensitive programs SECURITY · threat model and limits RUNNING THE PARSER TOOLS · utils/ LIBAPPARMOR IN THE KERNEL INSIDE THE PARSER THE DFA ENGINE · libapparmor_re TESTING Why AppArmorprofiles, labels, modes⚑ The pipelinetext to kernel tables⚑ Syntax mapevery construct, one page⚑ How a check worksa profile as a state machine⚑ Upstream and Ubuntuwhich kernel does what⚑ Attachmentwhich profile a program gets⚑ Namespacesseparate policy sets⚑ Stackingtwo profiles at once⚑ File rulespath and permissions⚑ Access modesr w a l k m⚑ Globbing* ** ? [] {}⚑ Exec modesix px cx ux and fallbacks⚑ Named transitions-> target⚑ Link ruleslink, subset⚑ safe and unsafeenvironment scrubbing⚑ Variables@{VAR} and sets⚑ includepulling in other files⚑ Abstractionsand tunables⚑ abithe rule and the files⚑ Built-in variables@{profile_name}…⚑ The preamblewhat comes before profiles⚑ aliaspath rewriting⚑ Conditionalsif, else, defined⚑ Boolean variables${NAME}⚑ include if existsoptional includes, .d dirs⚑ Assignment=, +=, ?=, :=⚑ Profile nameprofile keyword, paths⚑ Mode flagsenforce, complain, kill…⚑ Other flagsattach_disconnected…⚑ xattrsattach by extended attribute⚑ Identitieswho the profile is for⚑ ownerfiles you own⚑ allow and denywhich rule wins⚑ auditlog what is allowed⚑ priorityrule precedence⚑ promptask before allowing⚑ otherfiles you do not own⚑ Qualifier blocksnesting and conflicts⚑ capabilityPOSIX capabilities⚑ Rule conditionalsname=value, peer=( )⚑ dbusD-Bus messages⚑ networkfamilies and types⚑ usernsuser namespaces⚑ signalsending signals⚑ unixunix domain sockets⚑ ptracetracing other tasks⚑ mountmounting filesystems⚑ umountunmounting⚑ change_profileswitching profiles⚑ pivot_rootchanging the root⚑ mqueuemessage queues⚑ io_uringio_uring operations⚑ remountchanging mount options⚑ network conditionalsip, port, interface⚑ rlimitresource limits⚑ allallow everything⚑ Commentsand line structure⚑ Quotingquotes and escapes⚑ Child profilesprofiles inside profiles⚑ Hats^hat subprofiles⚑ General-purpose appsbroad rules, apps keep working⚑ Which abstractionsfor general-purpose apps⚑ Privileged programsprecise rules, every operation⚑ Symlinksrules see the target⚑ Hard linksnew names, same file⚑ /sys and /proctrees of symlinks⚑ Threat modelwhat it defends, what not⚑ Limits of nameswhere path rules break⚑ Not mediatedgaps in Linux 7.4⚑ Who controls policyloading, namespaces, userns⚑ User namespacesunprivileged userns⚑ Bugs found herefrom building this map⚑ apparmor_parseradd, replace, remove⚑ Features and ABIkernel vs policy⚑ Policy cache/var/cache/apparmor⚑ parser.confwarnings, -O, -D⚑ Loading policy.load .replace .remove⚑ Reading denialswhat a DENIED line says⚑ The utilitiesand the Python module⚑ aa-statuswhat is loaded⚑ Mode toolsaa-enforce, aa-complain…⚑ aa-genprofand aa-autodep⚑ aa-logproffrom denials to rules⚑ aa-notifydesktop denial notices⚑ aa-easyproftemplates and sandbox⚑ Profile upkeepcleanprof, mergeprof⚑ Is it enabled?aa_is_enabled⚑ Reading labelsaa_getcon, aa_splitcon⚑ aa_change_hathats and tokens⚑ aa_change_profileonexec and stacking⚑ aa_query_labelwould this be allowed?⚑ D-Bus mediationthe bus daemon decides⚑ aa_featuresthe features tree⚑ Cache and load APIaa_policy_cache…⚑ BindingsPython, Perl, Ruby⚑ Symbolsversioning, private API⚑ The LSMhooks and mediation⚑ Unpacking policyverifying the blob⚑ Labelsstacks and namespaces⚑ Matchingwalking the DFA⚑ Exec transitionsdomain changes⚑ apparmorfsthe securityfs interface⚑ Audit recordshow a denial is logged⚑ Lexerstart conditions, keywords⚑ Grammarparser_yacc.y⚑ Rule objectsthe rule_t hierarchy⚑ Post-processingimplied rules, merge⚑ AARE to regexglobs become patterns⚑ Backend pipelinethree DFAs per profile⚑ Expression treesimplify and factor⚑ Building the DFAand state explosion⚑ Permissionsaccept states, priority⚑ Minimisationfewer states⚑ Table compressiondiff-encode, comb⚑ The policy blobbinary layout⚑ Packing labtry the table packing⚑ The test suitesparser, library, utils⚑
point at a topic to read what it covers · ⚑ visited 0 of 0 · dashed: no slides yet · audience: app developers AppArmor developers admins security researchers

Click a place to enter it. Inside a topic you see only its exits, like rooms in an adventure game; m brings the whole map back. space plays, ← → step. This map describes AppArmor at commit 836052d21 (6.0.0~alpha2) and mainline Linux at commit 97d73c825 (7.4-rc2). Where it says "the kernel", it means that Linux tree.

All 117 decks as a list (readable without JavaScript)

START HERE

ATTACHMENT, NAMESPACES, STACKING

FILE ACCESS

PREAMBLE AND REUSE

PROFILE HEAD

QUALIFIERS

RULE CLASSES

PROFILE STRUCTURE

IN PRACTICE · general-purpose apps

IN PRACTICE · security-sensitive programs

SECURITY · threat model and limits

RUNNING THE PARSER

TOOLS · utils/

LIBAPPARMOR

IN THE KERNEL

INSIDE THE PARSER

THE DFA ENGINE · libapparmor_re

TESTING

1 / 1

Roads from here