2
# ----------------------------------------------------------------------
3
# Copyright (C) 2013 Kshitij Gupta <kgupta8592@gmail.com>
5
# This program is free software; you can redistribute it and/or
6
# modify it under the terms of version 2 of the GNU General Public
7
# License as published by the Free Software Foundation.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# ----------------------------------------------------------------------
19
# setup exception handling
20
from apparmor.fail import enable_aa_exception_handler
21
enable_aa_exception_handler()
23
# setup module translations
24
from apparmor.translations import init_translation
25
_ = init_translation()
27
parser = argparse.ArgumentParser(description=_('Switch the given programs to audit mode'))
28
parser.add_argument('-d', '--dir', type=str, help=_('path to profiles'))
29
parser.add_argument('-r', '--remove', action='store_true', help=_('remove audit mode'))
30
parser.add_argument('program', type=str, nargs='+', help=_('name of program'))
31
parser.add_argument('--no-reload', dest='do_reload', action='store_false', default=True, help=_('Do not reload the profile after modifying it'))
32
args = parser.parse_args()
34
tool = apparmor.tools.aa_tools('audit', args)