Skip to content

Commit 33a597f

Browse files
authored
Merge pull request #44 from underscorenygren/master
Add script,README to update features in bulk for EKS,Malware Protection
2 parents 7658709 + afd7d4f commit 33a597f

File tree

3 files changed

+416
-1
lines changed

3 files changed

+416
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.csv

README.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,30 @@ Note: Account owners of member accounts will recieve an email for each region re
2525
"Resource": "*",
2626
"Condition": {
2727
"StringLike": {
28-
"iam:AWSServiceName": "guardduty.amazonaws.com"
28+
"iam:AWSServiceName": [
29+
"guardduty.amazonaws.com",
30+
"malware-protection.guardduty.amazonaws.com"
31+
]
2932
}
3033
}
34+
},
35+
{
36+
"Effect": "Allow",
37+
"Action": [
38+
"organizations:EnableAWSServiceAccess",
39+
"organizations:RegisterDelegatedAdministrator",
40+
"organizations:ListDelegatedAdministrators",
41+
"organizations:ListAWSServiceAccessForOrganization",
42+
"organizations:DescribeOrganizationalUnit",
43+
"organizations:DescribeAccount",
44+
"organizations:DescribeOrganization"
45+
],
46+
"Resource": "*"
47+
},
48+
{
49+
"Effect": "Allow",
50+
"Action": "iam:GetRole",
51+
"Resource": "arn:aws:iam::*:role/*AWSServiceRoleForAmazonGuardDutyMalwareProtection"
3152
}
3253
]
3354
}
@@ -128,3 +149,46 @@ optional arguments:
128149
Role Name to assume in each account
129150
--delete_master Delete the master Gd Detector
130151
```
152+
153+
#### 2b. Change GuardDuty Features
154+
155+
Guardduty has multiple optional detection features that can be edited on a per-account basis.
156+
157+
`updatefeature.py` allows you to toggle these on and off in bulk. Note that this only works on accounts
158+
that are already enabled and associated with `enableguardduty.py`.
159+
160+
For any given feature, `enable_<feature>` will turn it on, `disable_<feature>` will turn it off. If a
161+
flag for a `<feature>` is not provided, the previous value will be kept, which can be enabled _or_ disabled.
162+
163+
```
164+
usage: updatefeature.py [-h] --master_account MASTER_ACCOUNT --assume_role ASSUME_ROLE [--enabled_regions ENABLED_REGIONS] [--enable_malware [ENABLE_MALWARE]] [--enable_eks [ENABLE_EKS]] [--enable_s3 [ENABLE_S3]] [--disable_malware [DISABLE_MALWARE]] [--disable_eks [DISABLE_EKS]]
165+
[--disable_s3 [DISABLE_S3]] [--debug]
166+
input_file
167+
168+
Link AWS Accounts to central GuardDuty Account
169+
170+
positional arguments:
171+
input_file Path to CSV file containing the list of account IDs and Email addresses
172+
173+
optional arguments:
174+
-h, --help show this help message and exit
175+
--master_account MASTER_ACCOUNT
176+
AccountId for Central AWS Account
177+
--assume_role ASSUME_ROLE
178+
Role Name to assume in each account
179+
--enabled_regions ENABLED_REGIONS
180+
comma separated list of regions to enable GuardDuty. If not specified, all available regions enabled
181+
--enable_malware [ENABLE_MALWARE]
182+
Enables GuardDuty Malware Protection
183+
--enable_eks [ENABLE_EKS]
184+
Enables GuardDuty for EKS
185+
--enable_s3 [ENABLE_S3]
186+
Enables GuardDuty S3 Protection
187+
--disable_malware [DISABLE_MALWARE]
188+
Disable GuardDuty Malware Protection
189+
--disable_eks [DISABLE_EKS]
190+
Disable GuardDuty for EKS
191+
--disable_s3 [DISABLE_S3]
192+
Disable GuardDuty S3 Protection
193+
--debug Turns on more verbose logging
194+
```

0 commit comments

Comments
 (0)