GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing google.github.io — Kafel WHAT IS IT?Kafel is a language and library for specifying syscall filtering policies. The policies are compiled into BPF code that can be used with seccomp-filter. This is NOT an official Google product. UsageWith verbose error reportingWithout verbose error reportingPolicy languageA simple language is used to define policies. Policy file consists of statements. A statement can be:
Policy definition statements placed at file scope will be added to the implicit top level policy. This top level policy is going to be compiled. Default action statementSpecifies that action The default action must be specified just once. If the policy file specifies no default actions, the default action will be KILL NumbersKafel supports following number notations:
Constant definitionsYou may define numeric constants to make your policies more readable. Constant definitions may be placed almost anywhere in the policy file. A constant definiton cannot be placed inside of a policy defintion. The defined constants can then be used anywhere where a number is expected. Policy definitionsPolicy definition is a list of action blocks and use statements separated by commas. samples/ contains some example policies that demonstrate supported features. Use statementsA With use statements you can create meaningful groups of filtering rules that are building blocks of bigger policies. Action blocksAction block consist of a target and list of syscall matching rules separated with commas. Target of first rule matched is the policy decision. Following table list Kafel targets and their corresponding seccomp-filter return values.
Syscall matching rulesA rules consist of syscall name and optional list of boolean expressions. List of boolean expressions separated by commas.
A comma is semantically equivalent to Syscall namingNormally syscalls are specified by their names as defined in Linux kernel.
However, you may also filter custom syscalls that are not in the standard
syscall list.
You can either define a constant and use it in place of syscall name or
utilize Argument filteringBoolean expressions are used to filter syscalls based on their arguments. A expression resembles C language syntax, except that there are no arithmetic operators. Bitwise and ( You don’t have to declare arguments for well-known syscalls but can just use
their regular names as specified in Linux kernel and Include directiveIn order to simplify reuse and composition of policies, kafel provides include support. Kafel looks for included files only under directories explicitly added to the search paths. Adds Include directive is terminated by a newline or a semicolon. Multiple files, separated by whitespace, can be specified in one directive. ExampleWhen used with nsjail, the following command allows to create a fairly constrained environment for your shell | ||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |