Skip to main content

🧠 Google GCE Instance is configured to use the Default Service Account with full access to all Cloud APIs - prod.logic.yaml 🟒

Flags​

Input Type​

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

Uses​

Test Results πŸŸ’β€‹

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

ResultIdCondition IndexCondition TextRuntime Error
🟒a4ZV1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒a4Z7V2βœ”οΈ 199βœ”οΈ extract('Name').startsWith('gke-')βœ”οΈ null
🟒a4ZV3βœ”οΈ 299βœ”οΈ CA10__Google_Instance_Service_Account_Links__r.has(INCOMPLIANT)βœ”οΈ null
🟒a4Z04βœ”οΈ 300βœ”οΈ otherwiseβœ”οΈ null

Generation​

FileMD5
Open/ce/ca/google/compute-engine/instance-use-default-service-account-with-full-access/policy.yamlEE95A4C0B7E10C07F8B658088400E889
Open/ce/ca/google/compute-engine/instance-use-default-service-account-with-full-access/prod.logic.yamlE5288FED1752AC962E3CFEB027741BE7
Open/ce/ca/google/compute-engine/instance-use-default-service-account-with-full-access/test-data.json9D76438430C91C71842EF1F014F01FF4
Open/types/CA10__CaGoogleGceInstanceServiceAccountLink__c/object.extracts.yaml0C66B01DC5A053558EA02D513AF8875C
Open/types/CA10__CaGoogleGceInstance__c/object.extracts.yaml95F28CC49887E4035F2848BC20DC25D1

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/google/compute-engine/instance-use-default-service-account-with-full-access/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/google/compute-engine/instance-use-default-service-account-with-full-access/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/google/compute-engine/instance-use-default-service-account-with-full-access/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/google/compute-engine/instance-use-default-service-account-with-full-access/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/google/compute-engine/instance-use-default-service-account-with-full-access/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: "The instance is created by GKE."
check:
STARTS_WITH:
arg:
EXTRACT: "Name"
prefix:
TEXT: 'gke-'
- status: "INCOMPLIANT"
currentStateMessage: "The instance is configured to use the default service account with full access to all Cloud APIs."
remediationMessage: "Update the instance to use a user-managed service account."
check:
RELATED_LIST_HAS:
status: "INCOMPLIANT"
relationshipName: "CA10__Google_Instance_Service_Account_Links__r"
otherwise:
status: "COMPLIANT"
currentStateMessage: "Instance is not configured to use the default service account with full access to all Cloud APIs."
relatedLists:
- relationshipName: "CA10__Google_Instance_Service_Account_Links__r"
importExtracts:
- file: /types/CA10__CaGoogleGceInstanceServiceAccountLink__c/object.extracts.yaml
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "Scopes is set to Allow full access to all Cloud APIs."
check:
CONTAINS:
arg:
EXTRACT: "CA10__scopes__c"
substring:
TEXT: 'https://www.googleapis.com/auth/cloud-platform'
otherwise:
status: "COMPLIANT"
currentStateMessage: "Scopes is not set to Allow full access to all Cloud APIs."