Skip to content
This repository was archived by the owner on Nov 19, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions cloudfunctions/router/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ func TestRouter(t *testing.T) {
}`
validPublicBucket = `{
"notificationConfigName": "organizations/154584661726/notificationConfigs/sampleConfigId",
"resource": {
"projectDisplayName": "test-project"
},
"finding": {
"name": "organizations/154584661726/sources/2673592633662526977/findings/782e52631d61da6117a3772137c270d8",
"parent": "organizations/154584661726/sources/2673592633662526977",
Expand All @@ -89,7 +92,6 @@ func TestRouter(t *testing.T) {
"ExceptionInstructions": "Add the security mark \"allow_public_bucket_acl\" to the asset with a value of \"true\" to prevent this finding from being activated again.",
"SeverityLevel": "High",
"Recommendation": "Go to https://console.cloud.google.com/storage/browser/this-is-public-on-purpose, click on the Permissions tab, and remove \"allUsers\" and \"allAuthenticatedUsers\" from the bucket's members.",
"ProjectId": "test-project",
"AssetCreationTime": "2019-09-19T20:08:29.102Z",
"ScannerName": "STORAGE_SCANNER",
"ScanRunId": "2019-09-23T10:20:27.204-07:00",
Expand All @@ -100,7 +102,7 @@ func TestRouter(t *testing.T) {
"marks": {
"babab": "3"
}
},
},
"eventTime": "2019-09-23T17:20:27.204Z",
"createTime": "2019-09-23T17:20:27.934Z"
}
Expand Down Expand Up @@ -326,6 +328,9 @@ func TestRemediated(t *testing.T) {
}`
remediatedPublicBucket = `{
"notificationConfigName": "organizations/154584661726/notificationConfigs/sampleConfigId",
"resource": {
"projectDisplayName": "test-project"
},
"finding": {
"name": "organizations/154584661726/sources/2673592633662526977/findings/782e52631d61da6117a3772137c270d8",
"parent": "organizations/154584661726/sources/2673592633662526977",
Expand All @@ -338,7 +343,6 @@ func TestRemediated(t *testing.T) {
"ExceptionInstructions": "Add the security mark \"allow_public_bucket_acl\" to the asset with a value of \"true\" to prevent this finding from being activated again.",
"SeverityLevel": "High",
"Recommendation": "Go to https://console.cloud.google.com/storage/browser/this-is-public-on-purpose, click on the Permissions tab, and remove \"allUsers\" and \"allAuthenticatedUsers\" from the bucket's members.",
"ProjectId": "test-project",
"AssetCreationTime": "2019-09-19T20:08:29.102Z",
"ScannerName": "STORAGE_SCANNER",
"ScanRunId": "2019-09-23T10:20:27.204-07:00",
Expand Down
Loading