interfaces/greengrass-support: adjust accesses now that have working snap #3591

Merged
merged 4 commits into from Jul 27, 2017

Conversation

Projects
None yet
4 participants
Contributor

jdstrand commented Jul 14, 2017

  • don't use owner match with @{PROC}/[0-9]*/mountinfo
  • use @{SNAP_REVISION} with pivot_root rule
  • allow 'ro, remount, rbind' on / for pivot_root in overlay
interfaces/greengrass-support: adjust accesses now that have working …
…snap

- don't use owner match with @{PROC}/[0-9]*/mountinfo
- use @{SNAP_REVISION} with pivot_root rule
- allow 'ro, remount, rbind' on / for pivot_root in overlay
@@ -128,11 +128,12 @@ mount options=(rw, bind) /dev/null -> /proc/sched_debug,
mount options=(rw, bind) /dev/null -> /proc/timer_stats,
# perform the pivot_root into the overlay
-pivot_root oldroot=/var/snap/greengrass/x1/rootfs/.pivot_root*/ /var/snap/greengrass/*/rootfs/,
+pivot_root oldroot=/var/snap/greengrass/@{SNAP_REVISION}/rootfs/.pivot_root*/ /var/snap/greengrass/*/rootfs/,
@zyga

zyga Jul 14, 2017

Contributor

Are you aware of the consequences of using pivot_root and how it makes most of our apparmor rules ineffective?

(Sorry for pulling this out now, I didn't notice this before)

@jdstrand

jdstrand Jul 14, 2017

Contributor

greengrass is proprietary software and fails without this access. It relies upon various features to setup its own sandbox.

However, I'm aware of mediation issues regarding overlayfs and pivot root (in particular https://bugs.launchpad.net/apparmor/+bug/1703692), which is just one of many reasons why this interface is a 'super-privileged' interface, like docker-support and lxd-support (ie, you need a snap declaration to even install a snap that plugs this).

@zyga

zyga Jul 14, 2017

Contributor

Ack, thank you, I just wanted to make sure this is well-known.

jdstrand and others added some commits Jul 18, 2017

Codecov Report

Merging #3591 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3591      +/-   ##
=========================================
- Coverage    74.9%   74.9%   -0.01%     
=========================================
  Files         380     380              
  Lines       32952   32952              
=========================================
- Hits        24684   24683       -1     
- Misses       6475    6476       +1     
  Partials     1793    1793
Impacted Files Coverage Δ
interfaces/builtin/greengrass_support.go 100% <ø> (ø) ⬆️
interfaces/sorting.go 94.28% <0%> (-2.86%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1436db4...e4c8ca7. Read the comment docs.

mvo5 approved these changes Jul 24, 2017

zyga approved these changes Jul 27, 2017

@zyga zyga merged commit c81d104 into snapcore:master Jul 27, 2017

7 checks passed

artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details
Contributor

jdstrand commented Jul 27, 2017

Thanks!

@jdstrand jdstrand deleted the jdstrand:greengrass-updates branch Jul 28, 2017

@jdstrand jdstrand added this to the 2.27 milestone Aug 7, 2017

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