Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AppArmor policy for the docker binary #14864

Merged
merged 1 commit into from
Jul 22, 2015

Conversation

ewindisch
Copy link
Contributor

Wraps the engine itself with an AppArmor policy.

This restricts what may be done by applications
we call out to, such as 'xz'.

Significantly, this policy also restricts the policies
to which a container may be spawned into. By default,
users will be able to transition to an unconfined
policy or any policy prefaced with 'docker-'.

Local operators may add new local policies prefaced
with 'docker-' without needing to modify this policy.
Operators choosing to disable privileged containers
will need to modify this policy to remove access
to change_policy to unconfined.

Signed-off-by: Eric Windisch eric@windisch.us

Wraps the engine itself with an AppArmor policy.

This restricts what may be done by applications
we call out to, such as 'xz'.

Significantly, this policy also restricts the policies
to which a container may be spawned into. By default,
users will be able to transition to an unconfined
policy or any policy prefaced with 'docker-'.

Local operators may add new local policies prefaced
with 'docker-' without needing to modify this policy.
Operators choosing to disable privileged containers
will need to modify this policy to remove access
to change_policy to unconfined.

Signed-off-by: Eric Windisch <eric@windisch.us>
@ewindisch
Copy link
Contributor Author

/cc @duglin @stefanberger @salmanbaset

@tianon
Copy link
Member

tianon commented Jul 22, 2015

LGTM 👍

@tianon
Copy link
Member

tianon commented Jul 22, 2015

(Am I interpreting you correctly that this'll help stop profiles like mysqld from bleeding into containers and applying to processes that they shouldn't?)

@ewindisch
Copy link
Contributor Author

@tianon no, that is fixed in PR #14855

This PR will eliminate certain attacks against the docker daemon itself. For instance, if we applied this retroactively to 1.3.x it would remediate CVE-2014-9357 (xz execution). If we had had this policy then, that vulnerability would not have affected AppArmor users.

@jessfraz
Copy link
Contributor

LGTM

jessfraz pushed a commit that referenced this pull request Jul 22, 2015
Add AppArmor policy for the docker binary
@jessfraz jessfraz merged commit a7d8450 into moby:master Jul 22, 2015
@stefanberger
Copy link
Contributor

docker top invokes /bin/ps. Is there a particular reason why this tool hasn't been added?

Besides having to extend the ptrace statements in the main profile, the following one adds the /bin/ps subprofile and removes a couple of DENIED from the audit log.

profile /bin/ps {
file,
capability,
ptrace (read, trace) peer=**,
}

@ewindisch
Copy link
Contributor Author

@stefanberger this has now merged, so we should take that as a PR. (I'm not seeing any denials with 'docker top' currently, however?)

Also, I'd really like to add delegates to this profile but was unable to make it work on AppArmor 2.8. That will allow removing the attach_disconnected statement and will make this much more secure...

@stefanberger
Copy link
Contributor

@ewindisch I am using Ubuntu 14.04.2 -- what about you ?

@ewindisch
Copy link
Contributor Author

@stefanberger same OS. Lets register an issue and discuss there.

@stefanberger
Copy link
Contributor

I sent a PR for you to look at the diffs.

#14907

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants