You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Cloud.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -844,3 +844,40 @@ for home in /home/* /root; do
844
844
done
845
845
done
846
846
```
847
+
848
+
## GitHub TruffleHog Secret Scanning (T1552.001)
849
+
850
+
Down and dirty scanning for all repos in a GitHub org for verified secrets using TruffleHog. Clones over SSH, no PAT needed for repo access, just an SSH key with org permissions.
851
+
852
+
```bash
853
+
#!/usr/bin/env bash
854
+
set -euo pipefail
855
+
856
+
forcmdin gh git trufflehog;do
857
+
if!command -v "$cmd"&>/dev/null;then
858
+
echo"Error: $cmd is not installed">&2
859
+
exit 1
860
+
fi
861
+
done
862
+
863
+
RESULTS_DIR="trufflehog-results"
864
+
ORG="YOUR_ORG"
865
+
mkdir -p "$RESULTS_DIR"
866
+
867
+
REPOS=()
868
+
while IFS= read -r line;do
869
+
REPOS+=("$line")
870
+
done<<(gh repo list "$ORG" --limit 1000 --json name -q '.[].name')
871
+
872
+
forrepoin"${REPOS[@]}";do
873
+
echo"Scanning $repo..."
874
+
if git clone --quiet git@github.com:"$ORG"/"$repo".git;then
0 commit comments