Skip to content

fix(gitlab): store gitlab.rb and TLS key in Secret Manager and validate hostname - #295

Merged
pulsingSignal merged 1 commit into
mainfrom
fix/gitlab-secret-manager-and-hostname-validation
Nov 6, 2026
Merged

pulsingSignal merged 1 commit into
mainfrom
fix/gitlab-secret-manager-and-hostname-validation

Conversation

@aghassemlouei

@aghassemlouei aghassemlouei commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Description

  • Provision google_secret_manager_secret.gitlab_rb and google_secret_manager_secret.gitlab_ssl_key with secret versions and roles/secretmanager.secretAccessor IAM bindings in blueprints/third-party-solutions/gitlab/gitlab.tf, and fetch gitlab.rb and the TLS private key via gcloud secrets versions access latest in blueprints/third-party-solutions/gitlab/assets/cloud-config.yaml rather than storing sensitive values in cleartext GCE instance metadata.
  • Enable secretmanager.googleapis.com in blueprints/third-party-solutions/gitlab/main.tf, wire gitlab_rails['redis_password'] to google_redis_instance.cache.auth_string in blueprints/third-party-solutions/gitlab/assets/config.rb.tpl, guard /tmp/gitlab/sshd_config and /tmp/gitlab/ssl/${gitlab_cert_name}.crt preparation with [ ! -f ... ] || and quote "${gitlab_config.hostname}" in blueprints/third-party-solutions/gitlab/assets/cloud-config.yaml, validate gitlab_config.hostname as an RFC 1123 hostname in blueprints/third-party-solutions/gitlab/variables.tf, and mark output "instance" as sensitive = true in blueprints/third-party-solutions/gitlab/outputs.tf (updating README.md) so root-module plans succeed when var.gitlab_config is interpolated into module.gitlab-instance.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Deployment & Compliance Impact

  • Applicable Regimes:
    • US Region Restricted (e.g., Access Policy constraint)
    • FedRAMP Moderate
    • FedRAMP High
    • DoD IL4
    • DoD IL5
    • General / All
  • NIST 800-53r5 Controls: SC-7, SC-12, SC-13, SC-28, AC-2, AC-3, AC-6, CM-2, CM-6

Checklist

Code Quality & Reusability

  • My code adheres to the Maximize Reusability principle. I have not redefined common elements and have reused existing base configurations and modules where possible.
  • I have checked that no existing module or configuration in modules/ or fast/stages-aw/ can be leveraged for this change.
  • My code follows the established naming conventions outlined in docs/naming-convention.md.

Documentation

  • I have updated the README.md of the modified module or blueprint.
  • I have added/updated documentation for inputs (variables) and outputs.

Security

  • My change adheres to GCP security best practices and the principle of least privilege.
  • I have ensured compliance with the targeted regime (FedRAMP Moderate, FedRAMP High, IL4, IL5, etc.).

Testing

  • I have tested my changes locally.
  • I have included details of my testing in this PR.

Testing Performed

  • Executed bash tools/run_tests.sh, bash tools/lint.sh, and uv run --project . --locked python tools/check_documentation.py blueprints/third-party-solutions/gitlab.
  • Verified with terraform init and terraform plan in blueprints/third-party-solutions/gitlab.

@aghassemlouei aghassemlouei added Bug Something isn't working Priority - High Critical issues blocking development or users; urgent bugs or core features for release Status - Ready for Review labels Oct 20, 2026
@github-actions github-actions Bot added the Scope - Blueprint Related to solution blueprints in the blueprints directory label Oct 20, 2026
@aghassemlouei
aghassemlouei force-pushed the fix/gitlab-secret-manager-and-hostname-validation branch 2 times, most recently from 6cb79e5 to 832db99 Compare October 20, 2026 22:33
@aghassemlouei aghassemlouei added Security Something is insecure or can be secured Level of Effort - Low Quick, well-defined tasks with no unknowns; takes a few hours up to one day to complete and removed Blueprint labels Oct 20, 2026
@aghassemlouei
aghassemlouei force-pushed the fix/gitlab-secret-manager-and-hostname-validation branch 12 times, most recently from 099dfca to c8eae5d Compare October 23, 2026 12:46
@aghassemlouei
aghassemlouei force-pushed the fix/gitlab-secret-manager-and-hostname-validation branch 3 times, most recently from 52a802d to 1be5869 Compare October 28, 2026 17:44
@pulsingSignal

Copy link
Copy Markdown
Collaborator

@aghassemlouei Could you please rebase this branch onto main? The failing Stellar CLI Tests & Code Quality checks are from the base main commit right after #352 (before the Stage 0 CLI test updates in #389 landed), so a rebase onto main will get CI/CD passing.

@aghassemlouei
aghassemlouei force-pushed the fix/gitlab-secret-manager-and-hostname-validation branch from b127bc3 to 4de665b Compare November 6, 2026 14:48
@github-actions github-actions Bot added Documentation Improvements or additions to documentation Framework - FedRAMP Moderate FedRAMP Moderate compliance regime and controls Framework - FedRAMP High FedRAMP High compliance regime and controls Framework - IL4 DoD Impact Level 4 (IL4) compliance regime and controls Framework - IL5 DoD Impact Level 5 (IL5) compliance regime and controls labels Nov 6, 2026
@aghassemlouei

Copy link
Copy Markdown
Member Author

@aghassemlouei Could you please rebase this branch onto main? The failing Stellar CLI Tests & Code Quality checks are from the base main commit right after #352 (before the Stage 0 CLI test updates in #389 landed), so a rebase onto main will get CI/CD passing.

Done and done!

@pulsingSignal

Copy link
Copy Markdown
Collaborator

LGTM!

@pulsingSignal
pulsingSignal enabled auto-merge (squash) November 6, 2026 15:18
@pulsingSignal
pulsingSignal merged commit 8ee6ffe into main Nov 6, 2026
22 checks passed
@pulsingSignal
pulsingSignal deleted the fix/gitlab-secret-manager-and-hostname-validation branch November 6, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Documentation Improvements or additions to documentation Framework - FedRAMP High FedRAMP High compliance regime and controls Framework - FedRAMP Moderate FedRAMP Moderate compliance regime and controls Framework - IL4 DoD Impact Level 4 (IL4) compliance regime and controls Framework - IL5 DoD Impact Level 5 (IL5) compliance regime and controls Level of Effort - Low Quick, well-defined tasks with no unknowns; takes a few hours up to one day to complete Priority - High Critical issues blocking development or users; urgent bugs or core features for release Scope - Blueprint Related to solution blueprints in the blueprints directory Security Something is insecure or can be secured

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants