Created
February 7, 2021 18:10
-
-
Save nl5887/34fe4cfdb94045e0895889f5a0df83ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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