Skip to content

sec(iac): production Lambda Function URL uses authorization_type=NONE — no IAM gate #424

Closed

Description

@cristim

Files:

  • terraform/modules/compute/aws/lambda/variables.tf lines 94-96 (default function_url_auth_type = "NONE")
  • terraform/environments/aws/github-prod.tfvars line 27: lambda_function_url_auth_type = "NONE" (line 28 also has lambda_allowed_origins = ["*"] with a TODO)
  • terraform/environments/aws/github-dev.tfvars line 27-28: same
  • terraform/modules/compute/aws/lambda/main.tf lines 130-137 grants principal = "*" when auth_type == "NONE"

The Lambda Function URL in production is publicly invokable with no AWS IAM check — the application's own auth layer is the only gate. Any unauthenticated network request reaches the Lambda handler. The allowed_origins = ["*"] in prod amplifies exposure (cross-references #390 for the CORS variant).

The CloudFormation template cloudformation/stacks/CUDly/template.yaml is structured better — uses AuthType: AWS_IAM with a CloudFront OAC, gating the Function URL behind CloudFront. The Terraform-managed deployment does not replicate this.

Fix: Either set lambda_function_url_auth_type = "AWS_IAM" and front Lambda with CloudFront OAC, or document the application-layer mitigations that replace IAM auth. Also resolve the TODO on lambda_allowed_origins in github-prod.tfvars.

Activity

  1. cristim commented on May 19, 2026

    @cristim
    MemberAuthor

    PR #519 (CORS hardening) initially listed this issue under closes but the CORS fix is a separate concern. This issue still tracks the Function URL authorization_type=NONE → AWS_IAM switch + the matching IAM grant + frontend signing changes.

  2. added 7 commits that reference this issue on May 20, 2026
    2313366
    ca51ba6
    fc37407
    6e8d69d
    53e3638
    dc971f7
    f65998a
  3. cristim commented on May 28, 2026

    @cristim
    MemberAuthor

    Verification: cannot-verify-autopilot. PR #519 (CORS wildcard rejection, merged 2026-05-20) and PR #574 (OAC scaffolding, merged 2026-05-28) are both in feat/multicloud-web-frontend. However, PR #574 explicitly keeps all three tfvar environments at authorization_type=NONE with TODO cut-over comments until enable_cdn=true is set: 'All three env tfvars keep NONE with a TODO(#424) cut-over comment until enable_cdn = true is set and CloudFront is deployed.' Live Lambda URL at https://33pz7pombdqwu3bdlxp4lqxyra0bsriy.lambda-url.us-east-1.on.aws/health returns HTTP 200 without IAM signing, confirming auth_type=NONE is still in effect. The structural fix (OAC + auth_type derivation) is merged but the production environment has not been switched. Leaving open pending enable_cdn=true deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions