Coder Social home page Coder Social logo

grantseltzer / karn Goto Github PK

View Code? Open in Web Editor NEW
110.0 5.0 13.0 3.57 MB

Simplifying Seccomp enforcement in containerized or non-containerized apps

Home Page: https://www.grant.pizza/blog/karn/

License: Mozilla Public License 2.0

Go 91.54% Makefile 2.62% C 5.84%
seccomp seccomp-filter karn security security-tools security-hardening containers container-security

karn's People

Contributors

brenol avatar grantseltzer avatar jakeruth avatar jrroman avatar simar7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

karn's Issues

Add a 'notes' field to declarations for extensible documentation

It may be particularly useful if there was a 'notes' field in the declarations so they can be interacted with as opposed to just TOML comments.

For example:

  • There's a declaration for using removable storage devices. However, they need to be mounted. The declaration uses /mnt but it's possible to mount devices elsewhere. The 'notes' field may say "You need to use /mnt or edit the declaration to your custom location".

Functionality can then be built into the generate command to display notes as computation is done.

Need validation for spec fields

There needs to be a package for validating individual values, as well as a full spec. The package should be consumed internally at all input points, as well as a small CLI tool

Install make step

This includes creating ~/.karn/declarations and placing official ones there

Add a declaration field for including names of other declarations

The declaration definition should be changed to this (in spec.go):

// Declaration holds all the data from karn declaration files
type Declaration struct {
	SystemCalls  SystemCalls  `toml:"System-Calls,omitempty"`
	Capabilities Capabilities `toml:"Capabilities,omitempty"`
	Filesystem   FileSystem   `toml:"Filesystem,omitempty"`
	Network      Network      `toml:"Network,omitempty"`
	System       System       `toml:"System,omitempty"`
	Includes     []string     `toml:"Includes,omitempty"` 
}

This allows for filling in overlap with the varying levels of entitlements. For example, a declaration that grants access to reading/writing from removable devices will need the filesystem declaration as well as access to the particular socket paths. Instead of copying the filesystem fields into the new one, you can just specify "filesystem" in the Includes field.

There's some challenge to this, i.e. making sure there aren't duplicate rules specified and solving for circular includes.

When a syscall is specified, if there's a corresponding CAP it should add that to the apparmor prof

The default docker seccomp has a lot of these relationships, will be useful resource.

Example:

...
			"names": [
				"bpf",
				"clone",
				"fanotify_init",
				"lookup_dcookie",
				"mount",
				"name_to_handle_at",
				"perf_event_open",
				"quotactl",
				"setdomainname",
				"sethostname",
				"setns",
				"umount",
				"umount2",
				"unshare"
			],
			"action": "SCMP_ACT_ALLOW",
			"args": [],
			"comment": "",
			"includes": {
				"caps": [
					"CAP_SYS_ADMIN"
				]
			},
			"excludes": {}
		}
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.