aws-samples / amazon-guardduty-multiaccount-scripts

This script automates the process of running the GuardDuty multi-account workflow across a group of accounts that are in your control
Apache License 2.0
130 stars 71 forks source link

enableguardduty script - argument to disable email invite? #26

Open scanjam opened 5 years ago

scanjam commented 5 years ago

This is not an issue with the script as it works beautifully! (apart from the issues with the disable script as part of issues highlighted already) Thank you to everyone who has worked on this so far! - but i am just wondering if there is a simple way to add an argument to disable the invite emails?

We were looking to enable this across 30+ accounts. When testing it across 4 accounts for all regions we received 68 emails (one for each account and region GD was enabled in).

Like I said not a big problem, but worth noting if you are the recipient for all the accounts root emails or alternatively advise your customers that they will individual email for each region GD is enabled in as part of the script.

Cheers

jamsan920 commented 4 years ago

7 months too late for you, but we just came across this same issue today and the solution is rather simple. The invite_members function call (line ~357) has an optional parameter called "DisableEmailNotification". Setting that to True will stop the email notifications from going out.

master_gd_client.invite_members(
                                AccountIds=[
                                    account
                                ],
                                DetectorId=master_detector_id,
                                DisableEmailNotification = True#,
                                #Message=gd_invite_message
                            )