Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Golang seccomp package #613

Merged
merged 4 commits into from
Jun 9, 2015
Merged

Conversation

crosbymichael
Copy link
Contributor

This builds off of the work on @keloyang and @yangshukui in #529 and adds a pure Go package for using seccomp.

The changes in this PR are mostly around the package API and expressing constraints, all the hard work was done in the original commits, thanks!

This also adds security profile support for nsinit that uses seccomp for filtering. You can view the file nsinit/security.go in this PR to see how the seccomp package is consumed.

@LK4D4
Copy link
Contributor

LK4D4 commented Jun 4, 2015

Compilation errors.

@@ -0,0 +1,122 @@
// Go package that provides seccomp ( https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt ) support for go.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be like Package seccomp ...

Action: configs.Action(syscall.EPERM),
})
_, _, err = runContainer(config, "", "/bin/sh", "-c", "sleep 2")
if err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to check error text. We had test with just wrong cmd syntax for years in docker :)

@crosbymichael crosbymichael force-pushed the seccomp-args branch 5 times, most recently from ca85553 to 7cfe887 Compare June 4, 2015 21:53
return true
}()

var edian edianSupport
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: edian --> endian ?

@rjnagal
Copy link
Contributor

rjnagal commented Jun 5, 2015

super-cool 👍

@crosbymichael
Copy link
Contributor Author

updated

yangshukui and others added 4 commits June 5, 2015 11:21
add seccomp feature which is not use third-party
add multi arch surport
add test case
all code use golang

this pr is relate to docker-archive#511 because I close it and find it can not be reopen

Signed-off-by: Yang Shukui <[email protected]>
    1. add args surport for seccomp
    2. add CLONE_SECCOMP flag for preventing seccomp feature
Signed-off-by: Yang Shukui <[email protected]>
Signed-off-by: Yang Shukui <[email protected]>
Signed-off-by: Michael Crosby <[email protected]>

Conflicts:
	configs/config.go
	container_linux.go
	seccomp/seccomp.go
	seccomp/seccomp.test
@LK4D4
Copy link
Contributor

LK4D4 commented Jun 5, 2015

I tried with busybox, debian and alpine. I couldn't run alpine with --seucrity=high, but seems like it's alpine problem. All works pretty well in other rootfs.
LGTM

@rjnagal
Copy link
Contributor

rjnagal commented Jun 5, 2015

I am trying it now. Seems to work.

We'll need to update doc and spec.md later. LGTM otherwise.

@mrunalp
Copy link
Contributor

mrunalp commented Jun 5, 2015

Basic testing worked on Fedora 22 with busybox.

@LK4D4
Copy link
Contributor

LK4D4 commented Jun 9, 2015

@mrunalp How is it going here? Can we merge this?

@mrunalp
Copy link
Contributor

mrunalp commented Jun 9, 2015

@LK4D4 yep. LGTM.

mrunalp pushed a commit that referenced this pull request Jun 9, 2015
@mrunalp mrunalp merged commit 2045026 into docker-archive:master Jun 9, 2015
@crosbymichael crosbymichael deleted the seccomp-args branch June 9, 2015 17:14
mheon added a commit to mheon/libcontainer that referenced this pull request Jun 11, 2015
…omp-args"

This reverts commit 2045026, reversing
changes made to ce1f2f1.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants