Skip to content

Instantly share code, notes, and snippets.

@nl5887
Created February 7, 2021 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nl5887/34fe4cfdb94045e0895889f5a0df83ba to your computer and use it in GitHub Desktop.
Save nl5887/34fe4cfdb94045e0895889f5a0df83ba to your computer and use it in GitHub Desktop.
#!/bin/bash
find "$@" -type f \( -perm -u=x -o -perm -g=x -o -perm -o=x \) -print0 | while read -d $'\0' file
do
OUTPUT=$(santactl fileinfo "$file")
if [[ $OUTPUT =~ (Code-signed[[:space:]]+:[[:space:]]Yes) ]]; then
echo -n "Whitelisting $file by certificate: "
santactl rule --whitelist --certificate --path "$file"
else
echo -n "Whitelisting $file: "
santactl rule --whitelist --path "$file"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment