π§ Google Logging Log Metric Filter and Alerts for Project Ownership Assignments Changes do not exist - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/google/logging/project-ownership-assignments-and-changes-monitoring/prod.logic.yaml
- Located in: π Google Logging Log Metric Filter and Alerts for Project Ownership Assignments Changes do not exist π’
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 Logging Log Metric - object.extracts.yaml
- π Google Monitoring Alert Policy - object.extracts.yaml
- π Google Project - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2025-04-24T23:47:11.467790598Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | aB9P1 | βοΈ 199 | βοΈ CA10__Google_Logging_Log_Metrics__r.has(COMPLIANT) | βοΈ null |
π’ | aB9P12 | βοΈ 200 | βοΈ otherwise | βοΈ null |
π’ | aB9P13 | βοΈ 200 | βοΈ otherwise | βοΈ null |
π’ | aB222 | βοΈ 200 | βοΈ otherwise | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/google/logging/project-ownership-assignments-and-changes-monitoring/policy.yaml | B69F6A6041F260B5483C08A4E050A0D3 |
Open | /ce/ca/google/logging/project-ownership-assignments-and-changes-monitoring/prod.logic.yaml | C3591E3E8456386F078547AAEF4E3C6A |
Open | /types/CA10__CaGoogleLoggingLogMetric__c/object.extracts.yaml | D10B1CB14CDBBB08D9E3B38F2BB16DD2 |
Open | /types/CA10__CaGoogleMonitoringAlertPolicy__c/object.extracts.yaml | FB18542F30919AFFF9B8EC854708DAC7 |
Open | /ce/ca/google/logging/project-ownership-assignments-and-changes-monitoring/test-data.json | 660999902285CE0C39E5BC41DE156B70 |
Open | /types/CA10__CaGoogleProject__c/object.extracts.yaml | 8EB422663BF4493D44ABA5FEC0FB9AD4 |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/google/logging/project-ownership-assignments-and-changes-monitoring/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/google/logging/project-ownership-assignments-and-changes-monitoring/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/google/logging/project-ownership-assignments-and-changes-monitoring/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/google/logging/project-ownership-assignments-and-changes-monitoring/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/google/logging/project-ownership-assignments-and-changes-monitoring/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaGoogleProject__c"
testData:
- file: test-data.json
importExtracts:
- file: /types/CA10__CaGoogleProject__c/object.extracts.yaml
conditions:
- status: "COMPLIANT"
currentStateMessage: "Log metric filter and alerts exist for Project Ownership Assignments/Changes."
check:
RELATED_LIST_HAS:
relationshipName: "CA10__Google_Logging_Log_Metrics__r"
status: "COMPLIANT"
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "No log metric filter or alerts exist for Project Ownership Assignments/Changes."
remediationMessage: "Create log metric and alert policy."
relatedLists:
- relationshipName: "CA10__Google_Logging_Log_Metrics__r"
importExtracts:
- file: /types/CA10__CaGoogleLoggingLogMetric__c/object.extracts.yaml
- file: /types/CA10__CaGoogleMonitoringAlertPolicy__c/object.extracts.yaml
conditions:
- status: "COMPLIANT"
currentStateMessage: "Corresponding log metric exists."
check:
AND:
args:
- GCP_LOGGING_QUERY_MATCH:
arg:
EXTRACT: CA10__filter__c
value: '(protoPayload.serviceName="cloudresourcemanager.googleapis.com") AND (ProjectOwnership OR projectOwnerInvitee) OR (protoPayload.serviceData.policyDelta.bindingDeltas.action="REMOVE" AND protoPayload.serviceData.policyDelta.bindingDeltas.role="roles/owner") OR (protoPayload.serviceData.policyDelta.bindingDeltas.action="ADD" AND protoPayload.serviceData.policyDelta.bindingDeltas.role="roles/owner")'
- RELATED_LIST_HAS:
relationshipName: "CA10__Google_Monitoring_Conditions__r"
status: "COMPLIANT"
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "There is no log metric with such filter."
remediationMessage: "Create log metric with the appropriate filter."
relatedLists:
- relationshipName: "CA10__Google_Monitoring_Conditions__r"
conditions:
- status: "COMPLIANT"
currentStateMessage: "Alert policy exist and enabled"
check:
IS_EQUAL:
left:
EXTRACT: CA10__alertPolicy__r.CA10__enabledState__c
right:
TEXT: 'on'
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "No alert policy exist or policy not enabled."
remediationMessage: "Create or enable alert policy."