π§ AWS Account Root User credentials were used is the last 30 days - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/aws/iam/root-account-used-recently/prod.logic.yaml
- Located in: π AWS Account Root User credentials were used is the last 30 days π΄π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π AWS IAM User | CA10__CaAwsUser__c | 13 | 2 | 8 |
Usesβ
- π AWS IAM User - object.extracts.yaml
- π AWS IAM User - credReport.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2025-05-10T12:02:11.874388235Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | test1 | βοΈ 99 | βοΈ isDisappeared(CA10__disappearanceTime__c) | βοΈ null |
π’ | test2 | βοΈ 199 | βοΈ extract('CA10__userName__c') != 'root' | βοΈ null |
π’ | test3 | βοΈ 201 | βοΈ CA10__credReportAttributesJson__c.isEmpty() | βοΈ null |
π’ | test4 | βοΈ 299 | βοΈ extract('CA10__credReportPasswordLastUsed__c').withinLastDays(30) | βοΈ null |
π’ | test5 | βοΈ 300 | βοΈ otherwise | βοΈ null |
π’ | test6 | βοΈ 201 | βοΈ CA10__credReportAttributesJson__c.isEmpty() | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/aws/iam/root-account-used-recently/policy.yaml | EF3985D65ED41115D6A177326887CAEA |
Open | /ce/ca/aws/iam/root-account-used-recently/prod.logic.yaml | E710B7E2F4D96174128A59A8D38E1365 |
Open | /ce/ca/aws/iam/root-account-used-recently/test-data.json | EBF2173710B76EF7591E10D9F249B566 |
Open | /types/CA10__CaAwsUser__c/object.extracts.yaml | 2D04C00E6C59E96198CA5A6E62D0A180 |
Open | /types/CA10__CaAwsUser__c/credReport.extracts.yaml | 8152C61E7FBD5E63E054E986AF83B52F |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/aws/iam/root-account-used-recently/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/aws/iam/root-account-used-recently/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/aws/iam/root-account-used-recently/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/aws/iam/root-account-used-recently/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/aws/iam/root-account-used-recently/prod.logic.yaml
Contentβ
---
inputType: CA10__CaAwsUser__c
testData:
- file: "test-data.json"
importExtracts:
- file: "/types/CA10__CaAwsUser__c/credReport.extracts.yaml"
- file: "/types/CA10__CaAwsUser__c/object.extracts.yaml"
conditions:
- status: INAPPLICABLE
currentStateMessage: "This is not a 'root' user"
check:
NOT_EQUAL:
left:
EXTRACT: CA10__userName__c
right:
TEXT: root
- status: INCOMPLIANT
currentStateMessage: "Root user's password has been used during last 30 days"
remediationMessage: "Avoid logging in as 'root'"
check:
IS_WITHIN_LAST_DAYS:
offsetDays: 30
arg:
EXTRACT: CA10__credReportPasswordLastUsed__c
otherwise:
status: COMPLIANT
currentStateMessage: "Password haven't been used during last 30 days"