Skip to content

Add a self-contained SOCA Lambda@Edge MVP - #1

Open
OllieJC wants to merge 3 commits into
mainfrom
feat/lambda-edge-mvp
Open

OllieJC wants to merge 3 commits into
mainfrom
feat/lambda-edge-mvp

Conversation

@OllieJC

@OllieJC OllieJC commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Gate private S3 static content before CloudFront cache delivery using one Lambda@Edge viewer-request handler. A local generator produces a deployment-specific ZIP containing bundled JavaScript, configuration, an ES256 signing key/JWKS and AES-256-GCM session keys. Sessions default to 43,200 seconds, configurable in seconds. Optional enable_readable_id_token_cookie (default false) publishes the full validated provider JWT in a separate JavaScript-readable __Host-soca_id_token cookie, capped by token/session expiry, cleared on logout and stripped from origin requests. The encrypted session remains HttpOnly and controls access. Normal authenticated content requests use local cryptography; sign-in contacts only the trusted identity provider. No runtime AWS SDK, KMS, Secrets Manager or database.

Includes reusable Terraform and CloudFormation function deployment, a private S3/OAC/CloudFront Terraform example, an HTTPS demo container with a clearly labelled identity-provider simulator, CI, Dependabot, CodeQL and an assessment of all 34 SOCA requirements. Generated secret-bearing packages stay out of Git and public CI artefacts.

Validation: 67 tests pass locally and inside the Podman demo container with external networking disabled. Tests cover code/PKCE/private_key_jwt, ID-token/admission failures, browser binding, cookie tampering, expiry, local logout, readable JWT opt-in/verification/expiry/size/cleanup, staged key overlap, real TLS transport and the executable standalone ZIP. Example package is about 32 KB. Terraform formatting/validation and cfn-lint pass; npm audit reports no vulnerabilities. Real HTTPS RESOAuth discovery succeeded.

MVP limits: one issuer and ES256; stateless operation cannot guarantee atomic transaction consumption across edge replicas or individually revoke copied session cookies. Automated rotation, candidate-only operator testing/enforced activation, real AWS deployment, live-provider browser sign-in and OIDC conformance remain unverified or planned. Production activation is manual; see docs/requirements.md and docs/security.md.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread tests/package.test.mjs Fixed
Comment thread tests/package.test.mjs Fixed
Comment thread tests/package.test.mjs Fixed
Comment thread src/network.mjs Dismissed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants