Skip to content

Instantly share code, notes, and snippets.

@ekojs
Last active January 22, 2022 09:56
Show Gist options
  • Save ekojs/d49afbc3c5670e3d8277a3ff1c855c2d to your computer and use it in GitHub Desktop.
Save ekojs/d49afbc3c5670e3d8277a3ff1c855c2d to your computer and use it in GitHub Desktop.
Compile custom semodule for selinux policy
#!/bin/bash
for x in $(ausearch -m AVC,USER_AVC,SELINUX_ERR,USER_SELINUX_ERR -i | grep -w comm | sed 's/.*comm/comm/g;s/comm=\(\w\+\).*/\1/g' | sort -u);do ausearch -c "$x" --raw | audit2allow -w;done
#!/bin/bash
checkmodule -M -m -o $1.mod $1.te
semodule_package -o $1.pp -m $1.mod
rm -f *.mod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment