-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
245 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
src/gcp/nist-800-53-rev4/rules/gcp-nist-800-53-rev4-3.10.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// GCP CIS 1.2.0 Rule equivalent 3.8 | ||
export default { | ||
id: 'gcp-nist-800-53-rev4-3.10', | ||
title: | ||
'GCP NIST 3.10 Network subnet flow logs should be enabled', | ||
description: `Flow Logs is a feature that enables users to capture information about the IP traffic going to | ||
and from network interfaces in the organization's VPC Subnets. Once a flow log is created, | ||
the user can view and retrieve its data in Stackdriver Logging. It is recommended that Flow | ||
Logs be enabled for every business-critical VPC subnet.`, | ||
|
||
audit: `**From Console:** | ||
1. Go to the VPC network GCP Console visiting https://console.cloud.google.com/networking/networks/list | ||
2. From the list of network subnets, | ||
make sure for each subnet *Flow Logs* is set to *On* | ||
**From Command Line:** | ||
gcloud compute networks list --format json | \\ jq -r '.[].subnetworks | .[]' | \ | ||
xargs -I {} gcloud compute networks subnets describe {} --format json | \ | ||
jq -r '. | "Subnet: \\(.name) Purpose: \\(.purpose) VPC Flow Log Enabled: \\(has("enableFlowLogs"))"' | ||
The output of the above command will list each subnet, the subnet's purpose, and a *true* or *false* value if *Flow Logs* are enabled. | ||
If the subnet's purpose is *PRIVATE* then *Flow Logs* should be *true*. | ||
`, | ||
rationale: `VPC networks and subnetworks not reserved for internal HTTP(S) load balancing provide logically isolated and secure network partitions where GCP resources can be launched. When Flow Logs are enabled for a subnet, VMs within that subnet start reporting on all Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) flows. Each VM samples the TCP and UDP flows it sees, inbound and outbound, whether the flow is to or from another VM, a host in the on-premises datacenter, a Google service, or a host on the Internet. If two GCP VMs are communicating, and both are in subnets that have VPC Flow Logs enabled, both VMs report the flows. | ||
Flow Logs supports the following use cases: | ||
- Network monitoring | ||
- Understanding network usage and optimizing network traffic expenses | ||
- Network forensics | ||
- Real-time security analysis | ||
Flow Logs provide visibility into network traffic for each VM inside the subnet and can be used to detect | ||
anomalous traffic or provide insight during security workflows. | ||
Note: Subnets reserved for use by internal HTTP(S) load balancers do not support VPC flow logs.`, | ||
remediation: `**From Console:** | ||
1. Go to the VPC network GCP Console visiting https://console.cloud.google.com/networking/networks/list | ||
2. Click the name of a subnet, The *Subnet details* page displays. | ||
3. Click the *EDIT* button. | ||
4. Set *Flow Logs* to *On*. | ||
5. Click Save. | ||
**From Command Line:** | ||
To set Private Google access for a network subnet, run the following command: | ||
gcloud compute networks subnets update [SUBNET_NAME] --region [REGION] --enable-flow-logs`, | ||
references: [ | ||
'https://cloud.google.com/vpc/docs/using-flow-logs#enabling_vpc_flow_logging', | ||
'https://cloud.google.com/vpc/', | ||
], | ||
gql: `{ | ||
querygcpNetwork{ | ||
id | ||
__typename | ||
subnets{ | ||
purpose | ||
enableFlowLogs | ||
} | ||
} | ||
}`, | ||
resource: 'querygcpNetwork[*]', | ||
severity: 'high', | ||
conditions: { | ||
path: '@.subnets', | ||
array_all: { | ||
or: [ | ||
{ | ||
path: '[*].purpose', | ||
notEqual: 'PRIVATE', | ||
}, | ||
{ | ||
and: [ | ||
{ | ||
path: '[*].purpose', | ||
equal: 'PRIVATE', | ||
}, | ||
{ | ||
path: '[*].enableFlowLogs', | ||
equal: true, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters