Skip to main content

🧠 AWS API Gateway API Route Authorization Type is not configured - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• AWS API Gateway APICA10__CaAwsApiGatewayRestApi__c213

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-04-24T23:44:19.746468704Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ not(['httpApi'].contains(RecordType.DeveloperName))βœ”οΈ null
🟒test3βœ”οΈ 399βœ”οΈ extract('CA10__protocolType__c') == 'HTTP' && CA10A1__AWS_API_Gateway_Routes__r.has(INCOMPLIANT)βœ”οΈ null
🟒test4βœ”οΈ 299βœ”οΈ extract('CA10__protocolType__c') == 'WEBSOCKET' && CA10A1__AWS_API_Gateway_Routes__r.has(INCOMPLIANT)βœ”οΈ null
🟒test5βœ”οΈ 400βœ”οΈ otherwiseβœ”οΈ null
🟒test6βœ”οΈ 400βœ”οΈ otherwiseβœ”οΈ null
🟒test7βœ”οΈ 400βœ”οΈ otherwiseβœ”οΈ null

Generation​

FileMD5
Open/ce/ca/aws/apigateway/api-route-authorization-type/policy.yaml734DDBB07D28E2B379E86EFB6208BCD0
Open/ce/ca/aws/apigateway/api-route-authorization-type/prod.logic.yaml6814C4509688D2705E7B0A35EE9795A0
Open/types/CA10A1__CaAwsApiGatewayRoute__c/object.extracts.yaml341AE92FA4ED622FA3D827EAEFA95B7F
Open/ce/ca/aws/apigateway/api-route-authorization-type/test-data.jsonA5B67DFD5769D4A6EF8F02187F4DF3FA
Open/types/CA10__CaAwsApiGatewayRestApi__c/object.extracts.yaml746F09341E8149BAD88C53E274DB1DD5

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/aws/apigateway/api-route-authorization-type/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/aws/apigateway/api-route-authorization-type/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/aws/apigateway/api-route-authorization-type/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/aws/apigateway/api-route-authorization-type/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/aws/apigateway/api-route-authorization-type/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaAwsApiGatewayRestApi__c"
recordTypes:
- httpApi
importExtracts:
- file: "/types/CA10__CaAwsApiGatewayRestApi__c/object.extracts.yaml"
- file: "/types/CA10A1__CaAwsApiGatewayRoute__c/object.extracts.yaml"
testData:
- file: "test-data.json"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "The WebSocket API has at least one API Route with\
\ no Authorization Type configured."
remediationMessage: "Consider configuring an authorization type for the\
\ API Route in the API Gateway."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10__protocolType__c"
right:
TEXT: "WEBSOCKET"
- RELATED_LIST_HAS:
status: "INCOMPLIANT"
relationshipName: "CA10A1__AWS_API_Gateway_Routes__r"
- status: "INCOMPLIANT"
currentStateMessage: "The HTTP API has at least one API Route with\
\ no Authorization Type configured."
remediationMessage: "Consider configuring an authorization type for the\
\ API Route in the API Gateway."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10__protocolType__c"
right:
TEXT: "HTTP"
- RELATED_LIST_HAS:
status: "INCOMPLIANT"
relationshipName: "CA10A1__AWS_API_Gateway_Routes__r"
otherwise:
status: "COMPLIANT"
currentStateMessage: "The API doesn't have Routes without an Authorization Type."
relatedLists:
- relationshipName: "CA10A1__AWS_API_Gateway_Routes__r"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "API Gateway Route Authorization Type is not configured."
remediationMessage: "Configure Authorization Type for the API Gateway Route."
check:
IS_EQUAL:
left:
EXTRACT: "CA10A1__authorizationType__c"
right:
TEXT: "NONE"
otherwise:
status: "COMPLIANT"
currentStateMessage: "API Gateway Route Authorization Type is configured."