2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 18:17:09 +00:00
apparmor/Tools/aa-enforce.py

18 lines
546 B
Python
Raw Normal View History

#!/usr/bin/python
import argparse
from apparmor.tools import *
parser = argparse.ArgumentParser(description='Switch the given program to enforce mode')
parser.add_argument('-d', 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
enforce = aa_tools('complain', args)
enforce.act()