-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9180 from elysahall/awsdocs-12-30-24-p2
CLI examples for guardduty
- Loading branch information
Showing
11 changed files
with
85 additions
and
41 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
**To archive findings in the current region** | ||
|
||
This example shows how to archive findings in the current region. :: | ||
This ``archive-findings`` example shows how to archive findings in the current region. :: | ||
|
||
aws guardduty archive-findings \ | ||
--detector-id 12abc34d567e8fa901bc2d34eexample \ | ||
--finding-ids d6b94fb03a66ff665f7db8764example 3eb970e0de00c16ec14e6910fexample | ||
|
||
This command produces no output. | ||
This command produces no output. | ||
|
||
For more information, see `Managing GuardDuty Accounts by Invitation <https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings.html#guardduty_working-with-findings>`__ in the *GuardDuty User Guide*. | ||
For more information, see `Creating suppression rules <https://docs.aws.amazon.com/guardduty/latest/ug/findings_suppression-rules-console.html>`__ in the *GuardDuty User Guide*. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
**To create a new filter for the current region** | ||
**Example 1: To create a new filter in the current region** | ||
|
||
This example creates a filter that matches all portscan findings for instance created from a specific image.:: | ||
The following ``create-filter`` example creates a filter that matches all Portscan findings for instance created from a specific image. This does not suppress those findings. :: | ||
|
||
aws guardduty create-filter \ | ||
--detector-id b6b992d6d2f48e64bc59180bfexample \ | ||
--name myFilterExample \ | ||
--finding-criteria '{"Criterion": {"type": {"Eq": ["Recon:EC2/Portscan"]},"resource.instanceDetails.imageId": {"Eq": ["ami-0a7a207083example"]}}}' | ||
|
||
Output:: | ||
|
||
{ | ||
"Name": "myFilterExample" | ||
} | ||
|
||
For more information, see `Filtering GuardDuty findings <https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_filter-findings.html>`__ in the *GuardDuty User Guide*. | ||
|
||
**Example 2: To create a new filter and suppress findings in the current region** | ||
|
||
The following ``create-filter`` example creates a filter that matches all Portscan findings for instance created from a specific image. This filter archives those findings so that they do not appear in your current findings. :: | ||
|
||
aws guardduty create-filter \ | ||
--detector-id b6b992d6d2f48e64bc59180bfexample \ | ||
--action ARCHIVE \ | ||
--name myFilter \ | ||
--name myFilterSecondExample \ | ||
--finding-criteria '{"Criterion": {"type": {"Eq": ["Recon:EC2/Portscan"]},"resource.instanceDetails.imageId": {"Eq": ["ami-0a7a207083example"]}}}' | ||
|
||
Output:: | ||
|
||
{ | ||
"Name": "myFilter" | ||
"Name": "myFilterSecondExample" | ||
} | ||
|
||
For more information, see `Filtering findings <https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_filter-findings.html>`__ in the *GuardDuty User Guide*. | ||
For more information, see `Filtering GuardDuty findings <https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_filter-findings.html>`__ in the *GuardDuty User Guide*. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
**To create a trusted IP set** | ||
**To create and activate a trusted IP set** | ||
|
||
The following ``create-ip-set`` example creates and activates a trusted IP set in the current region. :: | ||
The following ``create-ip-set`` example creates and activates a trusted IP set in the current Region. :: | ||
|
||
aws guardduty create-ip-set \ | ||
--detector-id 12abc34d567e8fa901bc2d34eexample \ | ||
--name new-ip-set \ | ||
--format TXT | ||
--location s3://amzn-s3-demo-bucket/customtrustlist.csv | ||
--name new-ip-set-example \ | ||
--format TXT \ | ||
--location s3://amzn-s3-demo-bucket/customtrustlist.csv \ | ||
--activate | ||
|
||
Output:: | ||
|
||
{ | ||
"IpSetId": "d4b94fc952d6912b8f3060768example" | ||
} | ||
|
||
For more information, see `Working with Trusted IP Lists and Threat Lists <https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_upload_lists.html>`__ in the GuardDuty User Guide. | ||
For more information, see `Working with Trusted IP Lists and Threat Lists <https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_upload_lists.html>`__ in the *GuardDuty User Guide*. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
**To create a publishing destination to export GuardDuty findings in the current region to.** | ||
|
||
This example shows how to create a publishing destination for GuardDuty findings. :: | ||
The following ``create-publishing-destination`` example shows how to set up a publishing destination to export current (not archived) GuardDuty findings to keep track of historical findings data. :: | ||
|
||
aws guardduty create-publishing-destination \ | ||
--detector-id b6b992d6d2f48e64bc59180bfexample \ | ||
--destination-type S3 \ | ||
--destination-properties DestinationArn=arn:aws:s3:::yourbucket,KmsKeyArn=arn:aws:kms:us-west-1:111122223333:key/84cee9c5-dea1-401a-ab6d-e1de7example | ||
--destination-properties 'DestinationArn=arn:aws:s3:::amzn-s3-demo-bucket,KmsKeyArn=arn:aws:kms:us-west-1:111122223333:key/84cee9c5-dea1-401a-ab6d-e1de7example' | ||
|
||
Output:: | ||
|
||
{ | ||
"DestinationId": "46b99823849e1bbc242dfbe3cexample" | ||
} | ||
|
||
For more information, see `Exporting findings <https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_exportfindings.html>`__ in the *GuardDuty User Guide*. | ||
For more information, see `Exporting generated GuardDuty findings to Amazon S3 buckets <https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_exportfindings.html>`__ in the *GuardDuty User Guide*. |
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
6 changes: 3 additions & 3 deletions
6
awscli/examples/guardduty/disassociate-from-master-account.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
**To disassociate from your current master account in the current region** | ||
**To disassociate from your current administrator account in the current region** | ||
|
||
The following ``disassociate-from-master-account`` example dissassociates your account from the current GuardDuty master account in the current AWS region. :: | ||
The following ``disassociate-from-master-account`` example dissassociates your account from the current GuardDuty administrator account in the current AWS region. :: | ||
|
||
aws guardduty disassociate-from-master-account \ | ||
--detector-id d4b040365221be2b54a6264dcexample | ||
|
||
This command produces no output. | ||
|
||
For more information, see `Understanding the Relationship between GuardDuty Master and Member Accounts <https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_accounts.html#master_member_relationships>`__ in the GuardDuty User Guide. | ||
For more information, see `Understanding the relationship between GuardDuty administrator account and member accounts <https://docs.aws.amazon.com/guardduty/latest/ug/administrator_member_relationships.html>`__ in the *GuardDuty User Guide*. |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,51 @@ | ||
**To list all members in the current region** | ||
**Example 1: To list only current members in the current Region** | ||
|
||
The following ``list-members`` example lists all member accounts and their details for the current region. :: | ||
The following ``list-members`` example lists and provides details of only current member accounts associated with the GuardDuty administrator account, in the current region. :: | ||
|
||
aws guardduty list-members \ | ||
--detector-id 12abc34d567e8fa901bc2d34eexample | ||
--detector-id 12abc34d567e8fa901bc2d34eexample \ | ||
--only-associated="true" | ||
|
||
Output:: | ||
|
||
{ | ||
"Members": [ | ||
{ | ||
"RelationshipStatus": "Enabled", | ||
"InvitedAt": "2020-06-09T22:49:00.910Z", | ||
"MasterId": "123456789111", | ||
"MasterId": "111122223333", | ||
"DetectorId": "7ab8b2f61b256c87f793f6a86example", | ||
"UpdatedAt": "2020-06-09T23:08:22.512Z", | ||
"Email": "your+member@example.com", | ||
"AccountId": "123456789222" | ||
"AccountId": "123456789012" | ||
} | ||
] | ||
} | ||
|
||
For more information, see `Understanding the relationship between GuardDuty administrator account and member accounts <https://docs.aws.amazon.com/guardduty/latest/ug/administrator_member_relationships.html>`__ in the *GuardDuty User Guide*. | ||
|
||
**Example 2: To list all the members in the current Region** | ||
|
||
The following ``list-members`` example lists and provides details of all the member accounts, including those who have been disassociated or have not yet accepted the invite from the GuardDuty administrator, in the current region. :: | ||
|
||
aws guardduty list-members \ | ||
--detector-id 12abc34d567e8fa901bc2d34eexample \ | ||
--only-associated="false" | ||
|
||
Output:: | ||
|
||
{ | ||
"Members": [ | ||
{ | ||
"RelationshipStatus": "Enabled", | ||
"InvitedAt": "2020-06-09T22:49:00.910Z", | ||
"MasterId": "111122223333", | ||
"DetectorId": "7ab8b2f61b256c87f793f6a86example", | ||
"UpdatedAt": "2020-06-09T23:08:22.512Z", | ||
"Email": "your+other+member@example.com", | ||
"AccountId": "555555555555" | ||
} | ||
] | ||
} | ||
|
||
For more information, see `Understanding the Relationship between GuardDuty Master and Member Accounts <https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_accounts.html#master_member_relationships>`__ in the GuardDuty User Guide. | ||
For more information, see `Understanding the relationship between GuardDuty administrator account and member accounts <https://docs.aws.amazon.com/guardduty/latest/ug/administrator_member_relationships.html>`__ in the *GuardDuty User Guide*. |
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