Skip to content

    Type a page, a command such as keryn scan, or a rule id.

    iac-ai-services-cfn-v1

    View as Markdown

    12 rules · Keryn Software Licence · rules 0.8.0 · all packs

    How to read a rule
    Severity
    How bad the finding is if it is real: error fails a default gate, warning and info do not.
    Confidence
    P0 exploitable as written; P1 dangerous in context; P2 a heuristic or a posture check: confirm by reading the code.
    False-positive risk
    low: an exact API or flag, so hits are almost always real; medium: the pattern is legitimate in many programs, so check each hit; high: it finds a lead to confirm, so expect benign hits.
    Edge
    The relationship the finding sits on. reaches: content or traffic gets to a thing; calls: one thing invokes another; reads: one thing reads from another; writes: one thing writes to another; sends: data leaves for another party; grants: authority is given or left unchecked; depends_on: something relies on a component it does not verify; trusts: one party believes another without evidence. The boundary it crosses, when there is one: user->prompt (untrusted input reaching a prompt); model->code (model output reaching code, a shell, a query or a page); secret->outside (a secret leaving the trusted side); supply-chain (code, models or prompts pulled in from outside).
    Taxonomy chips
    References for readers who work in OWASP LLM 2025, OWASP Agentic, CWE or NIST AI RMF. They say where a rule belongs, not that a framework is satisfied.

    seceng.iacai.cfn-bedrock-agent-no-guardrail

    Section titled “seceng.iacai.cfn-bedrock-agent-no-guardrail”

    warning yaml cloudformation, aws, bedrock

    CloudFormation AWS::Bedrock::Agent has no GuardrailConfiguration, so prompts and responses reach the model with no content, PII or prompt-attack filtering at the Bedrock layer. Attach an AWS::Bedrock::Guardrail (with a PROMPT_ATTACK filter) to the agent.

    Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-693 LLM01 LLM06 ASI01 ASI02

    Fix: Add GuardrailConfiguration with GuardrailIdentifier and GuardrailVersion (for example !Ref and !GetAtt of an AWS::Bedrock::Guardrail) to the agent’s Properties.

    References: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-bedrock-agent.html · https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html

    seceng.iacai.cfn-bedrock-guardrail-filter-strength-none

    Section titled “seceng.iacai.cfn-bedrock-guardrail-filter-strength-none”

    warning yaml cloudformation, aws, bedrock

    CloudFormation AWS::Bedrock::Guardrail content filter has strength NONE for one direction, which turns that filter off. Use at least MEDIUM.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-693 LLM01 LLM05 ASI01 ASI02

    Fix: Set InputStrength and OutputStrength to MEDIUM or HIGH on every content filter (PROMPT_ATTACK is covered by its own rule: its OutputStrength must be NONE).

    References: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-bedrock-guardrail-contentfilterconfig.html

    seceng.iacai.cfn-bedrock-guardrail-prompt-attack-none

    Section titled “seceng.iacai.cfn-bedrock-guardrail-prompt-attack-none”

    warning yaml cloudformation, aws, bedrock

    CloudFormation AWS::Bedrock::Guardrail PROMPT_ATTACK filter has InputStrength: NONE, so jailbreak and prompt-injection detection is off. Use HIGH.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-1427 LLM01 ASI01

    Fix: Set InputStrength: HIGH on the PROMPT_ATTACK filter.

    References: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-prompt-attack.html

    seceng.iacai.cfn-sagemaker-endpoint-config-no-kms

    Section titled “seceng.iacai.cfn-sagemaker-endpoint-config-no-kms”

    warning yaml cloudformation, aws, sagemaker

    CloudFormation AWS::SageMaker::EndpointConfig has no KmsKeyId, so the endpoint’s attached storage and captured inference payloads (prompts, completions) are encrypted only with an AWS-managed key you cannot control or audit. Set a customer-managed KMS key.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: reaches content or traffic gets to a thing; it crosses the user->prompt boundary (untrusted input reaching a prompt).

    CWE-311 CWE-320 LLM02 ASI03

    Fix: Set KmsKeyId to a customer-managed key (and DataCaptureConfig.KmsKeyId if capture is enabled).

    References: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-sagemaker-endpointconfig.html

    seceng.iacai.cfn-sagemaker-notebook-direct-internet

    Section titled “seceng.iacai.cfn-sagemaker-notebook-direct-internet”

    warning yaml cloudformation, aws, sagemaker

    CloudFormation AWS::SageMaker::NotebookInstance has DirectInternetAccess: Enabled, giving the notebook (which holds model artifacts and credentials) a path to and from the public internet outside your VPC controls. Set it to Disabled and route through a NAT or VPC endpoints.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: reaches content or traffic gets to a thing; it crosses the user->prompt boundary (untrusted input reaching a prompt).

    CWE-668 LLM02 LLM03 ASI03

    Fix: Set DirectInternetAccess: Disabled, give the notebook a SubnetId, and reach package mirrors through VPC endpoints or a controlled egress path.

    References: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-sagemaker-notebookinstance.html

    seceng.iacai.cfn-bedrock-iam-wildcard-action-resource

    Section titled “seceng.iacai.cfn-bedrock-iam-wildcard-action-resource”

    error yaml cloudformation, aws, bedrock, iam

    IAM policy statement allows bedrock:* on Resource: "*" (CloudFormation or policy JSON). An agent role with it can invoke any model, edit agents and guardrails and read knowledge bases; a prompt-injected agent inherits all of it. Scope actions to bedrock:InvokeModel and similar, on specific ARNs.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).

    CWE-250 CWE-269 LLM06 ASI03

    Fix: List the specific actions (bedrock:InvokeModel, bedrock:Retrieve) and restrict Resource to the exact model, guardrail and knowledge-base ARNs; add a permissions boundary and aws:SourceArn conditions for the agent’s service role.

    References: https://docs.aws.amazon.com/bedrock/latest/userguide/security-iam.html

    seceng.iacai.cfn-bedrock-agent-no-guardrail-json

    Section titled “seceng.iacai.cfn-bedrock-agent-no-guardrail-json”

    warning json cloudformation, aws, bedrock

    CloudFormation AWS::Bedrock::Agent has no GuardrailConfiguration, so prompts and responses reach the model with no content, PII or prompt-attack filtering at the Bedrock layer. Attach an AWS::Bedrock::Guardrail (with a PROMPT_ATTACK filter) to the agent.

    Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-693 LLM01 LLM06 ASI01 ASI02

    Fix: Add GuardrailConfiguration with GuardrailIdentifier and GuardrailVersion (for example !Ref and !GetAtt of an AWS::Bedrock::Guardrail) to the agent’s Properties.

    References: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-bedrock-agent.html · https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html

    seceng.iacai.cfn-bedrock-guardrail-filter-strength-none-json

    Section titled “seceng.iacai.cfn-bedrock-guardrail-filter-strength-none-json”

    warning json cloudformation, aws, bedrock

    CloudFormation AWS::Bedrock::Guardrail content filter has strength NONE for one direction, which turns that filter off. Use at least MEDIUM.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-693 LLM01 LLM05 ASI01 ASI02

    Fix: Set InputStrength and OutputStrength to MEDIUM or HIGH on every content filter (PROMPT_ATTACK is covered by its own rule: its OutputStrength must be NONE).

    References: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-bedrock-guardrail-contentfilterconfig.html

    seceng.iacai.cfn-bedrock-guardrail-prompt-attack-none-json

    Section titled “seceng.iacai.cfn-bedrock-guardrail-prompt-attack-none-json”

    warning json cloudformation, aws, bedrock

    CloudFormation AWS::Bedrock::Guardrail PROMPT_ATTACK filter has InputStrength: NONE, so jailbreak and prompt-injection detection is off. Use HIGH.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-1427 LLM01 ASI01

    Fix: Set InputStrength: HIGH on the PROMPT_ATTACK filter.

    References: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-prompt-attack.html

    seceng.iacai.cfn-sagemaker-endpoint-config-no-kms-json

    Section titled “seceng.iacai.cfn-sagemaker-endpoint-config-no-kms-json”

    warning json cloudformation, aws, sagemaker

    CloudFormation AWS::SageMaker::EndpointConfig has no KmsKeyId, so the endpoint’s attached storage and captured inference payloads (prompts, completions) are encrypted only with an AWS-managed key you cannot control or audit. Set a customer-managed KMS key.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: reaches content or traffic gets to a thing; it crosses the user->prompt boundary (untrusted input reaching a prompt).

    CWE-311 CWE-320 LLM02 ASI03

    Fix: Set KmsKeyId to a customer-managed key (and DataCaptureConfig.KmsKeyId if capture is enabled).

    References: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-sagemaker-endpointconfig.html

    seceng.iacai.cfn-sagemaker-notebook-direct-internet-json

    Section titled “seceng.iacai.cfn-sagemaker-notebook-direct-internet-json”

    warning json cloudformation, aws, sagemaker

    CloudFormation AWS::SageMaker::NotebookInstance has DirectInternetAccess: Enabled, giving the notebook (which holds model artifacts and credentials) a path to and from the public internet outside your VPC controls. Set it to Disabled and route through a NAT or VPC endpoints.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: reaches content or traffic gets to a thing; it crosses the user->prompt boundary (untrusted input reaching a prompt).

    CWE-668 LLM02 LLM03 ASI03

    Fix: Set DirectInternetAccess: Disabled, give the notebook a SubnetId, and reach package mirrors through VPC endpoints or a controlled egress path.

    References: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-sagemaker-notebookinstance.html

    seceng.iacai.cfn-bedrock-iam-wildcard-action-resource-json

    Section titled “seceng.iacai.cfn-bedrock-iam-wildcard-action-resource-json”

    error json cloudformation, aws, bedrock, iam

    IAM policy statement allows bedrock:* on Resource: "*" (CloudFormation or policy JSON). An agent role with it can invoke any model, edit agents and guardrails and read knowledge bases; a prompt-injected agent inherits all of it. Scope actions to bedrock:InvokeModel and similar, on specific ARNs.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).

    CWE-250 CWE-269 LLM06 ASI03

    Fix: List the specific actions (bedrock:InvokeModel, bedrock:Retrieve) and restrict Resource to the exact model, guardrail and knowledge-base ARNs; add a permissions boundary and aws:SourceArn conditions for the agent’s service role.

    References: https://docs.aws.amazon.com/bedrock/latest/userguide/security-iam.html