GithubHelp home page GithubHelp logo

snapd's Introduction

snapd AppArmor confinement testing

To ensure that we don't unwittingly break snapd AppArmor confinement, it is useful to have a vetted set of tests with the same starting and ending point.

Reset the snapd environment

To test snapd.apparmor confinement, start by resetting the snapd environment to a known good state:

# remove the hello-world snap if installed
sudo snap remove hello-world
# remove the AppArmor cache
sudo rm -rf /var/cache/apparmor
# reinstall snapd and apparmor and ensure that aa-lsm-hook and usysoncf triggers run
sudo eopkg it --reinstall snapd apparmor

If you have more than the hello-world snap installed, please sudo snap remove all installed snaps.

At this point, either relog or reboot the machine on which the test is being run.

Install and check the hello-world snap

After the relog/reboot, check that the following works:

# check the status of the snapd.apparmor.service (it should be enabled and running in the green)
sudo systemctl status snapd.apparmor.service
# install and run the hello-world snap
sudo snap install hello-world
snap run hello-world

The expected output of snap run hello-world with a correctly configured snapd AppArmor confinement:

$ snap run hello-world
Hello World!

If something is wrong with how the snapd AppArmor confinement is set up, the error state will typically look something like this:

$ snap run hello-world
snap-confine has elevated permissions and is not confined but should be. Refusing to continue to avoid permission escalation attacks
Please make sure that the snapd.apparmor service is enabled and started.

snapd's People

Contributors

ikeydoherty avatar girtablulu avatar joshstrobl avatar algent-al avatar reillybrogan avatar datadrake avatar joebonrichie avatar ermo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.