Skip to content

Commit

Permalink
Merge branch 'master' into ecr_enhancedscan_update
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish25 authored Jan 26, 2022
2 parents 4d5b736 + c0fa065 commit e97abd4
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 44 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v0.1.5 ( 9 November 2021)

* Add filtering to ecr output to not display if no findings found
* Condense ecr report so multiple tags are together for one image digest

## v0.1.4 ( 1 September 2021)

* Add fix for trusted advisor metadata coming in unexpected order
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.1.4
v0.1.5
51 changes: 29 additions & 22 deletions doc/ecrscan.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,26 @@ Sample Output(JSON)
```json
{
"findings": [
{
"accountId": "333333333333",
"imageDigest": "sha256:88d5da4609681df482d51c4e898d107317c32bd3c4951793138570cc18c1294d",
"imageTag": "latest",
"repositoryName": "dig/pingfederate-server",
"region": "us-east-1",
"comments": "NEW_FINDING",
{
"accountId": "3333333333333",
"imageDigest": "sha256:b20c71bdd914b436f9d4745cb5392cd86c3e2esd4517f5cc442060a1ec3193ed",
"imageTag": "stage-2021-09-28.060926,prod-2021-10-09.031013,deploy-2.3,nonprod-2021-10-07.01",
"repositoryName": "dig/sample-server",
"imageFindingsCount": {
"HIGH": 1
}
"MEDIUM": 8
},
"comments": "NEW_FINDING",
"region": "us-east-1"
},
{
"accountId": "333333333333",
"imageDigest": "sha256:99d0ab34e24a87884b104e76dea5d917ab026c0cfc352bc9cf2665d5d70f973a",
"imageTag": "v0.0.16",
"repositoryName": "dig/service-gateway",
"region": "us-east-1",
"comments": "**EXCEPTION** Patch will applied this weekend",
"accountId": "3333333333333",
"imageDigest": "sha256:33f43a94fdac3b494ae340c964facaead8b83b0arebddefd65de08c98c7c6fcf4",
"imageTag": "prod-2021-09-06.01,nonprod-2021-09-03.1,release-P8-1",
"repositoryName": "dig/sample-server",
"imageFindingsCount": {
"HIGH": 5,
"MEDIUM": 4
"HIGH": 1,
"LOW": 2,
"MEDIUM": 18
}
}
]
Expand All @@ -46,9 +45,17 @@ cloudig get scan --tag latest -o mdtable
```markdown
Sample output with mdtable format, with specific tag "latest"

| ACCOUNT ID | REGION | REPOSITORY NAME | TAG | VULNERABILITIES(COUNT) | COMMENTS |
| ------------ | --------- | ----------------------------------- | ------ | ---------------------- | ----------- |
| 111111111111 | us-east-1 | temporary-custom-terraform-provider | latest | LOW: 6 | NEW_FINDING |
| | | | | HIGH: 18 | |
| | | | | MEDIUM: 19 | |
| ACCOUNT ID | REGION | REPOSITORY NAME | TAG | VULNERABILITIES(COUNT) | COMMENTS |
|--------------|-----------|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|------------------------|-------------|
| 111111111111 | us-east-1 | dig/sample-server | alpha-2.17.1-pr-394.2 | MEDIUM: 9 | NEW_FINDING |
| | | | | HIGH: 1 | |
| | | | alpha-2.18.1-pr-393.10 | MEDIUM: 9 | NEW_FINDING |
| | | | | HIGH: 1 | |
| | | | alpha-2.17.1-pr-394.1 | MEDIUM: 9 | NEW_FINDING |
| | | | | HIGH: 1 | |
| | | | stage-2021-09-28.060926,prod-2021-10-08.031013,deploy-2.15.1-3,nonprod-2021-10-07.051031 | MEDIUM: 8 | NEW_FINDING |
| | | | prod-2021-09-06.020935,nonprod-2021-09-03.040916,release-P84-1 | LOW: 2 | NEW_FINDING |
| | | | | HIGH: 1 | |
| | | | | MEDIUM: 18 | |

```
22 changes: 1 addition & 21 deletions pkg/cloudig/ecrscan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestImageScanReports_GetReport(t *testing.T) {
{
AccountID: "012345678910",
ImageDigest: "sha256:e0fa362f30aa43f11d1d5e1822ef3117e03782cdd921aaab73267e1219a4fde2",
ImageTag: "prod-canary",
ImageTag: "prod-canary,test",
RepositoryName: "app/web-server",
ImageFindingsCount: map[string]int64{
"HIGH": 2,
Expand All @@ -70,26 +70,6 @@ func TestImageScanReports_GetReport(t *testing.T) {
Comments: "EXCEPTION Patch will applied this weekend",
Region: "us-east-1",
},
{
AccountID: "012345678910",
ImageDigest: "sha256:e0fa362f30aa43f11d1d5e1822ef3117e03782cdd921aaab73267e1219a4fde2",
ImageTag: "test",
RepositoryName: "app/web-server",
ImageFindingsCount: map[string]int64{
"HIGH": 2,
"MEDIUM": 8,
},
Comments: "NEW_FINDING",
Region: "us-east-1",
},
{
AccountID: "012345678910",
ImageDigest: "sha256:4e3bc79a145b6bb5756f8f52f60853e842a1681ace8b5115a715c892f4957ea9",
ImageTag: "test",
RepositoryName: "app/hello-world",
Comments: "NEW_FINDING",
Region: "us-east-1",
},
},
},
{
Expand Down

0 comments on commit e97abd4

Please sign in to comment.