@fabasoad/sarif-to-slack 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yml +3 -1
- package/.github/workflows/send-sarif-to-slack.yml +214 -0
- package/.pre-commit-config.yaml +3 -3
- package/.tool-versions +1 -1
- package/Makefile +9 -2
- package/README.md +1 -1
- package/dist/Logger.js +15 -6
- package/dist/Processors.js +2 -32
- package/dist/SarifToSlackService.d.ts.map +1 -1
- package/dist/SarifToSlackService.js +13 -6
- package/dist/SlackMessageBuilder.js +46 -52
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/model/SarifModelPerRun.d.ts +2 -0
- package/dist/model/SarifModelPerRun.d.ts.map +1 -0
- package/dist/model/SarifModelPerRun.js +90 -0
- package/dist/model/SarifModelPerSarif.d.ts +2 -0
- package/dist/model/SarifModelPerSarif.d.ts.map +1 -0
- package/dist/model/SarifModelPerSarif.js +102 -0
- package/dist/model/types.d.ts +2 -0
- package/dist/model/types.d.ts.map +1 -0
- package/dist/model/types.js +49 -0
- package/dist/sarif-to-slack.d.ts +96 -12
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/types.d.ts +87 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +66 -9
- package/dist/utils/SarifUtils.d.ts +2 -0
- package/dist/utils/SarifUtils.d.ts.map +1 -0
- package/dist/utils/SarifUtils.js +46 -0
- package/dist/utils/SortUtils.d.ts +2 -0
- package/dist/utils/SortUtils.d.ts.map +1 -0
- package/dist/utils/SortUtils.js +20 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +11 -4
- package/etc/sarif-to-slack.api.md +32 -7
- package/jest.config.json +4 -4
- package/package.json +9 -7
- package/scripts/save-version.sh +9 -2
- package/src/Logger.ts +20 -17
- package/src/Processors.ts +1 -33
- package/src/SarifToSlackService.ts +13 -6
- package/src/SlackMessageBuilder.ts +78 -63
- package/src/index.ts +16 -6
- package/src/model/SarifModelPerRun.ts +120 -0
- package/src/model/SarifModelPerSarif.ts +126 -0
- package/src/model/types.ts +50 -0
- package/src/types.ts +91 -11
- package/src/utils/SarifUtils.ts +62 -0
- package/src/utils/SortUtils.ts +33 -0
- package/src/version.ts +10 -3
- package/test-data/sarif/codeql-csharp.sarif +1 -0
- package/test-data/sarif/codeql-go.sarif +1 -0
- package/test-data/sarif/codeql-python.sarif +1 -0
- package/test-data/sarif/codeql-ruby.sarif +1 -0
- package/test-data/sarif/codeql-typescript.sarif +1 -0
- package/test-data/sarif/grype-container.sarif +1774 -0
- package/test-data/sarif/runs-1-tools-1-results-0.sarif +18 -0
- package/test-data/sarif/runs-2-tools-1-results-0.sarif +30 -0
- package/test-data/sarif/runs-2-tools-1.sarif +656 -0
- package/test-data/sarif/runs-2-tools-2-results-0.sarif +44 -0
- package/test-data/sarif/runs-2-tools-2.sarif +686 -0
- package/test-data/sarif/runs-3-tools-2-results-0.sarif +48 -0
- package/test-data/sarif/runs-3-tools-2.sarif +278 -0
- package/test-data/sarif/snyk-composer.sarif +934 -0
- package/test-data/sarif/snyk-container.sarif +313 -0
- package/test-data/sarif/snyk-gomodules.sarif +388 -0
- package/test-data/sarif/snyk-gradle.sarif +274 -0
- package/test-data/sarif/snyk-hex.sarif +66 -0
- package/test-data/sarif/snyk-maven.sarif +274 -0
- package/test-data/sarif/snyk-npm.sarif +896 -0
- package/test-data/sarif/snyk-nuget.sarif +90 -0
- package/test-data/sarif/snyk-pip.sarif +66 -0
- package/test-data/sarif/snyk-pnpm.sarif +90 -0
- package/test-data/sarif/snyk-poetry.sarif +1952 -0
- package/test-data/sarif/snyk-rubygems.sarif +440 -0
- package/test-data/sarif/snyk-sbt.sarif +178 -0
- package/test-data/sarif/snyk-swift.sarif +112 -0
- package/test-data/sarif/snyk-yarn.sarif +2900 -0
- package/test-data/sarif/trivy-iac.sarif +134 -0
- package/test-data/sarif/wiz-container.sarif +30916 -0
- package/test-data/sarif/wiz-iac.sarif +558 -0
- package/tests/Processors.spec.ts +3 -42
- package/tests/integration/SendSarifToSlack.spec.ts +80 -0
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.1.0",
|
|
3
|
+
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/main/sarif-2.1/schema/sarif-schema-2.1.0.json",
|
|
4
|
+
"runs": [
|
|
5
|
+
{
|
|
6
|
+
"tool": {
|
|
7
|
+
"driver": {
|
|
8
|
+
"fullName": "Wiz CLI",
|
|
9
|
+
"informationUri": "https://wiz.io",
|
|
10
|
+
"name": "WizCLI",
|
|
11
|
+
"releaseDateUtc": "2025-05-07T07:47:28Z",
|
|
12
|
+
"rules": [
|
|
13
|
+
{
|
|
14
|
+
"id": "iac-misconfiguration-de273ea2-a754-55f3-b23e-cb9156444fcd",
|
|
15
|
+
"name": "Terraform",
|
|
16
|
+
"shortDescription": {
|
|
17
|
+
"text": "Elastic Beanstalk Application environment logs should be published to CloudWatch"
|
|
18
|
+
},
|
|
19
|
+
"fullDescription": {
|
|
20
|
+
"text": "Elastic Beanstalk Application environment logs should be published to CloudWatch"
|
|
21
|
+
},
|
|
22
|
+
"defaultConfiguration": {
|
|
23
|
+
"level": "note"
|
|
24
|
+
},
|
|
25
|
+
"help": {
|
|
26
|
+
"text": "Description: Elastic Beanstalk Application environment logs should be published to CloudWatch\nPath: terraform/main.tf\nLine number: 32\nFile type: Terraform\nMatch content: setting {\nExpected: 'aws_elastic_beanstalk_environment[default].setting' - 'StreamLogs' should be set to 'true'\nFound: 'aws_elastic_beanstalk_environment[default].setting' - 'StreamLogs' is set to 'false' or undfined\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)",
|
|
27
|
+
"markdown": "**Elastic Beanstalk Application environment logs should be published to CloudWatch**\n| Path | Line number | File type | Match content | Expected | Found |\n| --- | --- | --- | --- | --- | --- |\n|`terraform/main.tf`|`32`|`Terraform`|` setting {`|`'aws_elastic_beanstalk_environment[default].setting' - 'StreamLogs' should be set to 'true'`|`'aws_elastic_beanstalk_environment[default].setting' - 'StreamLogs' is set to 'false' or undfined`|\n**Remediation instructions:**\n```\nPlease refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)\n```"
|
|
28
|
+
},
|
|
29
|
+
"properties": {
|
|
30
|
+
"precision": "very-high",
|
|
31
|
+
"security-severity": "2.0",
|
|
32
|
+
"tags": [
|
|
33
|
+
"iac-misconfiguration",
|
|
34
|
+
"security",
|
|
35
|
+
"low"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "iac-misconfiguration-53ea8bc0-2d4e-5936-8279-36127e1e33a8",
|
|
41
|
+
"name": "Terraform",
|
|
42
|
+
"shortDescription": {
|
|
43
|
+
"text": "Elastic Beanstalk Application environment logs should be uploaded to S3"
|
|
44
|
+
},
|
|
45
|
+
"fullDescription": {
|
|
46
|
+
"text": "Elastic Beanstalk Application environment logs should be uploaded to S3"
|
|
47
|
+
},
|
|
48
|
+
"defaultConfiguration": {
|
|
49
|
+
"level": "note"
|
|
50
|
+
},
|
|
51
|
+
"help": {
|
|
52
|
+
"text": "Description: Elastic Beanstalk Application environment logs should be uploaded to S3\nPath: terraform/main.tf\nLine number: 32\nFile type: Terraform\nMatch content: setting {\nExpected: 'aws_elastic_beanstalk_environment[default].setting' - 'LogPublicationControl' or 'StreamLogs' should be set to 'true'\nFound: 'aws_elastic_beanstalk_environment[default].setting' - 'LogPublicationControl' or 'StreamLogs' are set to 'false' or undfined (defaults to 'false')\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)",
|
|
53
|
+
"markdown": "**Elastic Beanstalk Application environment logs should be uploaded to S3**\n| Path | Line number | File type | Match content | Expected | Found |\n| --- | --- | --- | --- | --- | --- |\n|`terraform/main.tf`|`32`|`Terraform`|` setting {`|`'aws_elastic_beanstalk_environment[default].setting' - 'LogPublicationControl' or 'StreamLogs' should be set to 'true'`|`'aws_elastic_beanstalk_environment[default].setting' - 'LogPublicationControl' or 'StreamLogs' are set to 'false' or undfined (defaults to 'false')`|\n**Remediation instructions:**\n```\nPlease refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)\n```"
|
|
54
|
+
},
|
|
55
|
+
"properties": {
|
|
56
|
+
"precision": "very-high",
|
|
57
|
+
"security-severity": "2.0",
|
|
58
|
+
"tags": [
|
|
59
|
+
"iac-misconfiguration",
|
|
60
|
+
"security",
|
|
61
|
+
"low"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "iac-misconfiguration-cc0c6b31-cb0e-5b40-84f6-6ac88bf1b2e3",
|
|
67
|
+
"name": "Terraform",
|
|
68
|
+
"shortDescription": {
|
|
69
|
+
"text": "Elastic Beanstalk Application environment notifications should be configured"
|
|
70
|
+
},
|
|
71
|
+
"fullDescription": {
|
|
72
|
+
"text": "Elastic Beanstalk Application environment notifications should be configured"
|
|
73
|
+
},
|
|
74
|
+
"defaultConfiguration": {
|
|
75
|
+
"level": "note"
|
|
76
|
+
},
|
|
77
|
+
"help": {
|
|
78
|
+
"text": "Description: Elastic Beanstalk Application environment notifications should be configured\nPath: terraform/main.tf\nLine number: 26\nFile type: Terraform\nMatch content: resource \"aws_elastic_beanstalk_environment\" \"default\" {\nExpected: 'aws_elastic_beanstalk_environment[default].setting' - 'notification endpoint' value should not be 'null'\nFound: 'aws_elastic_beanstalk_environment[default].setting' - 'notification endpoint' value is 'null' or undefined\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)",
|
|
79
|
+
"markdown": "**Elastic Beanstalk Application environment notifications should be configured**\n| Path | Line number | File type | Match content | Expected | Found |\n| --- | --- | --- | --- | --- | --- |\n|`terraform/main.tf`|`26`|`Terraform`|`resource \"aws_elastic_beanstalk_environment\" \"default\" {`|`'aws_elastic_beanstalk_environment[default].setting' - 'notification endpoint' value should not be 'null'`|`'aws_elastic_beanstalk_environment[default].setting' - 'notification endpoint' value is 'null' or undefined`|\n**Remediation instructions:**\n```\nPlease refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)\n```"
|
|
80
|
+
},
|
|
81
|
+
"properties": {
|
|
82
|
+
"precision": "very-high",
|
|
83
|
+
"security-severity": "2.0",
|
|
84
|
+
"tags": [
|
|
85
|
+
"iac-misconfiguration",
|
|
86
|
+
"security",
|
|
87
|
+
"low"
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "iac-misconfiguration-76e64733-0707-5cf6-af42-fb3096121d13",
|
|
93
|
+
"name": "Terraform",
|
|
94
|
+
"shortDescription": {
|
|
95
|
+
"text": "S3 Bucket logging should be enabled"
|
|
96
|
+
},
|
|
97
|
+
"fullDescription": {
|
|
98
|
+
"text": "S3 Bucket logging should be enabled"
|
|
99
|
+
},
|
|
100
|
+
"defaultConfiguration": {
|
|
101
|
+
"level": "note"
|
|
102
|
+
},
|
|
103
|
+
"help": {
|
|
104
|
+
"text": "Description: S3 Bucket logging should be enabled\nPath: terraform/s3.tf\nLine number: 16\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket\" \"business_card_bucket\" {\nExpected: aws_s3_bucket[business_card_bucket] logging should be enabled\nFound: aws_s3_bucket[business_card_bucket] logging is disabled\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket), [aws_s3_bucket_logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_logging)",
|
|
105
|
+
"markdown": "**S3 Bucket logging should be enabled**\n| Path | Line number | File type | Match content | Expected | Found |\n| --- | --- | --- | --- | --- | --- |\n|`terraform/s3.tf`|`16`|`Terraform`|`resource \"aws_s3_bucket\" \"business_card_bucket\" {`|`aws_s3_bucket[business_card_bucket] logging should be enabled`|`aws_s3_bucket[business_card_bucket] logging is disabled`|\n**Remediation instructions:**\n```\nPlease refer to the following Terraform documentation for configuration details: [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket), [aws_s3_bucket_logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_logging)\n```"
|
|
106
|
+
},
|
|
107
|
+
"properties": {
|
|
108
|
+
"precision": "very-high",
|
|
109
|
+
"security-severity": "2.0",
|
|
110
|
+
"tags": [
|
|
111
|
+
"iac-misconfiguration",
|
|
112
|
+
"security",
|
|
113
|
+
"low"
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "iac-misconfiguration-15f1e43f-0484-54bc-b491-7c889407357b",
|
|
119
|
+
"name": "Terraform",
|
|
120
|
+
"shortDescription": {
|
|
121
|
+
"text": "S3 Bucket object lock should be enabled"
|
|
122
|
+
},
|
|
123
|
+
"fullDescription": {
|
|
124
|
+
"text": "S3 Bucket object lock should be enabled"
|
|
125
|
+
},
|
|
126
|
+
"defaultConfiguration": {
|
|
127
|
+
"level": "note"
|
|
128
|
+
},
|
|
129
|
+
"help": {
|
|
130
|
+
"text": "Description: S3 Bucket object lock should be enabled\nPath: terraform/s3.tf\nLine number: 16\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket\" \"business_card_bucket\" {\nExpected: 'aws_s3_bucket[business_card_bucket]' object lock should be enabled\nFound: 'aws_s3_bucket[business_card_bucket]' object lock is disabled\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_s3_bucket_object_lock_configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_object_lock_configuration), [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket)",
|
|
131
|
+
"markdown": "**S3 Bucket object lock should be enabled**\n| Path | Line number | File type | Match content | Expected | Found |\n| --- | --- | --- | --- | --- | --- |\n|`terraform/s3.tf`|`16`|`Terraform`|`resource \"aws_s3_bucket\" \"business_card_bucket\" {`|`'aws_s3_bucket[business_card_bucket]' object lock should be enabled`|`'aws_s3_bucket[business_card_bucket]' object lock is disabled`|\n**Remediation instructions:**\n```\nPlease refer to the following Terraform documentation for configuration details: [aws_s3_bucket_object_lock_configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_object_lock_configuration), [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket)\n```"
|
|
132
|
+
},
|
|
133
|
+
"properties": {
|
|
134
|
+
"precision": "very-high",
|
|
135
|
+
"security-severity": "2.0",
|
|
136
|
+
"tags": [
|
|
137
|
+
"iac-misconfiguration",
|
|
138
|
+
"security",
|
|
139
|
+
"low"
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "iac-misconfiguration-7c90319d-a276-55b2-9c00-c431b3b7ab17",
|
|
145
|
+
"name": "Terraform",
|
|
146
|
+
"shortDescription": {
|
|
147
|
+
"text": "Elastic Beanstalk Application environment should capture load balancer access logs"
|
|
148
|
+
},
|
|
149
|
+
"fullDescription": {
|
|
150
|
+
"text": "Elastic Beanstalk Application environment should capture load balancer access logs"
|
|
151
|
+
},
|
|
152
|
+
"defaultConfiguration": {
|
|
153
|
+
"level": "warning"
|
|
154
|
+
},
|
|
155
|
+
"help": {
|
|
156
|
+
"text": "Description: Elastic Beanstalk Application environment should capture load balancer access logs\nPath: terraform/main.tf\nLine number: 26\nFile type: Terraform\nMatch content: resource \"aws_elastic_beanstalk_environment\" \"default\" {\nExpected: 'aws_elastic_beanstalk_environment[default].setting' - 'AccessLogsS3Enabled' should be defined and set to 'true'\nFound: 'aws_elastic_beanstalk_environment[default].setting' - 'AccessLogsS3Enabled' is undefined or set to 'false'\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)",
|
|
157
|
+
"markdown": "**Elastic Beanstalk Application environment should capture load balancer access logs**\n| Path | Line number | File type | Match content | Expected | Found |\n| --- | --- | --- | --- | --- | --- |\n|`terraform/main.tf`|`26`|`Terraform`|`resource \"aws_elastic_beanstalk_environment\" \"default\" {`|`'aws_elastic_beanstalk_environment[default].setting' - 'AccessLogsS3Enabled' should be defined and set to 'true'`|`'aws_elastic_beanstalk_environment[default].setting' - 'AccessLogsS3Enabled' is undefined or set to 'false'`|\n**Remediation instructions:**\n```\nPlease refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)\n```"
|
|
158
|
+
},
|
|
159
|
+
"properties": {
|
|
160
|
+
"precision": "very-high",
|
|
161
|
+
"security-severity": "4.0",
|
|
162
|
+
"tags": [
|
|
163
|
+
"iac-misconfiguration",
|
|
164
|
+
"security",
|
|
165
|
+
"medium"
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"id": "iac-misconfiguration-7c8b46ea-b136-53a6-afdd-0545413541ac",
|
|
171
|
+
"name": "Terraform",
|
|
172
|
+
"shortDescription": {
|
|
173
|
+
"text": "S3 Bucket Object should be encrypted with a customer-managed key"
|
|
174
|
+
},
|
|
175
|
+
"fullDescription": {
|
|
176
|
+
"text": "S3 Bucket Object should be encrypted with a customer-managed key"
|
|
177
|
+
},
|
|
178
|
+
"defaultConfiguration": {
|
|
179
|
+
"level": "warning"
|
|
180
|
+
},
|
|
181
|
+
"help": {
|
|
182
|
+
"text": "Description: S3 Bucket Object should be encrypted with a customer-managed key\nPath: terraform/s3.tf\nLine number: 46\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket_object\" \"business_card_payload\" {\nExpected: 'aws_s3_bucket_object[business_card_payload].kms_key_id' should be defined\nFound: 'aws_s3_bucket_object[business_card_payload].kms_key_id' is undefined",
|
|
183
|
+
"markdown": "**S3 Bucket Object should be encrypted with a customer-managed key**\n| Path | Line number | File type | Match content | Expected | Found |\n| --- | --- | --- | --- | --- | --- |\n|`terraform/s3.tf`|`46`|`Terraform`|`resource \"aws_s3_bucket_object\" \"business_card_payload\" {`|`'aws_s3_bucket_object[business_card_payload].kms_key_id' should be defined`|`'aws_s3_bucket_object[business_card_payload].kms_key_id' is undefined`|"
|
|
184
|
+
},
|
|
185
|
+
"properties": {
|
|
186
|
+
"precision": "very-high",
|
|
187
|
+
"security-severity": "4.0",
|
|
188
|
+
"tags": [
|
|
189
|
+
"iac-misconfiguration",
|
|
190
|
+
"security",
|
|
191
|
+
"medium"
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"id": "iac-misconfiguration-1fba338c-b55c-5058-b5bd-74cd6a55dec0",
|
|
197
|
+
"name": "Terraform",
|
|
198
|
+
"shortDescription": {
|
|
199
|
+
"text": "S3 Bucket policy should deny HTTP requests"
|
|
200
|
+
},
|
|
201
|
+
"fullDescription": {
|
|
202
|
+
"text": "S3 Bucket policy should deny HTTP requests"
|
|
203
|
+
},
|
|
204
|
+
"defaultConfiguration": {
|
|
205
|
+
"level": "warning"
|
|
206
|
+
},
|
|
207
|
+
"help": {
|
|
208
|
+
"text": "Description: S3 Bucket policy should deny HTTP requests\nPath: terraform/s3.tf\nLine number: 16\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket\" \"business_card_bucket\" {\nExpected: 'aws_s3_bucket[business_card_bucket]' should deny unseucre HTTP requesets\nFound: 'aws_s3_bucket[business_card_bucket]' does not explicitly deny HTTP requesets for all actions for all principals\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_s3_bucket_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy), [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket)",
|
|
209
|
+
"markdown": "**S3 Bucket policy should deny HTTP requests**\n| Path | Line number | File type | Match content | Expected | Found |\n| --- | --- | --- | --- | --- | --- |\n|`terraform/s3.tf`|`16`|`Terraform`|`resource \"aws_s3_bucket\" \"business_card_bucket\" {`|`'aws_s3_bucket[business_card_bucket]' should deny unseucre HTTP requesets`|`'aws_s3_bucket[business_card_bucket]' does not explicitly deny HTTP requesets for all actions for all principals`|\n**Remediation instructions:**\n```\nPlease refer to the following Terraform documentation for configuration details: [aws_s3_bucket_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy), [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket)\n```"
|
|
210
|
+
},
|
|
211
|
+
"properties": {
|
|
212
|
+
"precision": "very-high",
|
|
213
|
+
"security-severity": "4.0",
|
|
214
|
+
"tags": [
|
|
215
|
+
"iac-misconfiguration",
|
|
216
|
+
"security",
|
|
217
|
+
"medium"
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"id": "iac-misconfiguration-7a5edaa9-d012-593f-af05-59a981d0acaf",
|
|
223
|
+
"name": "Terraform",
|
|
224
|
+
"shortDescription": {
|
|
225
|
+
"text": "S3 Bucket should be encrypted with a customer-managed key"
|
|
226
|
+
},
|
|
227
|
+
"fullDescription": {
|
|
228
|
+
"text": "S3 Bucket should be encrypted with a customer-managed key"
|
|
229
|
+
},
|
|
230
|
+
"defaultConfiguration": {
|
|
231
|
+
"level": "warning"
|
|
232
|
+
},
|
|
233
|
+
"help": {
|
|
234
|
+
"text": "Description: S3 Bucket should be encrypted with a customer-managed key\nPath: terraform/s3.tf\nLine number: 16\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket\" \"business_card_bucket\" {\nExpected: 'aws_s3_bucket[business_card_bucket]' should be encrypted using a customer-provided key\nFound: 'aws_s3_bucket[business_card_bucket]' is not encrypted using a customer-provided key\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket), [aws_s3_bucket_server_side_encryption_configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration)",
|
|
235
|
+
"markdown": "**S3 Bucket should be encrypted with a customer-managed key**\n| Path | Line number | File type | Match content | Expected | Found |\n| --- | --- | --- | --- | --- | --- |\n|`terraform/s3.tf`|`16`|`Terraform`|`resource \"aws_s3_bucket\" \"business_card_bucket\" {`|`'aws_s3_bucket[business_card_bucket]' should be encrypted using a customer-provided key`|`'aws_s3_bucket[business_card_bucket]' is not encrypted using a customer-provided key`|\n**Remediation instructions:**\n```\nPlease refer to the following Terraform documentation for configuration details: [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket), [aws_s3_bucket_server_side_encryption_configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration)\n```"
|
|
236
|
+
},
|
|
237
|
+
"properties": {
|
|
238
|
+
"precision": "very-high",
|
|
239
|
+
"security-severity": "4.0",
|
|
240
|
+
"tags": [
|
|
241
|
+
"iac-misconfiguration",
|
|
242
|
+
"security",
|
|
243
|
+
"medium"
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"id": "iac-misconfiguration-318a4140-b09e-5bbe-a350-210f0effbc0c",
|
|
249
|
+
"name": "Terraform",
|
|
250
|
+
"shortDescription": {
|
|
251
|
+
"text": "S3 Bucket should have at least one replication rule enabled"
|
|
252
|
+
},
|
|
253
|
+
"fullDescription": {
|
|
254
|
+
"text": "S3 Bucket should have at least one replication rule enabled"
|
|
255
|
+
},
|
|
256
|
+
"defaultConfiguration": {
|
|
257
|
+
"level": "warning"
|
|
258
|
+
},
|
|
259
|
+
"help": {
|
|
260
|
+
"text": "Description: S3 Bucket should have at least one replication rule enabled\nPath: terraform/s3.tf\nLine number: 16\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket\" \"business_card_bucket\" {\nExpected: aws_s3_bucket[business_card_bucket] should have at least one replication rule enabled\nFound: aws_s3_bucket[business_card_bucket] does not have an enabled replication rule\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket), [aws_s3_bucket_replication_configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_replication_configuration)",
|
|
261
|
+
"markdown": "**S3 Bucket should have at least one replication rule enabled**\n| Path | Line number | File type | Match content | Expected | Found |\n| --- | --- | --- | --- | --- | --- |\n|`terraform/s3.tf`|`16`|`Terraform`|`resource \"aws_s3_bucket\" \"business_card_bucket\" {`|`aws_s3_bucket[business_card_bucket] should have at least one replication rule enabled`|`aws_s3_bucket[business_card_bucket] does not have an enabled replication rule`|\n**Remediation instructions:**\n```\nPlease refer to the following Terraform documentation for configuration details: [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket), [aws_s3_bucket_replication_configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_replication_configuration)\n```"
|
|
262
|
+
},
|
|
263
|
+
"properties": {
|
|
264
|
+
"precision": "very-high",
|
|
265
|
+
"security-severity": "4.0",
|
|
266
|
+
"tags": [
|
|
267
|
+
"iac-misconfiguration",
|
|
268
|
+
"security",
|
|
269
|
+
"medium"
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
],
|
|
274
|
+
"semanticVersion": "0.83.0",
|
|
275
|
+
"version": "0.83.0-82ebf93"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"results": [
|
|
279
|
+
{
|
|
280
|
+
"ruleId": "iac-misconfiguration-de273ea2-a754-55f3-b23e-cb9156444fcd",
|
|
281
|
+
"ruleIndex": 0,
|
|
282
|
+
"level": "note",
|
|
283
|
+
"message": {
|
|
284
|
+
"text": "Description: Elastic Beanstalk Application environment logs should be published to CloudWatch\nPath: terraform/main.tf\nLine number: 32\nFile type: Terraform\nMatch content: setting {\nExpected: 'aws_elastic_beanstalk_environment[default].setting' - 'StreamLogs' should be set to 'true'\nFound: 'aws_elastic_beanstalk_environment[default].setting' - 'StreamLogs' is set to 'false' or undfined\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)"
|
|
285
|
+
},
|
|
286
|
+
"locations": [
|
|
287
|
+
{
|
|
288
|
+
"physicalLocation": {
|
|
289
|
+
"artifactLocation": {
|
|
290
|
+
"uri": "terraform/main.tf",
|
|
291
|
+
"uriBaseId": "ROOTPATH"
|
|
292
|
+
},
|
|
293
|
+
"region": {
|
|
294
|
+
"startLine": 32,
|
|
295
|
+
"startColumn": 1,
|
|
296
|
+
"endLine": 32,
|
|
297
|
+
"endColumn": 1
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
"message": {
|
|
301
|
+
"text": "terraform/main.tf"
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"ruleId": "iac-misconfiguration-53ea8bc0-2d4e-5936-8279-36127e1e33a8",
|
|
308
|
+
"ruleIndex": 1,
|
|
309
|
+
"level": "note",
|
|
310
|
+
"message": {
|
|
311
|
+
"text": "Description: Elastic Beanstalk Application environment logs should be uploaded to S3\nPath: terraform/main.tf\nLine number: 32\nFile type: Terraform\nMatch content: setting {\nExpected: 'aws_elastic_beanstalk_environment[default].setting' - 'LogPublicationControl' or 'StreamLogs' should be set to 'true'\nFound: 'aws_elastic_beanstalk_environment[default].setting' - 'LogPublicationControl' or 'StreamLogs' are set to 'false' or undfined (defaults to 'false')\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)"
|
|
312
|
+
},
|
|
313
|
+
"locations": [
|
|
314
|
+
{
|
|
315
|
+
"physicalLocation": {
|
|
316
|
+
"artifactLocation": {
|
|
317
|
+
"uri": "terraform/main.tf",
|
|
318
|
+
"uriBaseId": "ROOTPATH"
|
|
319
|
+
},
|
|
320
|
+
"region": {
|
|
321
|
+
"startLine": 32,
|
|
322
|
+
"startColumn": 1,
|
|
323
|
+
"endLine": 32,
|
|
324
|
+
"endColumn": 1
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"message": {
|
|
328
|
+
"text": "terraform/main.tf"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
]
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"ruleId": "iac-misconfiguration-cc0c6b31-cb0e-5b40-84f6-6ac88bf1b2e3",
|
|
335
|
+
"ruleIndex": 2,
|
|
336
|
+
"level": "note",
|
|
337
|
+
"message": {
|
|
338
|
+
"text": "Description: Elastic Beanstalk Application environment notifications should be configured\nPath: terraform/main.tf\nLine number: 26\nFile type: Terraform\nMatch content: resource \"aws_elastic_beanstalk_environment\" \"default\" {\nExpected: 'aws_elastic_beanstalk_environment[default].setting' - 'notification endpoint' value should not be 'null'\nFound: 'aws_elastic_beanstalk_environment[default].setting' - 'notification endpoint' value is 'null' or undefined\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)"
|
|
339
|
+
},
|
|
340
|
+
"locations": [
|
|
341
|
+
{
|
|
342
|
+
"physicalLocation": {
|
|
343
|
+
"artifactLocation": {
|
|
344
|
+
"uri": "terraform/main.tf",
|
|
345
|
+
"uriBaseId": "ROOTPATH"
|
|
346
|
+
},
|
|
347
|
+
"region": {
|
|
348
|
+
"startLine": 26,
|
|
349
|
+
"startColumn": 1,
|
|
350
|
+
"endLine": 26,
|
|
351
|
+
"endColumn": 1
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
"message": {
|
|
355
|
+
"text": "terraform/main.tf"
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
]
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"ruleId": "iac-misconfiguration-76e64733-0707-5cf6-af42-fb3096121d13",
|
|
362
|
+
"ruleIndex": 3,
|
|
363
|
+
"level": "note",
|
|
364
|
+
"message": {
|
|
365
|
+
"text": "Description: S3 Bucket logging should be enabled\nPath: terraform/s3.tf\nLine number: 16\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket\" \"business_card_bucket\" {\nExpected: aws_s3_bucket[business_card_bucket] logging should be enabled\nFound: aws_s3_bucket[business_card_bucket] logging is disabled\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket), [aws_s3_bucket_logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_logging)"
|
|
366
|
+
},
|
|
367
|
+
"locations": [
|
|
368
|
+
{
|
|
369
|
+
"physicalLocation": {
|
|
370
|
+
"artifactLocation": {
|
|
371
|
+
"uri": "terraform/s3.tf",
|
|
372
|
+
"uriBaseId": "ROOTPATH"
|
|
373
|
+
},
|
|
374
|
+
"region": {
|
|
375
|
+
"startLine": 16,
|
|
376
|
+
"startColumn": 1,
|
|
377
|
+
"endLine": 16,
|
|
378
|
+
"endColumn": 1
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
"message": {
|
|
382
|
+
"text": "terraform/s3.tf"
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
]
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"ruleId": "iac-misconfiguration-15f1e43f-0484-54bc-b491-7c889407357b",
|
|
389
|
+
"ruleIndex": 4,
|
|
390
|
+
"level": "note",
|
|
391
|
+
"message": {
|
|
392
|
+
"text": "Description: S3 Bucket object lock should be enabled\nPath: terraform/s3.tf\nLine number: 16\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket\" \"business_card_bucket\" {\nExpected: 'aws_s3_bucket[business_card_bucket]' object lock should be enabled\nFound: 'aws_s3_bucket[business_card_bucket]' object lock is disabled\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_s3_bucket_object_lock_configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_object_lock_configuration), [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket)"
|
|
393
|
+
},
|
|
394
|
+
"locations": [
|
|
395
|
+
{
|
|
396
|
+
"physicalLocation": {
|
|
397
|
+
"artifactLocation": {
|
|
398
|
+
"uri": "terraform/s3.tf",
|
|
399
|
+
"uriBaseId": "ROOTPATH"
|
|
400
|
+
},
|
|
401
|
+
"region": {
|
|
402
|
+
"startLine": 16,
|
|
403
|
+
"startColumn": 1,
|
|
404
|
+
"endLine": 16,
|
|
405
|
+
"endColumn": 1
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
"message": {
|
|
409
|
+
"text": "terraform/s3.tf"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
]
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"ruleId": "iac-misconfiguration-7c90319d-a276-55b2-9c00-c431b3b7ab17",
|
|
416
|
+
"ruleIndex": 5,
|
|
417
|
+
"level": "warning",
|
|
418
|
+
"message": {
|
|
419
|
+
"text": "Description: Elastic Beanstalk Application environment should capture load balancer access logs\nPath: terraform/main.tf\nLine number: 26\nFile type: Terraform\nMatch content: resource \"aws_elastic_beanstalk_environment\" \"default\" {\nExpected: 'aws_elastic_beanstalk_environment[default].setting' - 'AccessLogsS3Enabled' should be defined and set to 'true'\nFound: 'aws_elastic_beanstalk_environment[default].setting' - 'AccessLogsS3Enabled' is undefined or set to 'false'\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_elastic_beanstalk_environment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_environment)"
|
|
420
|
+
},
|
|
421
|
+
"locations": [
|
|
422
|
+
{
|
|
423
|
+
"physicalLocation": {
|
|
424
|
+
"artifactLocation": {
|
|
425
|
+
"uri": "terraform/main.tf",
|
|
426
|
+
"uriBaseId": "ROOTPATH"
|
|
427
|
+
},
|
|
428
|
+
"region": {
|
|
429
|
+
"startLine": 26,
|
|
430
|
+
"startColumn": 1,
|
|
431
|
+
"endLine": 26,
|
|
432
|
+
"endColumn": 1
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
"message": {
|
|
436
|
+
"text": "terraform/main.tf"
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
]
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"ruleId": "iac-misconfiguration-7c8b46ea-b136-53a6-afdd-0545413541ac",
|
|
443
|
+
"ruleIndex": 6,
|
|
444
|
+
"level": "warning",
|
|
445
|
+
"message": {
|
|
446
|
+
"text": "Description: S3 Bucket Object should be encrypted with a customer-managed key\nPath: terraform/s3.tf\nLine number: 46\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket_object\" \"business_card_payload\" {\nExpected: 'aws_s3_bucket_object[business_card_payload].kms_key_id' should be defined\nFound: 'aws_s3_bucket_object[business_card_payload].kms_key_id' is undefined"
|
|
447
|
+
},
|
|
448
|
+
"locations": [
|
|
449
|
+
{
|
|
450
|
+
"physicalLocation": {
|
|
451
|
+
"artifactLocation": {
|
|
452
|
+
"uri": "terraform/s3.tf",
|
|
453
|
+
"uriBaseId": "ROOTPATH"
|
|
454
|
+
},
|
|
455
|
+
"region": {
|
|
456
|
+
"startLine": 46,
|
|
457
|
+
"startColumn": 1,
|
|
458
|
+
"endLine": 46,
|
|
459
|
+
"endColumn": 1
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
"message": {
|
|
463
|
+
"text": "terraform/s3.tf"
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
]
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"ruleId": "iac-misconfiguration-1fba338c-b55c-5058-b5bd-74cd6a55dec0",
|
|
470
|
+
"ruleIndex": 7,
|
|
471
|
+
"level": "warning",
|
|
472
|
+
"message": {
|
|
473
|
+
"text": "Description: S3 Bucket policy should deny HTTP requests\nPath: terraform/s3.tf\nLine number: 16\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket\" \"business_card_bucket\" {\nExpected: 'aws_s3_bucket[business_card_bucket]' should deny unseucre HTTP requesets\nFound: 'aws_s3_bucket[business_card_bucket]' does not explicitly deny HTTP requesets for all actions for all principals\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_s3_bucket_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy), [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket)"
|
|
474
|
+
},
|
|
475
|
+
"locations": [
|
|
476
|
+
{
|
|
477
|
+
"physicalLocation": {
|
|
478
|
+
"artifactLocation": {
|
|
479
|
+
"uri": "terraform/s3.tf",
|
|
480
|
+
"uriBaseId": "ROOTPATH"
|
|
481
|
+
},
|
|
482
|
+
"region": {
|
|
483
|
+
"startLine": 16,
|
|
484
|
+
"startColumn": 1,
|
|
485
|
+
"endLine": 16,
|
|
486
|
+
"endColumn": 1
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
"message": {
|
|
490
|
+
"text": "terraform/s3.tf"
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
]
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"ruleId": "iac-misconfiguration-7a5edaa9-d012-593f-af05-59a981d0acaf",
|
|
497
|
+
"ruleIndex": 8,
|
|
498
|
+
"level": "warning",
|
|
499
|
+
"message": {
|
|
500
|
+
"text": "Description: S3 Bucket should be encrypted with a customer-managed key\nPath: terraform/s3.tf\nLine number: 16\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket\" \"business_card_bucket\" {\nExpected: 'aws_s3_bucket[business_card_bucket]' should be encrypted using a customer-provided key\nFound: 'aws_s3_bucket[business_card_bucket]' is not encrypted using a customer-provided key\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket), [aws_s3_bucket_server_side_encryption_configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration)"
|
|
501
|
+
},
|
|
502
|
+
"locations": [
|
|
503
|
+
{
|
|
504
|
+
"physicalLocation": {
|
|
505
|
+
"artifactLocation": {
|
|
506
|
+
"uri": "terraform/s3.tf",
|
|
507
|
+
"uriBaseId": "ROOTPATH"
|
|
508
|
+
},
|
|
509
|
+
"region": {
|
|
510
|
+
"startLine": 16,
|
|
511
|
+
"startColumn": 1,
|
|
512
|
+
"endLine": 16,
|
|
513
|
+
"endColumn": 1
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
"message": {
|
|
517
|
+
"text": "terraform/s3.tf"
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
]
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
"ruleId": "iac-misconfiguration-318a4140-b09e-5bbe-a350-210f0effbc0c",
|
|
524
|
+
"ruleIndex": 9,
|
|
525
|
+
"level": "warning",
|
|
526
|
+
"message": {
|
|
527
|
+
"text": "Description: S3 Bucket should have at least one replication rule enabled\nPath: terraform/s3.tf\nLine number: 16\nFile type: Terraform\nMatch content: resource \"aws_s3_bucket\" \"business_card_bucket\" {\nExpected: aws_s3_bucket[business_card_bucket] should have at least one replication rule enabled\nFound: aws_s3_bucket[business_card_bucket] does not have an enabled replication rule\nRemediation instructions: Please refer to the following Terraform documentation for configuration details: [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket), [aws_s3_bucket_replication_configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_replication_configuration)"
|
|
528
|
+
},
|
|
529
|
+
"locations": [
|
|
530
|
+
{
|
|
531
|
+
"physicalLocation": {
|
|
532
|
+
"artifactLocation": {
|
|
533
|
+
"uri": "terraform/s3.tf",
|
|
534
|
+
"uriBaseId": "ROOTPATH"
|
|
535
|
+
},
|
|
536
|
+
"region": {
|
|
537
|
+
"startLine": 16,
|
|
538
|
+
"startColumn": 1,
|
|
539
|
+
"endLine": 16,
|
|
540
|
+
"endColumn": 1
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
"message": {
|
|
544
|
+
"text": "terraform/s3.tf"
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
]
|
|
548
|
+
}
|
|
549
|
+
],
|
|
550
|
+
"columnKind": "utf16CodeUnits",
|
|
551
|
+
"originalUriBaseIds": {
|
|
552
|
+
"ROOTPATH": {
|
|
553
|
+
"uri": "file:///"
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
]
|
|
558
|
+
}
|
package/tests/Processors.spec.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from 'fs'
|
|
2
2
|
import * as path from 'path'
|
|
3
|
-
import { processColor, processSarifPath
|
|
3
|
+
import { processColor, processSarifPath } from '../src/Processors'
|
|
4
4
|
|
|
5
5
|
jest.mock('fs')
|
|
6
6
|
const mockedFs = fs as jest.Mocked<typeof fs>
|
|
@@ -10,7 +10,7 @@ jest.mock('../src/Logger', () => ({
|
|
|
10
10
|
default: { info: jest.fn(), debug: jest.fn() }
|
|
11
11
|
}))
|
|
12
12
|
|
|
13
|
-
describe('processColor', () => {
|
|
13
|
+
describe('(unit): processColor', () => {
|
|
14
14
|
test('returns correct hex for success', () => {
|
|
15
15
|
expect(processColor('success')).toBe('#008000')
|
|
16
16
|
})
|
|
@@ -36,7 +36,7 @@ describe('processColor', () => {
|
|
|
36
36
|
})
|
|
37
37
|
})
|
|
38
38
|
|
|
39
|
-
describe('processSarifPath', () => {
|
|
39
|
+
describe('(unit): processSarifPath', () => {
|
|
40
40
|
const fakeDir = '/fake/dir'
|
|
41
41
|
const fakeFile = '/fake/file.sarif'
|
|
42
42
|
|
|
@@ -74,42 +74,3 @@ describe('processSarifPath', () => {
|
|
|
74
74
|
expect(() => processSarifPath('/weird/path')).toThrow(/neither a file nor a directory/)
|
|
75
75
|
})
|
|
76
76
|
})
|
|
77
|
-
|
|
78
|
-
describe('processLogLevel', () => {
|
|
79
|
-
test('returns 0 for silly', () => {
|
|
80
|
-
expect(processLogLevel('silly')).toBe(0)
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
test('returns 1 for trace', () => {
|
|
84
|
-
expect(processLogLevel('trace')).toBe(1)
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
test('returns 2 for debug', () => {
|
|
88
|
-
expect(processLogLevel('debug')).toBe(2)
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
test('returns 3 for info', () => {
|
|
92
|
-
expect(processLogLevel('info')).toBe(3)
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
test('returns 4 for warning', () => {
|
|
96
|
-
expect(processLogLevel('warning')).toBe(4)
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
test('returns 5 for error', () => {
|
|
100
|
-
expect(processLogLevel('error')).toBe(5)
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
test('returns 6 for fatal', () => {
|
|
104
|
-
expect(processLogLevel('fatal')).toBe(6)
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
test('is case-insensitive', () => {
|
|
108
|
-
expect(processLogLevel('ERROR')).toBe(5)
|
|
109
|
-
expect(processLogLevel('Info')).toBe(3)
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
test('throws for unknown log level', () => {
|
|
113
|
-
expect(() => processLogLevel('unknown')).toThrow(/Unknown log level/)
|
|
114
|
-
})
|
|
115
|
-
})
|