Skip to main content

🧠 AWS EC2 Auto Scaling Group Launch Template is not configured to require IMDSv2 - prod.logic.yaml🟒

Uses​

Test Results πŸŸ’β€‹

Generated at: 2026-02-10T22:32:33.240055979Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ extract('CA10__launchConfigurationName__c').isNotEmpty()βœ”οΈ null
🟒test3βœ”οΈ 299βœ”οΈ extract('CA10A1__launchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__launchTemplate__r') || isEmptyLookup('CA10A1__launchTemplate__r.CA10A1__latestVersion__r'))βœ”οΈ null
🟒test4βœ”οΈ 299βœ”οΈ extract('CA10A1__launchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__launchTemplate__r') || isEmptyLookup('CA10A1__launchTemplate__r.CA10A1__latestVersion__r'))βœ”οΈ null
🟒test5βœ”οΈ 399βœ”οΈ extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r') || isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r'))βœ”οΈ null
🟒test6βœ”οΈ 399βœ”οΈ extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r') || isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r'))βœ”οΈ null
🟒test7βœ”οΈ 499βœ”οΈ extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled'βœ”οΈ null
🟒test8βœ”οΈ 599βœ”οΈ extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled'βœ”οΈ null
🟒test9βœ”οΈ 699βœ”οΈ extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'βœ”οΈ null
🟒test10βœ”οΈ 799βœ”οΈ extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'βœ”οΈ null
🟒test11βœ”οΈ 800βœ”οΈ otherwiseβœ”οΈ null
🟒test12βœ”οΈ 800βœ”οΈ otherwiseβœ”οΈ null

Generation Bundle​

FileMD5
Open/ce/ca/aws/autoscaling/group-launch-template-imdsv2/policy.yaml2BA738690B9315E9C7CB7C6FC7A0EDC5
Open/ce/ca/aws/autoscaling/group-launch-template-imdsv2/prod.logic.yamlAFB5538DDF7C893F449003320F21C6DD
Open/ce/ca/aws/autoscaling/group-launch-template-imdsv2/test-data.json30BAABD8C965221D8C82CE87D97F01E4
Open/types/CA10A1__CaAwsEc2LaunchTemplateVersion__c/object.extracts.yaml0CF0050EB6BA851041A4284E9AEA6611
Open/types/CA10__CaAwsAutoScalingGroup__c/object.extracts.yamlDD26D73C0CF43F8CE9CBE35D8241D89C

Available Commands​

repo-manager policies generate FULL /ce/ca/aws/autoscaling/group-launch-template-imdsv2/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/aws/autoscaling/group-launch-template-imdsv2/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/aws/autoscaling/group-launch-template-imdsv2/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/aws/autoscaling/group-launch-template-imdsv2/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/aws/autoscaling/group-launch-template-imdsv2/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaAwsAutoScalingGroup__c"
importExtracts:
- file: "/types/CA10A1__CaAwsEc2LaunchTemplateVersion__c/object.extracts.yaml"
- file: "/types/CA10__CaAwsAutoScalingGroup__c/object.extracts.yaml"
testData:
- file: "test-data.json"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "The Auto Scaling group uses a launch configuration."
remediationMessage: "Migrate the Auto Scaling group to a launch template."
check:
NOT_EMPTY:
arg:
EXTRACT: "CA10__launchConfigurationName__c"
- status: "UNDETERMINED"
currentStateMessage: "The launch template is not present in the CMDB."
check:
AND:
args:
- NOT_EMPTY:
arg:
EXTRACT: "CA10A1__launchTemplateId__c"
- OR:
args:
- IS_EMPTY_LOOKUP: "CA10A1__launchTemplate__r"
- IS_EMPTY_LOOKUP: "CA10A1__launchTemplate__r.CA10A1__latestVersion__r"
- status: "UNDETERMINED"
currentStateMessage: "The launch template is not present in the CMDB."
check:
AND:
args:
- NOT_EMPTY:
arg:
EXTRACT: "CA10A1__mixedInstancesLaunchTemplateId__c"
- OR:
args:
- IS_EMPTY_LOOKUP: "CA10A1__mixedInstancesLaunchTemplate__r"
- IS_EMPTY_LOOKUP: "CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r"
- status: "INCOMPLIANT"
currentStateMessage: "Access to the HTTP endpoint of the instance metadata service is disabled."
remediationMessage: "Enable access to the instance metadata service."
check:
AND:
args:
- NOT_EMPTY:
arg:
EXTRACT: "CA10A1__launchTemplateId__c"
- IS_EQUAL:
left:
EXTRACT: "CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c"
right:
TEXT: "disabled"
- status: "INCOMPLIANT"
currentStateMessage: "Access to the HTTP endpoint of the instance metadata service is disabled."
remediationMessage: "Enable access to the instance metadata service."
check:
AND:
args:
- NOT_EMPTY:
arg:
EXTRACT: "CA10A1__mixedInstancesLaunchTemplateId__c"
- IS_EQUAL:
left:
EXTRACT: "CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c"
right:
TEXT: "disabled"
- status: "COMPLIANT"
currentStateMessage: "The launch template settings require IMDSv2."
check:
AND:
args:
- NOT_EMPTY:
arg:
EXTRACT: "CA10A1__launchTemplateId__c"
- IS_EQUAL:
left:
EXTRACT: "CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c"
right:
TEXT: "required"
- status: "COMPLIANT"
currentStateMessage: "The launch template settings require IMDSv2."
check:
AND:
args:
- NOT_EMPTY:
arg:
EXTRACT: "CA10A1__mixedInstancesLaunchTemplateId__c"
- IS_EQUAL:
left:
EXTRACT: "CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c"
right:
TEXT: "required"
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "IMDSv2 is not required when requesting instance metadata."
remediationMessage: "Configure the template to require IMDSv2."