audit2allow man page on CentOS

Man page or keyword search:  
man Server   8420 pages
apropos Keyword Search (all sections)
Output format
CentOS logo
[printable version]

AUDIT2ALLOW(1)			      NSA			AUDIT2ALLOW(1)

NAME
       audit2allow  -  generate SELinux policy allow rules from logs of denied
       operations

SYNOPSIS
       audit2allow [options]

OPTIONS
       -a | --all
	      Read input from audit and message log, conflicts with -i

       -d | --dmesg
	      Read input from output of /bin/dmesg.  Note that all audit  mes‐
	      sages  are  not  available via dmesg when auditd is running; use
	      "ausearch -m avc | audit2allow"  or "-a" instead.

       -h | --help
	      Print a short usage message

       -i  <inputfile> | --input <inputfile>
	      read input from <inputfile>

       -l | --lastreload
	      read input only after last policy reload

       -m <modulename> | --module <modulename>
	      Generate module/require output <modulename>

       -M <modulename>
	      Generate loadable module package, conflicts with -o

       -o <outputfile> | --output <outputfile>
	      append output to <outputfile>

       -r | --requires
	      Generate require output syntax for loadable modules.

       -R | --reference
	      Generate reference policy using installed macros.	 Requires  the
	      selinux-policy-devel package.

       -v | --verbose
	      Turn on verbose output

DESCRIPTION
       This  utility scans the logs for messages logged when the system denied
       permission for operations, and generates	 a  snippet  of	 policy	 rules
       which,  if  loaded  into policy, might have allowed those operations to
       succeed. However, this utility only  generates  Type  Enforcement  (TE)
       allow  rules.   Certain	permission  denials may require other kinds of
       policy changes, e.g. adding an attribute to a type declaration to  sat‐
       isfy  an	 existing constraint, adding a role allow rule, or modifying a
       constraint.  The audit2why(8) utility may be used to diagnose the  rea‐
       son when it is unclear.

       Care  must  be  exercised while acting on the output of this utility to
       ensure that the operations being	 permitted  do	not  pose  a  security
       threat.	Often it is better to define new domains and/or types, or make
       other structural changes to narrowly allow an optimal set of operations
       to  succeed,  as	 opposed  to  blindly implementing the sometimes broad
       changes recommended by this utility.   Certain permission  denials  are
       not  fatal  to  the  application, in which case it may be preferable to
       simply suppress logging of the denial via  a  'dontaudit'  rule	rather
       than an 'allow' rule.

EXAMPLE
       NOTE: These examples are for systems using the audit package. If you do
       not use the audit package, the AVC messages will be in /var/log/messages.
       Please substitute /var/log/messages for /var/log/audit/audit.log in the
       examples.

       Using audit2allow to generate monolithic (non-module) policy
       $ cd /etc/selinux/$SELINUXTYPE/src/policy
       $ cat /var/log/audit/audit.log | audit2allow >> domains/misc/local.te
       $ cat domains/misc/local.te
       allow cupsd_config_t unconfined_t:fifo_file { getattr ioctl };
       <review domains/misc/local.te and customize as desired>
       $ make load

       Using audit2allow to generate module policy

       $ cat /var/log/audit/audit.log | audit2allow -m local > local.te
       $ cat local.te
       module local 1.0;

       require {
	       role system_r;

	       class fifo_file {  getattr ioctl };

	       type cupsd_config_t;
	       type unconfined_t;
	};

       allow cupsd_config_t unconfined_t:fifo_file { getattr ioctl };
       <review local.te and customize as desired>

       Building module policy manually

       # Compile the module
       $ checkmodule -M -m -o local.mod local.te
       # Create the package
       $ semodule_package -o local.pp -m local.mod
       # Load the module into the kernel
       $ semodule -i local.pp

       Using audit2allow to generate and build module policy
       $ cat /var/log/audit/audit.log | audit2allow -M local
       Generating type enforcment file: local.te
       Compiling policy: checkmodule -M -m -o local.mod local.te
       Building package: semodule_package -o local.pp -m local.mod

       ******************** IMPORTANT ***********************

       In order to load this newly created policy package into the kernel,
       you are required to execute

       semodule -i local.pp

AUTHOR
       This manual page was written by Manoj Srivastava <srivasta@debian.org>,
       for  the	 Debian	 GNU/Linux  system.  It	 was  updated  by  Dan	 Walsh
       <dwalsh@redhat.com>

       The  audit2allow utility has contributions from several people, includ‐
       ing Justin R. Smith and Yuichi Nakamura.	 and Dan Walsh

Security Enhanced Linux		 January 2005			AUDIT2ALLOW(1)
[top]

List of man pages available for CentOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net