Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide mechanism to opt-out of app armor #22

Merged
merged 1 commit into from
Feb 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions jobs/garden/templates/garden_ctl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@ function create_loop_devices() {

function setup_apparmor() {
export PATH=$PATH:$(readlink -nf /var/vcap/packages/apparmor/bin)
POLICY=garden-default
POLICY=<%= p("garden.apparmor_profile") %>
CONFIG_DIR=/var/vcap/jobs/garden/config

if ! mountpoint -q /sys/kernel/security; then
mount -t securityfs securityfs /sys/kernel/security
fi

if ! aa-status | grep $POLICY > /dev/null; then
apparmor_parser -a $CONFIG_DIR/$POLICY
if [ -n "$POLICY" ]; then
if ! aa-status | grep $POLICY > /dev/null; then
apparmor_parser -a $CONFIG_DIR/$POLICY
fi
fi
}

Expand Down Expand Up @@ -217,8 +219,8 @@ case $1 in
<% p("garden.dns_servers").each do |server| %> \
--dns-server=<%= server %> \
<% end %> \
<% if_p("garden.apparmor_profile") do |apparmor_profile| %> \
--apparmor=<%= apparmor_profile %> \
<% unless p("garden.apparmor_profile").to_s.empty? %> \
--apparmor=<%= p("garden.apparmor_profile") %> \
<% end %>
;;

Expand Down