Giter Club home page Giter Club logo

jenkins-autoarmor's Introduction

AutoArmor

AutoArmor is a Jenkins plugin to isolate Jenkins jobs from each other and from the system using AppArmor.

Installation

Build the plugin using Maven, and install it on the Jenkins master.
Then on all the Jenkins slaves that you want to protect:

  • Install AppArmor,
  • Build the autoarmor-genprof and autoarmor-wrapper helpers using CMake
  • Install both tools in the system PATH, and set the autoarmor-genprof helper setuid-root

And finally in the Jenkins master's system configuration set the AppArmor mode to Enforce to start using AppArmor.

AppArmor profile configuration

autoarmor-genprof will generate AppArmor profiles on the fly for new Jenkins jobs, but the profiles can be edited manually. Once a profile exists, autoarmor-genprof will not overwrite it. The default profile is embedded in autoarmor-genprof.

All the profiles can be found in /etc/apparmor.d/autoarmor/.

jenkins-autoarmor's People

Contributors

optimumtact avatar tux3 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jenkins-autoarmor's Issues

Prevents Jenkins from auto-creating workspace directory on a clean build slave

When adding a new node in Jenkins, you have to specify the root path. The workspace directory is then located at /root-path/workspace.

The issue is that on a cleanly built slave with no apparmor plugin installed, Jenkins will create the /root-path/workspace itself, but with this plugin installed, Jenkins will fail to create the /root-path/workspace and any job running would fail with the following error

Started by user <USERNAME>
Autoarmor: Loading AppArmor profile for workspace /root-path/workspace/<JOB_NAME>
FATAL: Autoarmor: Failed to load AppArmor profile, cancelling build.
java.lang.RuntimeException: Autoarmor: Failed to load AppArmor profile, cancelling build.
    at chat.tox.jenkins.autoarmor.AutoarmorLauncherDecorator.decorate(AutoarmorLauncherDecorator.java:109)
    at hudson.Launcher.decorateFor(Launcher.java:694)
    at hudson.model.Slave.createLauncher(Slave.java:387)
    at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:561)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:492)
    at hudson.model.Run.execute(Run.java:1738)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE

With the plugin enabled, Jenkins successfully creates /root-path, but doesn't create workspace in it. I think the plugin fails with the above error because it gives genprof job path /root-path/workspace/<JOB_NAME>, which doesn't exist because workspace directory wasn't auto-created by Jenkins. Disabling the plugin in Jenkins settings fixes the issue, Jenkins becomes able to create workspace directory and the job succeeds. Once the workspace directory is created, all consecutive jobs succeed too.

The current workaround I use is to mkdir -p /root-path/workspace, instead of relying on Jenkins to create it.

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.