Skip to main content

🧠 Google GCE Instance has a public IP address - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• Google GCE InstanceCA10__CaGoogleGceInstance__c13210

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-04-24T23:46:52.872161508Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒a4Z1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒a4Z2Gβœ”οΈ 199βœ”οΈ extract('Name').startsWith('gke-')βœ”οΈ null
🟒a4Z3βœ”οΈ 299βœ”οΈ CA10__Google_GCE_Network_Interfaces__r.has(INCOMPLIANT)βœ”οΈ null
🟒a4Z4βœ”οΈ 300βœ”οΈ otherwiseβœ”οΈ null

Generation​

FileMD5
Open/ce/ca/google/compute-engine/instance-public-ip/policy.yaml3B90DC890DB9A8E502EC6BB224991E7E
Open/ce/ca/google/compute-engine/instance-public-ip/prod.logic.yamlBAF2CA71AF20B458D478CC284861BAE0
Open/types/CA10__CaGoogleGceNetworkInterface__c/object.extracts.yamlB3889AA90224A8197852FFE40137C8AB
Open/types/CA10__CaGoogleGceInstance__c/object.extracts.yaml95F28CC49887E4035F2848BC20DC25D1
Open/ce/ca/google/compute-engine/instance-public-ip/test-data.json36427D43184C23E3E210884A822388B3

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/google/compute-engine/instance-public-ip/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/google/compute-engine/instance-public-ip/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/google/compute-engine/instance-public-ip/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/google/compute-engine/instance-public-ip/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/google/compute-engine/instance-public-ip/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaGoogleGceInstance__c"
testData:
- file: test-data.json
importExtracts:
- file: /types/CA10__CaGoogleGceInstance__c/object.extracts.yaml
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This instance is created by GKE."
check:
STARTS_WITH:
arg:
EXTRACT: "Name"
prefix:
TEXT: 'gke-'
- status: "INCOMPLIANT"
currentStateMessage: "This instance has a public IP address."
remediationMessage: "Delete the public access config."
check:
RELATED_LIST_HAS:
status: "INCOMPLIANT"
relationshipName: "CA10__Google_GCE_Network_Interfaces__r"
otherwise:
status: "COMPLIANT"
currentStateMessage: "The instance doesn't have a public IP address."
relatedLists:
- relationshipName: "CA10__Google_GCE_Network_Interfaces__r"
importExtracts:
- file: /types/CA10__CaGoogleGceNetworkInterface__c/object.extracts.yaml
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "The Network Interface has an External IP address attached."
check:
NOT_EMPTY:
arg:
EXTRACT: "CA10__externalIp__c"
otherwise:
status: "COMPLIANT"
currentStateMessage: "The Network Interface doesn't have an External IP address attached."