ALB-direct deployment mode - Public Endpoint with IP filtering - #610
Open
jantmer wants to merge 1 commit into
Open
ALB-direct deployment mode - Public Endpoint with IP filtering#610jantmer wants to merge 1 commit into
jantmer wants to merge 1 commit into
Conversation
…rational improvements ## Terraform ECS — ALB-direct mode (no Route53/CloudFront) Support deploying the stack without Route53 DNS or CloudFront by falling back to the Keycloak ALB DNS name directly. This enables deployments in environments where custom domains or CloudFront are not available. - Resolve keycloak_domain to ALB DNS when both Route53 and CloudFront are disabled (main.tf, keycloak-ecs.tf) - Derive protocol (http/https) dynamically based on TLS availability in the mcp-gateway module (locals.tf) - Configure Keycloak for HTTP mode: set KC_HOSTNAME_STRICT_HTTPS=false, KC_HTTP_ENABLED=true, and override entrypoint with --spi-realm-default-ssl-required=NONE - Add HTTP (port 80) security group rules for auth-server, registry, and NAT gateway ingress to the Keycloak ALB - Enable ECS Exec on the Keycloak service for operational debugging - Update registry_url output to fall back through CloudFront then ALB ## Secrets Manager SCP compliance Satisfy organization SCPs that require KMS encryption and automatic rotation on all Secrets Manager secrets. - Add secrets-compliance.tf with a dedicated KMS key, key alias, no-op rotation Lambda, and rotation schedules for root-module secrets - Add kms_key_id to every aws_secretsmanager_secret in the module (secrets.tf) and root module (documentdb.tf, keycloak-database.tf) - Add 90-day rotation schedules for all module-level secrets - Grant ECS tasks kms:Decrypt and kms:GenerateDataKey on the secrets key - Pass secrets_kms_key_arn and secrets_rotation_lambda_arn into the mcp-gateway module via new variables - Export secrets_kms_key_arn as a terraform output - Update init-keycloak.sh to resolve and pass --kms-key-id when updating Keycloak client secrets in Secrets Manager ## Auth server — JWT fallback for network-trusted mode When the static API token doesn't match, fall through to JWT validation instead of returning 403. This allows both static tokens and JWT bearer tokens to authenticate registry API requests in network-trusted mode. ## Scopes and group mappings - Add mcp-registry-admin and mcp-servers-unrestricted to the registry-admins group_mappings in registry-admins.json - Add mcp-servers-unrestricted group mapping in scopes.yml for M2M service accounts ## DocumentDB initialization - Re-enable load-scopes.py in run-documentdb-init.sh so that group_mappings and UI-Scopes from scopes.yml are loaded into DocumentDB at init time ## init-keycloak.sh — HTTP mode realm SSL override When Keycloak is running in HTTP mode, use ECS Exec to run kcadm.sh inside the container and set sslRequired=NONE on the master and mcp-gateway realms. This is necessary because Keycloak persists sslRequired per-realm in the database and no env var can change it retroactively. ## Build tooling - Support Finch/nerdctl as an alternative container runtime in build-images.sh via CONTAINER_RUNTIME env var - Use #!/usr/bin/env bash for portability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Terraform ECS — ALB-direct mode (no Route53/CloudFront)
Support deploying the stack without Route53 DNS or CloudFront by falling back to the Keycloak ALB DNS name directly. This enables deployments in environments where custom domains or CloudFront are not available.
Secrets Manager SCP compliance
Satisfy organization SCPs that require KMS encryption and automatic rotation on all Secrets Manager secrets.
Auth server — JWT fallback for network-trusted mode
When the static API token doesn't match, fall through to JWT validation instead of returning 403. This allows both static tokens and JWT bearer tokens to authenticate registry API requests in network-trusted mode.
Scopes and group mappings
DocumentDB initialization
init-keycloak.sh — HTTP mode realm SSL override
When Keycloak is running in HTTP mode, use ECS Exec to run kcadm.sh inside the container and set sslRequired=NONE on the master and mcp-gateway realms. This is necessary because Keycloak persists sslRequired per-realm in the database and no env var can change it retroactively.
Build tooling
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.