apparmor/Tools/aa-enforce

18 lines
563 B
Text
Raw Normal View History

#!/usr/bin/python
import argparse
2013-08-31 04:13:05 +05:30
import apparmor.tools
parser = argparse.ArgumentParser(description='Switch the given program to enforce mode')
parser.add_argument('-d', '--dir', type=str, help='path to profiles')
parser.add_argument('-r', '--remove', action='store_true', help='switch to complain mode')
parser.add_argument('program', type=str, nargs='+', help='name of program')
args = parser.parse_args()
# Flipping the remove flag since complain = !enforce
args.remove = not args.remove
2013-08-31 04:13:05 +05:30
enforce = apparmor.tools.aa_tools('complain', args)
enforce.act()