π§ Google GCE Instance has a public IP address - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/google/compute-engine/instance-public-ip/prod.logic.yaml
- Located in: π Google GCE Instance has a public IP address π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π Google GCE Instance | CA10__CaGoogleGceInstance__c | 13 | 2 | 10 |
Usesβ
- π Google GCE Network Interface - object.extracts.yaml
- π Google GCE Instance - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2025-04-24T23:46:52.872161508Z Open
Result | Id | Condition Index | Condition Text | Runtime 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β
File | MD5 | |
---|---|---|
Open | /ce/ca/google/compute-engine/instance-public-ip/policy.yaml | 3B90DC890DB9A8E502EC6BB224991E7E |
Open | /ce/ca/google/compute-engine/instance-public-ip/prod.logic.yaml | BAF2CA71AF20B458D478CC284861BAE0 |
Open | /types/CA10__CaGoogleGceNetworkInterface__c/object.extracts.yaml | B3889AA90224A8197852FFE40137C8AB |
Open | /types/CA10__CaGoogleGceInstance__c/object.extracts.yaml | 95F28CC49887E4035F2848BC20DC25D1 |
Open | /ce/ca/google/compute-engine/instance-public-ip/test-data.json | 36427D43184C23E3E210884A822388B3 |
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β
---
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."