Check.main: def of bend-osdev-apparmor@0.1.0.0 Import: import bend-osdev-apparmor@0.1.0.0/check.bend as Check Lines 76-129 of bend-osdev-apparmor@0.1.0.0/check.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-apparmor@0.1.0.0/check.bend&start_line=76&end_line=129 import Base import bend-osdev-apparmor@0.1.0.0/perm.bend as P import bend-osdev-apparmor@0.1.0.0/options.bend as O import bend-osdev-apparmor@0.1.0.0/transitions.bend as TR import bend-osdev-apparmor@0.1.0.0/rule_file.bend as F import bend-osdev-apparmor@0.1.0.0/example.bend as EX import bend-osdev-apparmor@0.1.0.0/apparmor.bend as A def main() -> IO(Unit): +big = A.Aa.load_default([EX.AaExample.source("big", big.text(300n))], o("big")) do IO: IO.print("example: " ++ show.load(EX.AaExample.loaded())) IO.print(show.d(EX.AaExample.file("/usr/bin/foo", "/etc/ld.so.cache", "r"))) IO.print(show.d(EX.AaExample.file("/usr/bin/foo", "/etc/ld.so.cache", "w"))) IO.print(show.d(EX.AaExample.file("/usr/bin/foo", "/lib/x86_64/libc.so.6", "mr"))) IO.print(show.d(EX.AaExample.file("/usr/bin/foo", "/home/bob/.foo_file", "rw"))) IO.print(show.d(EX.AaExample.file("/usr/bin/foo", "/etc/shadow", "r"))) IO.print(show.d(EX.AaExample.file("/usr/bin/foo", "/var/log/foo", "w"))) IO.print(show.d(EX.AaExample.file("/usr/bin/foo", "/tmp/foo.1", "l"))) IO.print(show.d(A.Aa.file(O.AaOptions.default(), pol(), o("/usr/bin/foo"), o("/proc/42/stat"), True{}, F.AaFile.perms("r")))) IO.print(show.d(EX.AaExample.file("/usr/bin/foo", "/proc/42/stat", "r"))) IO.print(show.d(EX.AaExample.file("/usr/bin/foo//hat", "/var/spool/q", "rw"))) IO.print(show.d(EX.AaExample.file("bar", "/etc/anything", "r"))) IO.print(show.d(EX.AaExample.file("bar", "/etc/secret", "r"))) IO.print(show.d(A.Aa.file(O.AaOptions.with_complain_deny(O.AaOptions.default(), False{}), pol(), o("bar"), o("/etc/secret"), False{}, F.AaFile.perms("r")))) IO.print(show.d(A.Aa.capability(O.AaOptions.default(), pol(), o("/usr/bin/foo"), 7))) IO.print(show.d(A.Aa.capability(O.AaOptions.default(), pol(), o("/usr/bin/foo"), 21))) IO.print(show.d(A.Aa.network(O.AaOptions.default(), pol(), o("/usr/bin/foo"), o("inet"), o("stream"), o("tcp")))) IO.print(show.d(A.Aa.network(O.AaOptions.default(), pol(), o("/usr/bin/foo"), o("inet6"), o("stream"), o("tcp")))) IO.print(show.d(A.Aa.signal(O.AaOptions.default(), pol(), o("/usr/bin/foo"), P.AaPerms.bit(0n), o("term"), o("/usr/bin/bar")))) IO.print(show.d(A.Aa.signal(O.AaOptions.default(), pol(), o("/usr/bin/foo"), P.AaPerms.bit(1n), o("term"), o("/usr/bin/bar")))) IO.print(EX.AaExample.exec("/usr/bin/foo", "/bin/mount")) IO.print(EX.AaExample.exec("/usr/bin/foo", "/usr/bin/baz")) IO.print(EX.AaExample.exec("/usr/bin/foo", "/usr/bin/bar")) IO.print(EX.AaExample.exec("/usr/bin/foo", "/usr/bin/zzz")) IO.print(EX.AaExample.exec("/usr/bin/foo", "/bin/sh")) IO.print(EX.AaExample.exec("/usr/bin/foo//baz", "/bin/bash")) IO.print(TR.AaExecResult.show(A.Aa.exec_unconfined(pol(), o("/usr/bin/bar")))) IO.print(TR.AaExecResult.show(A.Aa.exec_unconfined(pol(), o("/usr/bin/other")))) IO.print(load1("profile e { /x wa, }")) IO.print(load1("profile e {\n /x r,\n /y ix px,\n}")) IO.print(load1("profile e { capability bogus, }")) IO.print(load1("profile e { @{NOPE}/x r, }")) IO.print(load1("@{A} = /x\n@{A} = /y\nprofile e { }")) IO.print(load1("profile e { /x ix, /x px, }")) IO.print(load1("profile e { unix, }")) IO.print(load1("profile e { include }")) IO.print(load1("profile e { include if exists }")) IO.print(load1("profile e { /x/{a} r, }")) IO.print(load1("profile e flags=(complain,kill) { }")) IO.print(load1("profile e { } profile e { }")) IO.print(load1("profile e { /x r }")) IO.print(g("/tmp/*", "/tmp/")) IO.print(g("/tmp/**", "/tmp/a/b")) IO.print(g("/a/{b,c{d,e}}/*", "/a/cd/x")) IO.print(g("/a/[^b]c", "/a//c")) IO.print(g("/a/**/b/**/c/**/d/**/e*", "/a/1/2/b/3/c/4/5/d/6/7/8/f/9/x/y/z/w/v/u/t/s/r/q/p/o/n/m/l")) IO.print("big: " ++ show.load(big)) IO.print(big.query(big, "/data/d150/x", "r")) IO.print(big.query(big, "/data/d150/secret", "w")) IO.print(big.query(big, "/data/d300/x", "r")) IO.print(big.query(big, big.path(200n), "r")) Uses (31): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.print https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/apparmor.bend&name=Aa.capability https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/apparmor.bend&name=Aa.exec_unconfined https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/apparmor.bend&name=Aa.file https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/apparmor.bend&name=Aa.load_default https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/apparmor.bend&name=Aa.network https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/apparmor.bend&name=Aa.signal https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/check.bend&name=big.path https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/check.bend&name=big.query https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/check.bend&name=big.text https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/check.bend&name=g https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/check.bend&name=load1 https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/check.bend&name=o https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/check.bend&name=pol https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/check.bend&name=show.d https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/check.bend&name=show.load https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/example.bend&name=AaExample.exec https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/example.bend&name=AaExample.file https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/example.bend&name=AaExample.loaded https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/example.bend&name=AaExample.source https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/options.bend&name=AaOptions.default https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/options.bend&name=AaOptions.with_complain_deny https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/perm.bend&name=AaPerms.bit https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/rule_file.bend&name=AaFile.perms https://jend.leeeet.dev/definition.txt?path=bend-osdev-apparmor@0.1.0.0/transitions.bend&name=AaExecResult.show