example.bend checks
raw source on the hub · import bend-osdev-apparmor@0.1.0.0/example.bend as Example
bend-osdev-apparmor: examples, for the laws' witnesses, check.bend and users: a profile built directly from the types, and a small policy in the profile language (the example of apparmor.d(5), cut down, with an abstraction and a tunable in a file map).
12 imports
import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B import ./text.bend as X import ./glob.bend as G import ./perm.bend as P import ./options.bend as O import ./profile.bend as PR import ./rule_file.bend as F import ./error.bend as E import ./eval.bend as V import ./transitions.bend as TR import ./apparmor.bend as A
Definitions
def AaExample.qual source · line 18 · raw
@audit:Bool -> @deny:Bool -> 0x2b280a281d356b8e5cd7b338ab267df1/perm.AaQual
def AaExample.rule source · line 22 · raw
@+path:String -> @q:0x2b280a281d356b8e5cd7b338ab267df1/perm.AaQual -> @perms:String -> 0x2b280a281d356b8e5cd7b338ab267df1/rule_file.AaFileRule
a file rule on a literal path
def AaExample.rules source · line 27 · raw
0x2b280a281d356b8e5cd7b338ab267df1/profile.AaRules
profile ex: /etc/x rw, deny /etc/x w, audit /var/log/x w, /lib/** (built as a literal-free pattern) r; no x rule anywhere
def AaExample.profile source · line 30 · raw
@m:0x2b280a281d356b8e5cd7b338ab267df1/profile.AaMode -> 0x2b280a281d356b8e5cd7b338ab267df1/profile.AaProfile
def AaExample.policy source · line 33 · raw
0x2b280a281d356b8e5cd7b338ab267df1/profile.AaPolicy
def AaExample.query source · line 36 · raw
@+path:String -> @perms:String -> 0x2b280a281d356b8e5cd7b338ab267df1/rule_file.AaFileQuery
def AaExample.source source · line 41 · raw
@n:String -> @t:String -> 0x2b280a281d356b8e5cd7b338ab267df1/apparmor.AaSource
def AaExample.files source · line 44 · raw
List<&2, 0x2b280a281d356b8e5cd7b338ab267df1/apparmor.AaSource>
def AaExample.loaded source · line 47 · raw
Result<&2, &2, 0x2b280a281d356b8e5cd7b338ab267df1/error.AaError, 0x2b280a281d356b8e5cd7b338ab267df1/profile.AaPolicy>
def AaExample.pol source · line 50 · raw
0x2b280a281d356b8e5cd7b338ab267df1/profile.AaPolicy
def AaExample.file source · line 53 · raw
@prof:String -> @path:String -> @perms:String -> Maybe<&2, 0x2b280a281d356b8e5cd7b338ab267df1/eval.AaDecision>
def AaExample.exec source · line 56 · raw
@prof:String -> @path:String -> String
def AaExample.small_files source · line 61 · raw
List<&2, 0x2b280a281d356b8e5cd7b338ab267df1/apparmor.AaSource>
A smaller policy, for the laws' vectors (the checker's kernel evaluates them, so they are kept short)
def AaExample.small source · line 64 · raw
0x2b280a281d356b8e5cd7b338ab267df1/profile.AaPolicy
def AaExample.small_file source · line 67 · raw
@prof:String -> @path:String -> @perms:String -> Maybe<&2, 0x2b280a281d356b8e5cd7b338ab267df1/eval.AaDecision>
def AaExample.small_exec source · line 70 · raw
@prof:String -> @path:String -> String