Skip to main content

🧠 AWS Account Root User credentials were used is the last 30 days - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• AWS IAM UserCA10__CaAwsUser__c1328

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-05-10T12:02:11.874388235Z Open

ResultIdCondition IndexCondition TextRuntime 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​

FileMD5
Open/ce/ca/aws/iam/root-account-used-recently/policy.yamlEF3985D65ED41115D6A177326887CAEA
Open/ce/ca/aws/iam/root-account-used-recently/prod.logic.yamlE710B7E2F4D96174128A59A8D38E1365
Open/ce/ca/aws/iam/root-account-used-recently/test-data.jsonEBF2173710B76EF7591E10D9F249B566
Open/types/CA10__CaAwsUser__c/object.extracts.yaml2D04C00E6C59E96198CA5A6E62D0A180
Open/types/CA10__CaAwsUser__c/credReport.extracts.yaml8152C61E7FBD5E63E054E986AF83B52F

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​

Open File

---
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"