Skip to content

Commit 667096f

Browse files
committed
chore(readme): add awscli command to generate yaml file
Signed-off-by: nitrocode <[email protected]>
1 parent 2fe01b2 commit 667096f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ findings:
3535
status: "SUPPRESED"
3636
```
3737
38+
The yaml file can be autogenerated from existing suppressions using this `awscli` command with `yq`.
39+
Feel free to remove `title` and `resource_id` keys. I use those as inline comments.
40+
Remember the `findings` parent key.
41+
42+
```bash
43+
aws securityhub get-findings \
44+
--filters '{"WorkflowStatus": [{"Value": "SUPPRESSED", "Comparison": "EQUALS"}] }' \
45+
--query 'Findings.{
46+
id: Id,
47+
product_arn: ProductArn,
48+
note: { text: Note.Text },
49+
workflow: { status: `"SUPPRESSED"` }
50+
title: Title,
51+
resource_id: Resources[0].Id,
52+
}' | yq -P . > findings.yaml
53+
```
54+
3855
---
3956

4057
<!-- BEGIN_TF_DOCS -->

0 commit comments

Comments
 (0)