Skip to content

Conversation

@jessfraz
Copy link
Contributor

This allows us to use the apparmor profile we have in contrib/apparmor/ and solves the problems where certain functions are not apparent on older versions of apparmor_parser on debian/ubuntu.

Also runs apparmor_parser --debug docker-engine on the generated profile to make sure that it actually works with the version in the build container.

After this we can remove the docker-default from the engine code and generate it also like this. But I wanted this PR to be simple (or at least as simple as an apparmor PR gets ;).

ping @ewindisch

@jessfraz
Copy link
Contributor Author

running across all versions now to test

@jessfraz jessfraz force-pushed the apparmor-check-version-on-deb-install branch 2 times, most recently from be722d3 to 7d8df7c Compare October 14, 2015 01:46
@ewindisch
Copy link
Contributor

Wish I thought of this :) Good job.

@jessfraz jessfraz force-pushed the apparmor-check-version-on-deb-install branch 7 times, most recently from 7b4aea1 to 9310c92 Compare October 15, 2015 21:24
@jessfraz
Copy link
Contributor Author

I added a test script

@jessfraz
Copy link
Contributor Author

also ping @tianon

Copy link
Member

Choose a reason for hiding this comment

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

Won't this mean that 3.9 > 3.10 if we just do the naïve float conversion here like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh shoot

On Fri, Oct 16, 2015 at 4:54 PM, Tianon Gravi [email protected]
wrote:

In contrib/apparmor/main.go
#17002 (comment):

  • }
  • // parse the version from the output
  • // output is in the form of the following:
  • // AppArmor parser version 2.9.1
  • // Copyright (C) 1999-2008 Novell Inc.
  • // Copyright 2009-2012 Canonical Ltd.
  • lines := strings.SplitN(string(output), "\n", 2)
  • words := strings.Split(lines[0], " ")
  • version := words[len(words)-1]
  • // get major minor version only
  • if strings.Count(version, ".") > 1 {
  •   version = version[:strings.LastIndex(version, ".")]
    
  • }
  • v, err := strconv.ParseFloat(version, 64)

Won't this mean that 3.9 > 3.10 if we just do the naïve float conversion
here like this?


Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/17002/files#r42301473.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

facepalm was trying to avoid using a version package like ours

On Fri, Oct 16, 2015 at 4:57 PM, Jessie Frazelle [email protected] wrote:

oh shoot

On Fri, Oct 16, 2015 at 4:54 PM, Tianon Gravi [email protected]
wrote:

In contrib/apparmor/main.go
#17002 (comment):

  • }
  • // parse the version from the output
  • // output is in the form of the following:
  • // AppArmor parser version 2.9.1
  • // Copyright (C) 1999-2008 Novell Inc.
  • // Copyright 2009-2012 Canonical Ltd.
  • lines := strings.SplitN(string(output), "\n", 2)
  • words := strings.Split(lines[0], " ")
  • version := words[len(words)-1]
  • // get major minor version only
  • if strings.Count(version, ".") > 1 {
  •  version = version[:strings.LastIndex(version, ".")]
    
  • }
  • v, err := strconv.ParseFloat(version, 64)

Won't this mean that 3.9 > 3.10 if we just do the naïve float conversion
here like this?


Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/17002/files#r42301473.

Copy link
Member

@tianon tianon Oct 17, 2015 via email

Choose a reason for hiding this comment

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

@jessfraz jessfraz force-pushed the apparmor-check-version-on-deb-install branch from 9310c92 to 14e85c8 Compare October 19, 2015 23:15
@jessfraz
Copy link
Contributor Author

updated

@thaJeztah
Copy link
Member

ping @tianon PTAL

@tianon
Copy link
Member

tianon commented Oct 26, 2015

Cool, LGTM 👍

@ewindisch
Copy link
Contributor

@jfrazelle looks good, but it will need some refactoring if we later reintroduce the container policies into contrib/apparmor.

It's okay, but worth noting for readers of this thread / docs-folks that this is not changing current AppArmor config, but is installing a new policy which defines what the docker-engine itself can do (rather than containers). This policy is in complain-only mode, so there should be no harm in installing it except, perhaps, some additional warning messages in dmesg.

@thaJeztah
Copy link
Member

@ewindisch @jfrazelle if it's in complain-only mode, would it be good to include it in 1.9? Then we can collect feedback and have a whole release to fine-tune if needed

@jessfraz
Copy link
Contributor Author

No we should wait and test more for sure no rushing apparmor fixes ;)

@jessfraz
Copy link
Contributor Author

but by all means lets merge it :P

@thaJeztah
Copy link
Member

YOLO, LGTM, as a wise man once taught me; looks like Go and AppArmor, merging!

we can refactor when the container policies land

thaJeztah added a commit that referenced this pull request Oct 26, 2015
…b-install

apparmor check version on deb install
@thaJeztah thaJeztah merged commit 9312a73 into moby:master Oct 26, 2015
@jessfraz jessfraz deleted the apparmor-check-version-on-deb-install branch October 26, 2015 22:43
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