Skip to content

Instantly share code, notes, and snippets.

@meeuw
Created May 26, 2014 19:02
Show Gist options
  • Save meeuw/05b9ad1fd6d41be9c275 to your computer and use it in GitHub Desktop.
Save meeuw/05b9ad1fd6d41be9c275 to your computer and use it in GitHub Desktop.
generate selinux module's by using auseach and diffing output
#!/bin/bash
if [ -n "$2" ] ; then
ausearch -m avc -ts $2|audit2allow -m $1 > $1.tt.tmp
diff -ud $1.tt $1.tt.tmp
read
mv -f $1.tt.tmp $1.tt
fi
checkmodule -M -m $1.tt -o $1.mod
semodule_package -o $1.pp -m $1.mod
semodule -i $1.pp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment