Skip to content

Commit 617d1f6

Browse files
committed
Added GuardDuty Findings Script
Added GuardDuty Findings Script
1 parent c109890 commit 617d1f6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

GuardDuty/findings.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
#Export all GuardDuty Findigns In All Regions.
3+
4+
for region in $(aws ec2 describe-regions --output text | cut -f3)
5+
do
6+
detector=$(aws guardduty list-detectors --region="$region" --output text | cut -f2)
7+
for finding in $(aws guardduty list-findings --detector-id="$detector" --region="$region" | grep -v -e \{ -e "\[" -e \] -e \} | tr -d '"' | tr -d ',' | tr -d ' ')
8+
do
9+
aws guardduty get-findings --detector-id="$detector" --finding-id="$finding" --region="$region" > "$region-$finding".json
10+
printf "Exporting Finding: %s-%s.json \n" "$region" "$finding"
11+
done
12+
done

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ You will need the [AWS-CLI](https://aws.amazon.com/cli/) installed and configure
2222

2323
**_EC2/SecurityGroups/removessh.sh_**: Removes rules allowing SSH access from your current public IP address.
2424

25-
**_GuardDuty/enale.sh_**: Enables GuardDuty in all avalbile regions.
25+
**_GuardDuty/enale.sh_**: Enables GuardDuty in all available regions.
26+
27+
**_GuardDuty/findings.sh_**: Exports all GuardDuty findings to .json files.
2628

2729
## Important Notice
2830
*I likely dont know what I am doing and this could be done faster, better and simpler some other way. These scripts could also break your cloud and make you cry.*

0 commit comments

Comments
 (0)