Skip to content

Commit fe76508

Browse files
feat(CG-1300): add gcp cis 1.30 2.15
1 parent 2baa517 commit fe76508

4 files changed

Lines changed: 143 additions & 0 deletions

File tree

src/gcp/cis-1.3.0/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Policy Pack based on the GCP Foundations 1.3.0 benchmark provided by the [Center
8484
| GCP CIS 2.12 | Ensure that Cloud DNS logging is enabled for all VPC networks |
8585
| GCP CIS 2.13 | Ensure Cloud Asset Inventory Is Enabled |
8686
| GCP CIS 2.14 | Ensure 'Access Transparency' is 'Enabled' |
87+
| GCP CIS 2.15 | Ensure 'Access Approval' is 'Enabled' |
8788
| GCP CIS 3.1 | Ensure that the default network does not exist in a project |
8889
| GCP CIS 3.2 | Ensure legacy networks do not exist for a project |
8990
| GCP CIS 3.3 | Ensure that DNSSEC is enabled for Cloud DNS |
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
export default {
2+
id: 'gcp-cis-1.3.0-2.15',
3+
title:
4+
'GCP CIS 2.15 Ensure \'Access Approval\' is \'Enabled\'',
5+
description: `GCP Access Approval enables you to require your organizations' explicit approval
6+
whenever Google support try to access your projects. You can then select users within your
7+
organization who can approve these requests through giving them a security role in IAM.
8+
All access requests display which Google Employee requested them in an email or Pub/Sub
9+
message that you can choose to Approve. This adds an additional control and logging of
10+
who in your organization approved/denied these requests.`,
11+
audit: `**Determine if Access Transparency is Enabled**
12+
13+
1. From the Google Cloud Home, click on the Navigation hamburger menu in the top left. Hover over the IAM & Admin Menu. Select settings in the middle of the column that opens.
14+
2. The status should be "Enabled' under the heading *Access Transparency*
15+
16+
**Enable Access Transparency**
17+
18+
1. From the Google Cloud Home, click on the Navigation hamburger menu in the top left. Hover over the *IAM & Admin* Menu. Select *settings* in the middle of the column that opens.
19+
2. Click the blue button labeled Enable *Access Transparency for Organization*
20+
21+
**Determine if Access Approval is Enabled**
22+
23+
1. From the Google Cloud Home, within the project you wish to check, click on the Navigation hamburger menu in the top left. Hover over the *Security* Menu. Select *Access Approval* in the middle of the column that opens.
24+
2. The status will be displayed here. If you see a screen saying you need to enroll in Access Approval, it is not enabled.
25+
26+
**From CLI:
27+
28+
Determine if Access Approval is Enabled**
29+
30+
1. From within the project you wish to audit, run the following command.
31+
32+
gcloud access-approval settings get
33+
34+
2. The status will be displayed in the output.`,
35+
36+
rationale: `Controlling access to your information is one of the foundations of information security.
37+
Google Employees do have access to your organizations' projects for support reasons. With
38+
Access Approval, organizations can then be certain that their information is accessed by
39+
only approved Google Personnel.`,
40+
remediation: `**From Console:**
41+
42+
1. From the Google Cloud Home, within the project you wish to enable, click on the Navigation hamburger menu in the top left. Hover over the *Security* Menu. Select *Access Approval* in the middle of the column that opens.
43+
2. The status will be displayed here. On this screen, there is an option to click *Enroll*. If
44+
it is greyed out and you see an error bar at the top of the screen that says *Access Transparency is not enabled* please view the corresponding reference within this section to enable it.
45+
3. In the second screen click *Enroll*.
46+
47+
**Grant an IAM Group or User the role with permissions to Add Users to be Access Approval message Recipients**
48+
49+
1. From the Google Cloud Home, within the project you wish to enable, click on the Navigation hamburger menu in the top left. Hover over the *IAM and Admin*. Select *IAM* in the middle of the column that opens.
50+
2. Click the blue button the says *+add* at the top of the screen.
51+
3. In the *principals* field, select a user or group by typing in their associated email address.
52+
4. Click on the role field to expand it. In the filter field enter *Access Approval Approver* and select it.
53+
5. Click *save*.
54+
55+
**Add a Group or User as an Approver for Access Approval Requests**
56+
57+
1. As a user with the *Access Approval Approver* permission, within the project where you wish to add an email address to which request will be sent, click on the Navigation hamburger menu in the top left. Hover over the *Security* Menu. Select *Access Approval* in the middle of the column that opens.
58+
2. Click *Manage Settings*
59+
3. Under *Set up approval notifications*s, enter the email address associated with a Google Cloud User or Group you wish to send Access Approval requests to. All future access approvals will be sent as emails to this address.
60+
61+
**From CLI:**
62+
63+
1. To update all services in an entire project, run the following command from an account that has permissions as an 'Approver for Access Approval Requests'
64+
65+
gcloud access-approval settings update --project=<project name> --
66+
enrolled_services=all --notification_emails='<email recipient for access
67+
approval requests>@<domain name>'
68+
69+
**Default Value:**
70+
71+
By default Access Approval and its dependency of Access Transparency are not enabled.`,
72+
references: [
73+
'https://cloud.google.com/cloud-provider-access-management/accessapproval/docs',
74+
'https://cloud.google.com/cloud-provider-access-management/accessapproval/docs/overview',
75+
'https://cloud.google.com/cloud-provider-access-management/accessapproval/docs/quickstart-custom-key',
76+
'https://cloud.google.com/cloud-provider-access-management/accessapproval/docs/supported-services',
77+
'https://cloud.google.com/cloud-provider-access-management/accessapproval/docs/view-historical-requests',
78+
],
79+
gql: `{
80+
querygcpProject {
81+
id
82+
__typename
83+
accessApprovals {
84+
id
85+
}
86+
}
87+
}`,
88+
resource: 'querygcpProject[*]',
89+
severity: 'unknown',
90+
check: ({ resource }: any) => {
91+
const { accessApprovals } = resource
92+
return !!accessApprovals
93+
},
94+
}

src/gcp/cis-1.3.0/rules/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import Gcp_CIS_130_211 from './gcp-cis-1.3.0-2.11'
2727
import Gcp_CIS_130_212 from './gcp-cis-1.3.0-2.12'
2828
import Gcp_CIS_130_213 from './gcp-cis-1.3.0-2.13'
2929
import Gcp_CIS_130_214 from './gcp-cis-1.3.0-2.14'
30+
import Gcp_CIS_130_215 from './gcp-cis-1.3.0-2.15'
3031
import Gcp_CIS_130_31 from './gcp-cis-1.3.0-3.1'
3132
import Gcp_CIS_130_32 from './gcp-cis-1.3.0-3.2'
3233
import Gcp_CIS_130_33 from './gcp-cis-1.3.0-3.3'
@@ -105,6 +106,7 @@ export default [
105106
Gcp_CIS_130_212,
106107
Gcp_CIS_130_213,
107108
Gcp_CIS_130_214,
109+
Gcp_CIS_130_215,
108110
Gcp_CIS_130_31,
109111
Gcp_CIS_130_32,
110112
Gcp_CIS_130_33,

src/gcp/cis-1.3.0/tests/gcp-cis-1.3.0-2.x.test.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Gcp_CIS_130_210 from '../rules/gcp-cis-1.3.0-2.10'
1616
import Gcp_CIS_130_211 from '../rules/gcp-cis-1.3.0-2.11'
1717
import Gcp_CIS_130_212 from '../rules/gcp-cis-1.3.0-2.12'
1818
import Gcp_CIS_130_213 from '../rules/gcp-cis-1.3.0-2.13'
19+
import Gcp_CIS_130_215 from '../rules/gcp-cis-1.3.0-2.15'
1920
import { initRuleEngine } from '../../../utils/test'
2021

2122
const Gcp_CIS_130_24_Filter =
@@ -83,11 +84,16 @@ export interface Asset {
8384
id: string
8485
}
8586

87+
export interface AccessApprovals {
88+
id: string
89+
}
90+
8691
export interface QuerygcpProject {
8792
id: string
8893
logSinks?: LogSink[]
8994
logBuckets?: LogBucket[]
9095
assets?: Asset[]
96+
accessApprovals?: AccessApprovals[]
9197
}
9298

9399
export interface AuditLogConfig {
@@ -1309,4 +1315,44 @@ describe('CIS Google Cloud Platform Foundations: 1.3.0', () => {
13091315
await test213Rule(false, Result.FAIL)
13101316
})
13111317
})
1318+
1319+
describe('GCP CIS 2.15 Ensure \'Access Approval\' is Enabled', () => {
1320+
const test215Rule = async (
1321+
hasService: boolean,
1322+
expectedResult: Result
1323+
): Promise<void> => {
1324+
// Arrange
1325+
const data: CIS2xQueryResponse = {
1326+
querygcpProject: [
1327+
{
1328+
id: cuid(),
1329+
accessApprovals: hasService? [
1330+
{
1331+
id: cuid(),
1332+
},
1333+
]
1334+
: undefined,
1335+
},
1336+
],
1337+
1338+
}
1339+
1340+
// Act
1341+
const [processedRule] = await rulesEngine.processRule(
1342+
Gcp_CIS_130_215 as Rule,
1343+
{ ...data }
1344+
)
1345+
1346+
// Asserts
1347+
expect(processedRule.result).toBe(expectedResult)
1348+
}
1349+
1350+
test('No Security Issue when the Access Approval is enabled', async () => {
1351+
await test215Rule(true, Result.PASS)
1352+
})
1353+
1354+
test('Security Issue when the Assets Access Approval is disabled', async () => {
1355+
await test215Rule(false, Result.FAIL)
1356+
})
1357+
})
13121358
})

0 commit comments

Comments
 (0)