Seccomp/Apparmor profile generation using entitlements
Switch branches/tags
Nothing to show
Clone or download
grantseltzer Add picture of karn
Signed-off-by: grant <>
Latest commit 2e7251b Aug 16, 2018


Karn is an admin-friendly tool for creating OCI compliant seccomp and apparmor profiles. Originally proposed here as part of the Linux Container Hardening project.


Baseline functionality exists. At this point all possible filters and rules that you can manually express in seccomp and apparmor profiles can be created using karn.

What's left in terms of big goals is to write a set of standard implementation declarations. This will be a valuable tool. If you have a history writing seccomp/apparmor profiles, please contribute!

Check out the issues for things that are not yet implemented.

Table of contents


Create a simple permission scheme for easily securing containers. Developers can just specify what their container will need permission to do and this tool will output the corresponding seccomp and apparmor configurations. This can be thought of as iOS entitlements for containers!

How it works

Declarations - You can think of these as rule definitions. You define a declaration as corresponding to particular system calls, capabilities, FileSystem rules, Networking, and other security related rules. Each file will correspond to just a single declaration. Declartions should follow the naming convention of "_declaration.toml". Declarations are combined to generate seccomp and apparmor profiles. Here's a couple examples of what a declaration looks like:


Allow = [


Allow = [

Allow = ["chown"] # CAP_CHOWN

These declarations should be stored in ~/.karn/declarations. To take these two declarations to form seccomp and apparmor profiles, one would simply enter karn generate chown dns. You can also pass a different declaration directory with the -d/--declarations flag.

Additional resources

  • system calls - the 'API' of the kernel
  • capabilities - a way of granting permissions
  • seccomp - a system call filtering facility
  • apparmor - a security facility for specifying various security rules such as capabilities
  • containers - linux processes that karn output can protect
  • toml - the language karn uses
  • - a CTF game meant to teach you about syscalls and capabilities

Contact developer

Questions/Concerns? Open an issue or email me - grant at