Cookbooks
apparmor
documentation
Apparmor Policy

Back to resource list

apparmor_policy

Adds or removes AppArmor policies

Actions

ActionDescription
:addAdds a new AppArmor policy using a provided policy file
:removeRemoves a specified AppArmor policy

Properties

NameTypeDefaultDescription
nameStringResource nameThe name of the policy as stored in /etc/apparmor.d/
source_cookbookStringCookbook to source the policy file from if the provider is not in the same cookbook.
source_filenameStringName of the source file in the cookbook if it doesn't match the name attribute

Examples

Add the policy my_super_app where a cookbook file exists in the same cookbook and is named my_super_app

apparmor_policy 'my_super_app'
 

Add the policy my_super_app where a cookbook file exists in a different cookbook and the file is named my_super_app_am_policy

apparmor_policy 'my_super_app' do
  source_cookbook 'acme_apparmor_profiles'
  source_filename 'my_super_app_am_policy'
end

Remove the policy my_super_app

apparmor_policy 'my_super_app' do
  action  :remove
end