01 Run projects list command (Windows/macOS/Linux) using custom query filters to list the IDs of the Google Cloud Platform (GCP) projects currently available in your Google Cloud account:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
gcloud projects list
--format="table(projectId)"
02 The command output should return the requested GCP project identifiers (IDs):
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
PROJECT_ID
cc-main-project-123123
cc-prod-project-112233
03 Run compute networks list command (Windows/macOS/Linux) using the ID of the GCP project that you want to examine as identifier parameter and custom query filters to describe the name of each VPC network created within the selected project:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
gcloud compute networks list
--project cc-main-project-123123
--format="table(name)"
04 The command output should return the name(s) of the VPC network(s) created for the specified project:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
NAME
cc-web-stack-network
cc-internal-vpc-network
05 Run compute firewall-rules list command (Windows/macOS/Linux) using the name of the VPC network that you want to examine as identifier parameter and custom filtering to list all the firewall rules (ingress and egress) defined for the selected Virtual Private Cloud (VPC):
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
gcloud compute firewall-rules list
--filter network=cc-web-stack-network
--sort-by priority
--format=table"(name,disabled,logConfig)"
06 The command output should return the requested information available for the existing VPC firewall rules:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
NAME DISABLED LOG_CONFIG
cc-allow-http-access False {'enable': True, 'metadata': 'INCLUDE_ALL_METADATA'}
cc-allow-https-access False {'enable': True, 'metadata': 'INCLUDE_ALL_METADATA'}
Check the
LOG_CONFIG configuration attribute value for any enabled firewall rules (i.e.
DISABLED attribute set to
False) returned by the
compute firewall-rules list command output. If the
LOG_CONFIG attribute value is set to
{'enable': True, 'metadata': 'INCLUDE_ALL_METADATA'}, as shown in the example above, the firewall logging is enabled and the logging metadata is included within the VPC network firewall rule log files.
07 Repeat step no. 5 and 6 for each VPC network created for the selected GCP project.
08 Repeat steps no. 3 – 7 for each GCP project deployed in your Google Cloud account.