mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-21 06:43:05 -08:00
Update ASFF template (#1914)
This commit is contained in:
@@ -3,6 +3,10 @@
|
|||||||
{{- $t_first := true -}}
|
{{- $t_first := true -}}
|
||||||
{{- range . -}}
|
{{- range . -}}
|
||||||
{{- $target := .Target -}}
|
{{- $target := .Target -}}
|
||||||
|
{{- $image := .Target -}}
|
||||||
|
{{- if gt (len $image) 127 -}}
|
||||||
|
{{- $image = $image | regexFind ".{124}$" | printf "...%v" -}}
|
||||||
|
{{- end}}
|
||||||
{{- range .Vulnerabilities -}}
|
{{- range .Vulnerabilities -}}
|
||||||
{{- if $t_first -}}
|
{{- if $t_first -}}
|
||||||
{{- $t_first = false -}}
|
{{- $t_first = false -}}
|
||||||
@@ -13,7 +17,7 @@
|
|||||||
{{- if eq $severity "UNKNOWN" -}}
|
{{- if eq $severity "UNKNOWN" -}}
|
||||||
{{- $severity = "INFORMATIONAL" -}}
|
{{- $severity = "INFORMATIONAL" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $description := .Description -}}
|
{{- $description := escapeString .Description | printf "%q" -}}
|
||||||
{{- if gt (len $description ) 1021 -}}
|
{{- if gt (len $description ) 1021 -}}
|
||||||
{{- $description = (substr 0 1021 $description) | printf "%v .." -}}
|
{{- $description = (substr 0 1021 $description) | printf "%v .." -}}
|
||||||
{{- end}}
|
{{- end}}
|
||||||
@@ -21,7 +25,7 @@
|
|||||||
"SchemaVersion": "2018-10-08",
|
"SchemaVersion": "2018-10-08",
|
||||||
"Id": "{{ $target }}/{{ .VulnerabilityID }}",
|
"Id": "{{ $target }}/{{ .VulnerabilityID }}",
|
||||||
"ProductArn": "arn:aws:securityhub:{{ env "AWS_REGION" }}::product/aquasecurity/aquasecurity",
|
"ProductArn": "arn:aws:securityhub:{{ env "AWS_REGION" }}::product/aquasecurity/aquasecurity",
|
||||||
"GeneratorId": "Trivy",
|
"GeneratorId": "Trivy/{{ .VulnerabilityID }}",
|
||||||
"AwsAccountId": "{{ env "AWS_ACCOUNT_ID" }}",
|
"AwsAccountId": "{{ env "AWS_ACCOUNT_ID" }}",
|
||||||
"Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ],
|
"Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ],
|
||||||
"CreatedAt": "{{ now | date "2006-01-02T15:04:05.999999999Z07:00" }}",
|
"CreatedAt": "{{ now | date "2006-01-02T15:04:05.999999999Z07:00" }}",
|
||||||
@@ -30,7 +34,7 @@
|
|||||||
"Label": "{{ $severity }}"
|
"Label": "{{ $severity }}"
|
||||||
},
|
},
|
||||||
"Title": "Trivy found a vulnerability to {{ .VulnerabilityID }} in container {{ $target }}",
|
"Title": "Trivy found a vulnerability to {{ .VulnerabilityID }} in container {{ $target }}",
|
||||||
"Description": {{ escapeString $description | printf "%q" }},
|
"Description": {{ $description }},
|
||||||
"Remediation": {
|
"Remediation": {
|
||||||
"Recommendation": {
|
"Recommendation": {
|
||||||
"Text": "More information on this vulnerability is provided in the hyperlink",
|
"Text": "More information on this vulnerability is provided in the hyperlink",
|
||||||
@@ -45,7 +49,7 @@
|
|||||||
"Partition": "aws",
|
"Partition": "aws",
|
||||||
"Region": "{{ env "AWS_REGION" }}",
|
"Region": "{{ env "AWS_REGION" }}",
|
||||||
"Details": {
|
"Details": {
|
||||||
"Container": { "ImageName": "{{ $target }}" },
|
"Container": { "ImageName": "{{ $image }}" },
|
||||||
"Other": {
|
"Other": {
|
||||||
"CVE ID": "{{ .VulnerabilityID }}",
|
"CVE ID": "{{ .VulnerabilityID }}",
|
||||||
"CVE Title": {{ .Title | printf "%q" }},
|
"CVE Title": {{ .Title | printf "%q" }},
|
||||||
|
|||||||
8
integration/testdata/alpine-310.asff.golden
vendored
8
integration/testdata/alpine-310.asff.golden
vendored
@@ -4,7 +4,7 @@
|
|||||||
"SchemaVersion": "2018-10-08",
|
"SchemaVersion": "2018-10-08",
|
||||||
"Id": "testdata/fixtures/images/alpine-310.tar.gz (alpine 3.10.2)/CVE-2019-1549",
|
"Id": "testdata/fixtures/images/alpine-310.tar.gz (alpine 3.10.2)/CVE-2019-1549",
|
||||||
"ProductArn": "arn:aws:securityhub:test-region::product/aquasecurity/aquasecurity",
|
"ProductArn": "arn:aws:securityhub:test-region::product/aquasecurity/aquasecurity",
|
||||||
"GeneratorId": "Trivy",
|
"GeneratorId": "Trivy/CVE-2019-1549",
|
||||||
"AwsAccountId": "123456789012",
|
"AwsAccountId": "123456789012",
|
||||||
"Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ],
|
"Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ],
|
||||||
"CreatedAt": "2020-08-10T07:28:17.000958601Z",
|
"CreatedAt": "2020-08-10T07:28:17.000958601Z",
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
"SchemaVersion": "2018-10-08",
|
"SchemaVersion": "2018-10-08",
|
||||||
"Id": "testdata/fixtures/images/alpine-310.tar.gz (alpine 3.10.2)/CVE-2019-1551",
|
"Id": "testdata/fixtures/images/alpine-310.tar.gz (alpine 3.10.2)/CVE-2019-1551",
|
||||||
"ProductArn": "arn:aws:securityhub:test-region::product/aquasecurity/aquasecurity",
|
"ProductArn": "arn:aws:securityhub:test-region::product/aquasecurity/aquasecurity",
|
||||||
"GeneratorId": "Trivy",
|
"GeneratorId": "Trivy/CVE-2019-1551",
|
||||||
"AwsAccountId": "123456789012",
|
"AwsAccountId": "123456789012",
|
||||||
"Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ],
|
"Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ],
|
||||||
"CreatedAt": "2020-08-10T07:28:17.000958601Z",
|
"CreatedAt": "2020-08-10T07:28:17.000958601Z",
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
"SchemaVersion": "2018-10-08",
|
"SchemaVersion": "2018-10-08",
|
||||||
"Id": "testdata/fixtures/images/alpine-310.tar.gz (alpine 3.10.2)/CVE-2019-1549",
|
"Id": "testdata/fixtures/images/alpine-310.tar.gz (alpine 3.10.2)/CVE-2019-1549",
|
||||||
"ProductArn": "arn:aws:securityhub:test-region::product/aquasecurity/aquasecurity",
|
"ProductArn": "arn:aws:securityhub:test-region::product/aquasecurity/aquasecurity",
|
||||||
"GeneratorId": "Trivy",
|
"GeneratorId": "Trivy/CVE-2019-1549",
|
||||||
"AwsAccountId": "123456789012",
|
"AwsAccountId": "123456789012",
|
||||||
"Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ],
|
"Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ],
|
||||||
"CreatedAt": "2020-08-10T07:28:17.000958601Z",
|
"CreatedAt": "2020-08-10T07:28:17.000958601Z",
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
"SchemaVersion": "2018-10-08",
|
"SchemaVersion": "2018-10-08",
|
||||||
"Id": "testdata/fixtures/images/alpine-310.tar.gz (alpine 3.10.2)/CVE-2019-1551",
|
"Id": "testdata/fixtures/images/alpine-310.tar.gz (alpine 3.10.2)/CVE-2019-1551",
|
||||||
"ProductArn": "arn:aws:securityhub:test-region::product/aquasecurity/aquasecurity",
|
"ProductArn": "arn:aws:securityhub:test-region::product/aquasecurity/aquasecurity",
|
||||||
"GeneratorId": "Trivy",
|
"GeneratorId": "Trivy/CVE-2019-1551",
|
||||||
"AwsAccountId": "123456789012",
|
"AwsAccountId": "123456789012",
|
||||||
"Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ],
|
"Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ],
|
||||||
"CreatedAt": "2020-08-10T07:28:17.000958601Z",
|
"CreatedAt": "2020-08-10T07:28:17.000958601Z",
|
||||||
|
|||||||
Reference in New Issue
Block a user