From 0d687d74a5f86eafcb843f26d54270c2ac75af41 Mon Sep 17 00:00:00 2001 From: AndrewCharlesHay Date: Thu, 25 Aug 2022 13:43:09 -0500 Subject: [PATCH 1/3] fix: update ProductArn with account id --- contrib/asff.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/asff.tpl b/contrib/asff.tpl index 46904464223..7b2ac4e6f2f 100644 --- a/contrib/asff.tpl +++ b/contrib/asff.tpl @@ -82,7 +82,7 @@ { "SchemaVersion": "2018-10-08", "Id": "{{ $target }}/{{ .ID }}", - "ProductArn": "arn:aws:securityhub:{{ env "AWS_REGION" }}::product/aquasecurity/aquasecurity", + "ProductArn": "arn:aws:securityhub:{{ env "AWS_REGION" }}:{{ env "AWS_ACCOUNT_ID" }}:product/{{ env "AWS_ACCOUNT_ID" }}/aquasecurity", "GeneratorId": "Trivy/{{ .ID }}", "AwsAccountId": "{{ env "AWS_ACCOUNT_ID" }}", "Types": [ "Software and Configuration Checks" ], From f02867238205dcb332ff1138aefafc838a1edc76 Mon Sep 17 00:00:00 2001 From: AndrewCharlesHay Date: Wed, 31 Aug 2022 13:34:48 -0500 Subject: [PATCH 2/3] fix: update arn to fix documentation better https://docs.aws.amazon.com/service-authorization/latest/reference/list_awssecurityhub.html --- contrib/asff.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/asff.tpl b/contrib/asff.tpl index 7b2ac4e6f2f..27c38185543 100644 --- a/contrib/asff.tpl +++ b/contrib/asff.tpl @@ -82,7 +82,7 @@ { "SchemaVersion": "2018-10-08", "Id": "{{ $target }}/{{ .ID }}", - "ProductArn": "arn:aws:securityhub:{{ env "AWS_REGION" }}:{{ env "AWS_ACCOUNT_ID" }}:product/{{ env "AWS_ACCOUNT_ID" }}/aquasecurity", + "ProductArn": "arn:aws:securityhub:{{ env "AWS_REGION" }}:{{ env "AWS_ACCOUNT_ID" }}:product/aquasecurity/trivy", "GeneratorId": "Trivy/{{ .ID }}", "AwsAccountId": "{{ env "AWS_ACCOUNT_ID" }}", "Types": [ "Software and Configuration Checks" ], From 3bbe513703136890306c5c74a013fc35ebdc9acc Mon Sep 17 00:00:00 2001 From: AndrewCharlesHay Date: Thu, 1 Sep 2022 14:17:40 -0500 Subject: [PATCH 3/3] docs: add product arn descripition --- docs/docs/integrations/aws-security-hub.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/docs/integrations/aws-security-hub.md b/docs/docs/integrations/aws-security-hub.md index 21a448bd0b3..6edb173c66b 100644 --- a/docs/docs/integrations/aws-security-hub.md +++ b/docs/docs/integrations/aws-security-hub.md @@ -10,6 +10,12 @@ $ AWS_REGION=us-west-1 AWS_ACCOUNT_ID=123456789012 trivy image --format template ASFF template needs AWS_REGION and AWS_ACCOUNT_ID from environment variables. +The Product [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) field follows the pattern below to match what AWS requires for the [product resource type](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awssecurityhub.html). + +``` +"ProductArn": "arn:aws:securityhub:{{ env "AWS_REGION" }}:{{ env "AWS_ACCOUNT_ID" }}:product/aquasecurity/trivy", +``` + Then, you can upload it with AWS CLI. ```