Skip to content

Apparmor engine#14907

Closed
stefanberger wants to merge 2 commits intomoby:masterfrom
stefanberger:apparmor-engine
Closed

Apparmor engine#14907
stefanberger wants to merge 2 commits intomoby:masterfrom
stefanberger:apparmor-engine

Conversation

@stefanberger
Copy link
Copy Markdown
Contributor

The following two patches fix ptrace and /bin/ps related apparmor denials. Presumably none of the performed actions are malicious and therefore can be allowed by the profile.

Get rid of a ptrace related denial related to the /usr/bin/docker profile.

type=AVC msg=audit(1437667226.242:410): apparmor="DENIED" operation="ptrace" profile="/usr/bin/docker" pid=19509 comm="docker" requested_mask="trace" denied_mask="trace" peer="docker-default"

Signed-off-by: Stefan Berger <[email protected]>
@cpuguy83
Copy link
Copy Markdown
Member

ping @ewindisch

@stefanberger stefanberger force-pushed the apparmor-engine branch 2 times, most recently from 4db8e79 to 017b018 Compare July 23, 2015 16:22
@ewindisch
Copy link
Copy Markdown
Contributor

I've taken a look at this and have found that our usage of 'ps' does not depend on the ptrace functionality and ps itself does not fail should it be unable to ptrace. As a result, I propose instead specifying a 'deny ptrace' which will squash the audit messages without granting this privilege.

On Ubuntu 14.04.2 I encountered the following denials related to the
'ps' tool when running 'docker top'. The 'ps' tool does not depend
on ptrace to work, so we can deny it.

ype=AVC msg=audit(1437667604.333:798): apparmor="DENIED" operation="ptrace"
  profile="/usr/bin/docker" pid=26246 comm="ps" requested_mask="trace"
  denied_mask="trace" peer="unconfined"

type=AVC msg=audit(1437667604.333:797): apparmor="DENIED" operation="ptrace"
  profile="/usr/bin/docker" pid=26246 comm="ps" requested_mask="read"
  denied_mask="read" peer="docker-default"

type=AVC msg=audit(1437667826.332:829): apparmor="DENIED" operation="ptrace"
  profile="/usr/bin/docker" pid=29352 comm="ps" requested_mask="tracedby"
  denied_mask="tracedby" peer="/usr/bin/docker///bin/ps"

Signed-off-by: Stefan Berger <[email protected]>
@stefanberger
Copy link
Copy Markdown
Contributor Author

@ewindisch I updated the 2nd patch; yes, the ps tool does not depend on ptrace for correct functioning as it seems, so I modified the patch to deny it now following your suggestion; I needed to deny it in both places, the /usr/bin/docker as well as the subprofile /bin/ps to have the log silenced.

@ewindisch
Copy link
Copy Markdown
Contributor

The 'file' permission is a bit too broad for 'ps'. Perhaps you could test my branch and make PRs there?

https://github.com/ewindisch/docker/tree/apparmor-engine-policy-nofile

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.

4 participants