π§ Google IAM Service Account has User-Managed Keys - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/google/iam/service-account-keys/prod.logic.yaml
- Located in: π Google IAM Service Account has User-Managed Keys π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π Google IAM Service Account | CA10__CaGoogleIamServiceAccount__c | 3 | 1 | 2 |
Usesβ
Test Results π’β
Generated at: 2025-05-10T12:05:23.453973240Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | aAL1 | βοΈ 199 | βοΈ not(extract('CA10__serviceAccountEmail__c').endsWith('iam.gserviceaccount.com')) | βοΈ null |
π’ | aAL2 | βοΈ 299 | βοΈ CA10__Google_IAM_Service_Account_Keys__r.has(INCOMPLIANT) | βοΈ null |
π’ | aAL3 | βοΈ 300 | βοΈ otherwise | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/google/iam/service-account-keys/policy.yaml | D98FC422BC24227364397D6A3D35CAEB |
Open | /ce/ca/google/iam/service-account-keys/prod.logic.yaml | 9986C9797E80B1D3D113492B07743421 |
Open | /ce/ca/google/iam/service-account-keys/test-data.json | F2D71725B64986F97F9E2DEAD7468B02 |
Open | /types/CA10__CaGoogleIamServiceAccount__c/object.extracts.yaml | EB5FB013DE89FCA54D6B42804FC725D6 |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/google/iam/service-account-keys/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/google/iam/service-account-keys/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/google/iam/service-account-keys/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/google/iam/service-account-keys/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/google/iam/service-account-keys/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaGoogleIamServiceAccount__c"
testData:
- file: test-data.json
importExtracts:
- file: /types/CA10__CaGoogleIamServiceAccount__c/object.extracts.yaml
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "Only for user-managed service accounts."
check:
NOT:
arg:
ENDS_WITH:
arg:
EXTRACT: CA10__serviceAccountEmail__c
suffix:
TEXT: "iam.gserviceaccount.com"
- status: "INCOMPLIANT"
currentStateMessage: "User-managed service accounts should not have user-managed keys."
remediationMessage: "You should delete a user managed Service Account Key."
check:
RELATED_LIST_HAS:
status: "INCOMPLIANT"
relationshipName: "CA10__Google_IAM_Service_Account_Keys__r"
otherwise:
status: "COMPLIANT"
currentStateMessage: "User-managed service accounts haven't user-managed keys."
relatedLists:
- relationshipName: "CA10__Google_IAM_Service_Account_Keys__r"
conditions: []
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "Service Account Key is enabled."