π§ AWS IAM User with credentials unused for 45 days or more is not disabled - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/aws/iam/disable-user-with-unused-credentials-45-days-and-more/prod.logic.yaml
- Located in: π AWS IAM User with credentials unused for 45 days or more is not disabled π’
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β
Test Results π’β
Generated at: 2025-04-24T23:44:53.826507690Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | a01 | βοΈ 199 | βοΈ extract('CA10__credReportPasswordEnabled__c') == false && extract('CA10__credReportAccessKey1Active__c') == false && extract('CA10__credReportAccessKey2Active__c') == false | βοΈ null |
π’ | a02 | βοΈ 299 | βοΈ extract('CA10__credReportPasswordEnabled__c') == true && extract('CA10__credReportPasswordLastUsed__c').isNotEmpty() && extract('CA10__credReportPasswordLastUsed__c').beyondLastDays(45) | βοΈ null |
π’ | a03 | βοΈ 499 | βοΈ extract('CA10__credReportAccessKey1Active__c') == true && extract('CA10__credReportAccessKey1LastUsed__c').isNotEmpty() && extract('CA10__credReportAccessKey1LastUsed__c').beyondLastDays(45) | βοΈ null |
π’ | a04 | βοΈ 699 | βοΈ extract('CA10__credReportAccessKey2Active__c') == true && extract('CA10__credReportAccessKey2LastUsed__c').isNotEmpty() && extract('CA10__credReportAccessKey2LastUsed__c').beyondLastDays(45) | βοΈ null |
π’ | a05 | βοΈ 800 | βοΈ otherwise | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/aws/iam/disable-user-with-unused-credentials-45-days-and-more/policy.yaml | 69CACB97F1B070462B064151FC1F738F |
Open | /ce/ca/aws/iam/disable-user-with-unused-credentials-45-days-and-more/prod.logic.yaml | 7BDD3AF74014CFD3333888C0026ECDC5 |
Open | /ce/ca/aws/iam/disable-user-with-unused-credentials-45-days-and-more/test-data.json | 17D5E80C6F1E05BE85336BC1B63CD61A |
Open | /types/CA10__CaAwsUser__c/credReport.extracts.yaml | 8152C61E7FBD5E63E054E986AF83B52F |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/aws/iam/disable-user-with-unused-credentials-45-days-and-more/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/aws/iam/disable-user-with-unused-credentials-45-days-and-more/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/aws/iam/disable-user-with-unused-credentials-45-days-and-more/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/aws/iam/disable-user-with-unused-credentials-45-days-and-more/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/aws/iam/disable-user-with-unused-credentials-45-days-and-more/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaAwsUser__c"
testData:
- file: test-data.json
importExtracts:
- file: /types/CA10__CaAwsUser__c/credReport.extracts.yaml
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "Requirements of this policy are applicable only to users with enabled console password or access keys."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: CA10__credReportPasswordEnabled__c
right:
BOOLEAN: false
- IS_EQUAL:
left:
EXTRACT: CA10__credReportAccessKey1Active__c
right:
BOOLEAN: false
- IS_EQUAL:
left:
EXTRACT: CA10__credReportAccessKey2Active__c
right:
BOOLEAN: false
- status: "INCOMPLIANT"
currentStateMessage: "Password hasn't been used for over 45 days."
remediationMessage: "Consider disabling the Console Access for the user."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: CA10__credReportPasswordEnabled__c
right:
BOOLEAN: true
- NOT_EMPTY:
arg:
EXTRACT: CA10__credReportPasswordLastUsed__c
- IS_BEYOND_LAST_DAYS:
offsetDays: 45
arg:
EXTRACT: CA10__credReportPasswordLastUsed__c
- status: "INCOMPLIANT"
currentStateMessage: "Password hasn't been changed over 45 days."
remediationMessage: "Consider disabling the Console Access for the user."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: CA10__credReportPasswordEnabled__c
right:
BOOLEAN: true
- IS_EMPTY:
arg:
EXTRACT: CA10__credReportPasswordLastUsed__c
- NOT_EMPTY:
arg:
EXTRACT: CA10__credReportPasswordLastChanged__c
- IS_BEYOND_LAST_DAYS:
offsetDays: 45
arg:
EXTRACT: CA10__credReportPasswordLastChanged__c
- status: "INCOMPLIANT"
currentStateMessage: "Access Key 1 hasn't been used for over 45 days."
remediationMessage: "Consider deactivating the Access Key 1."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: CA10__credReportAccessKey1Active__c
right:
BOOLEAN: true
- NOT_EMPTY:
arg:
EXTRACT: CA10__credReportAccessKey1LastUsed__c
- IS_BEYOND_LAST_DAYS:
offsetDays: 45
arg:
EXTRACT: CA10__credReportAccessKey1LastUsed__c
- status: "INCOMPLIANT"
currentStateMessage: "Access key 1 hasn't been rotated for over 45 days."
remediationMessage: "Consider deleting the Access Key 1."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: CA10__credReportAccessKey1Active__c
right:
BOOLEAN: true
- IS_EMPTY:
arg:
EXTRACT: CA10__credReportAccessKey1LastUsed__c
- IS_BEYOND_LAST_DAYS:
offsetDays: 45
arg:
EXTRACT: CA10__credReportAccessKey1LastRotated__c
- status: "INCOMPLIANT"
currentStateMessage: "Access Key 2 hasn't been used for over 45 days."
remediationMessage: "Consider deactivating the Access Key 2."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: CA10__credReportAccessKey2Active__c
right:
BOOLEAN: true
- NOT_EMPTY:
arg:
EXTRACT: CA10__credReportAccessKey2LastUsed__c
- IS_BEYOND_LAST_DAYS:
offsetDays: 45
arg:
EXTRACT: CA10__credReportAccessKey2LastUsed__c
- status: "INCOMPLIANT"
currentStateMessage: "Access key 2 hasn't been rotated for over 45 days."
remediationMessage: "Consider deleting the Access Key 2."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: CA10__credReportAccessKey2Active__c
right:
BOOLEAN: true
- IS_EMPTY:
arg:
EXTRACT: CA10__credReportAccessKey2LastUsed__c
- IS_BEYOND_LAST_DAYS:
offsetDays: 45
arg:
EXTRACT: CA10__credReportAccessKey2LastRotated__c
otherwise:
status: "COMPLIANT"
currentStateMessage: "All credentials unused for 45 days or longer were removed or deactivated"