mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
This commit is contained in:
parent
c7a74802ab
commit
bdc2677f7b
8 changed files with 16 additions and 14 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
import argparse
|
||||
|
||||
from apparmor.tools import *
|
||||
import apparmor.tools
|
||||
|
||||
parser = argparse.ArgumentParser(description='Switch the given programs to audit mode')
|
||||
parser.add_argument('-d', type=str, help='path to profiles')
|
||||
|
@ -10,6 +10,6 @@ parser.add_argument('-r', '--remove', action='store_true', help='remove audit mo
|
|||
parser.add_argument('program', type=str, nargs='+', help='name of program')
|
||||
args = parser.parse_args()
|
||||
|
||||
audit = aa_tools('audit', args)
|
||||
audit = apparmor.tools.aa_tools('audit', args)
|
||||
|
||||
audit.act()
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import argparse
|
||||
|
||||
from apparmor.tools import *
|
||||
import apparmor.tools
|
||||
|
||||
parser = argparse.ArgumentParser(description='')
|
||||
parser.add_argument('--force', type=str, help='path to profiles')
|
||||
|
@ -10,6 +10,6 @@ parser.add_argument('-d', type=str, help='path to profiles')
|
|||
parser.add_argument('program', type=str, nargs='+', help='name of program')
|
||||
args = parser.parse_args()
|
||||
|
||||
autodep = aa_tools('autodep', args)
|
||||
autodep = apparmor.tools.aa_tools('autodep', args)
|
||||
|
||||
autodep.act()
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
import argparse
|
||||
|
||||
from apparmor.tools import *
|
||||
import apparmor.tools
|
||||
|
||||
parser = argparse.ArgumentParser(description='Cleanup the profiles for the given programs')
|
||||
parser.add_argument('-d', type=str, help='path to profiles')
|
||||
parser.add_argument('program', type=str, nargs='+', help='name of program')
|
||||
args = parser.parse_args()
|
||||
|
||||
clean = aa_tools('cleanprof', args)
|
||||
clean = apparmor.tools.aa_tools('cleanprof', args)
|
||||
|
||||
clean.act()
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import argparse
|
||||
|
||||
from apparmor.tools import *
|
||||
import apparmor.tools
|
||||
|
||||
parser = argparse.ArgumentParser(description='Switch the given program to complain mode')
|
||||
parser.add_argument('-d', type=str, help='path to profiles')
|
||||
|
@ -10,6 +10,6 @@ parser.add_argument('-r', '--remove', action='store_true', help='remove complain
|
|||
parser.add_argument('program', type=str, nargs='+', help='name of program')
|
||||
args = parser.parse_args()
|
||||
|
||||
complain = aa_tools('complain', args)
|
||||
complain = apparmor.tools.aa_tools('complain', args)
|
||||
|
||||
complain.act()
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import argparse
|
||||
|
||||
from apparmor.tools import *
|
||||
import apparmor.tools
|
||||
|
||||
parser = argparse.ArgumentParser(description='Disable the profile for the given programs')
|
||||
parser.add_argument('-d', type=str, help='path to profiles')
|
||||
|
@ -10,7 +10,7 @@ parser.add_argument('-r', '--revert', action='store_true', help='enable the prof
|
|||
parser.add_argument('program', type=str, nargs='+', help='name of program')
|
||||
args = parser.parse_args()
|
||||
|
||||
disable = aa_tools('disable', args)
|
||||
disable = apparmor.tools.aa_tools('disable', args)
|
||||
|
||||
disable.act()
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import argparse
|
||||
|
||||
from apparmor.tools import *
|
||||
import apparmor.tools
|
||||
|
||||
parser = argparse.ArgumentParser(description='Switch the given program to enforce mode')
|
||||
parser.add_argument('-d', type=str, help='path to profiles')
|
||||
|
@ -12,6 +12,6 @@ args = parser.parse_args()
|
|||
# Flipping the remove flag since complain = !enforce
|
||||
args.remove = not args.remove
|
||||
|
||||
enforce = aa_tools('complain', args)
|
||||
enforce = apparmor.tools.aa_tools('complain', args)
|
||||
|
||||
enforce.act()
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/python
|
||||
|
|
@ -18,14 +18,14 @@ import apparmor.logparser
|
|||
import apparmor.severity
|
||||
import LibAppArmor
|
||||
|
||||
from copy import deepcopy
|
||||
|
||||
from apparmor.common import (AppArmorException, error, debug, msg, cmd,
|
||||
open_file_read, valid_path,
|
||||
hasher, open_file_write, convert_regexp, DebugLogger)
|
||||
|
||||
from apparmor.ui import *
|
||||
|
||||
from copy import deepcopy
|
||||
|
||||
from apparmor.aamode import *
|
||||
|
||||
# Setup logging incase of debugging is enabled
|
||||
|
|
Loading…
Add table
Reference in a new issue