π§ Google IAM Users are assigned the Service Account User or Service Account Token Creator roles at Project level - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/google/project/iam-user-roles/prod.logic.yaml
- Located in: π Google IAM Users are assigned the Service Account User or Service Account Token Creator roles at Project level π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π Google Project | CA10__CaGoogleProject__c | 2 | 1 | 16 |
Usesβ
- π Google IAM Policy Binding - object.extracts.yaml
- π Google Project - object.extracts.yaml
- π Google IAM Role - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2025-04-24T23:47:18.588662492Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | a4p0 | βοΈ 200 | βοΈ otherwise | βοΈ null |
π’ | aAL2 | βοΈ 199 | βοΈ CA10__Google_IAM_Policy_Bindings__r.has(INCOMPLIANT) | βοΈ null |
π’ | aAL23 | βοΈ 200 | βοΈ otherwise | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/google/project/iam-user-roles/policy.yaml | 841EC3AEA3CB49C18D86D31615D65DB4 |
Open | /ce/ca/google/project/iam-user-roles/prod.logic.yaml | AB6DD55E21FC5F828D5FD8F51757C90F |
Open | /types/CA10__CaGoogleIamPolicyBinding__c/object.extracts.yaml | DA65DB880E2440923287921FF4E70B30 |
Open | /ce/ca/google/project/iam-user-roles/test-data.json | 027D62FB0C90FB47F4A2024172C2743D |
Open | /types/CA10__CaGoogleProject__c/object.extracts.yaml | 8EB422663BF4493D44ABA5FEC0FB9AD4 |
Open | /types/CA10__CaGoogleIamRole__c/object.extracts.yaml | 545CD4D347F041DCDD9980D122D63882 |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/google/project/iam-user-roles/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/google/project/iam-user-roles/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/google/project/iam-user-roles/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/google/project/iam-user-roles/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/google/project/iam-user-roles/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaGoogleProject__c"
testData:
- file: test-data.json
importExtracts:
- file: /types/CA10__CaGoogleProject__c/object.extracts.yaml
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "The Service Account User or Service Account Token Creator roles are assigned at the Project level."
remediationMessage: "It is recommended to assign these roles to a user for a specific service account."
check:
RELATED_LIST_HAS:
status: "INCOMPLIANT"
relationshipName: "CA10__Google_IAM_Policy_Bindings__r"
otherwise:
status: "COMPLIANT"
currentStateMessage: "The Service Account User or Service Account Token Creator roles are not assigned at the Project level."
relatedLists:
- relationshipName: "CA10__Google_IAM_Policy_Bindings__r"
importExtracts:
- file: "/types/CA10__CaGoogleIamPolicyBinding__c/object.extracts.yaml"
- file: /types/CA10__CaGoogleIamRole__c/object.extracts.yaml
recordTypes:
- "caGoogleIamPolicyBindingProject"
conditions:
- status: "COMPLIANT"
currentStateMessage: "Binding without a role."
check:
IS_EMPTY_LOOKUP: "CA10__iamRole__r"
- status: "INCOMPLIANT"
currentStateMessage: "Binding with the specified role."
remediationMessage: "Remove the binding."
check:
OR:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10__iamRole__r.CA10__roleName__c"
right:
TEXT: "roles/iam.serviceAccountUser"
- IS_EQUAL:
left:
EXTRACT: "CA10__iamRole__r.CA10__roleName__c"
right:
TEXT: "roles/iam.serviceAccountTokenCreator"
otherwise:
status: "COMPLIANT"
currentStateMessage: "Other IAM Role Bindings."