Skip to content

fix(stages): harden Stage 2 networking, Stage 3 security, and tooling scripts - #350

Closed
aghassemlouei wants to merge 1 commit into
mainfrom
fix/stages-2-3-networking-security-and-tools
Closed

aghassemlouei wants to merge 1 commit into
mainfrom
fix/stages-2-3-networking-security-and-tools

Conversation

@aghassemlouei

@aghassemlouei aghassemlouei commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Description

Hardens Stage 2 (2-networking-a-fedramp and 2-networking-b-il5-ngfw), Stage 3 (3-security), and repository shell scripts:

  • Fix Stage 2 host_project_ids output, add default hierarchical firewall policy factory data files (cidrs.yaml and hierarchical-ingress-rules.yaml), reference module.env-spoke-projects[each.key].project_id in psc.tf, and gate PSC/PSA resources when psa_ranges is configured.
  • Parameterize NGFW template region (each.value) in 2-networking-b-il5-ngfw, disable serial port access, block project-wide SSH keys, and harden PAN-OS bootstrap crypto and management profiles.
  • Restrict Stage 3 local tfvars file permissions to 0600, encrypt GCS tfvars objects with CMEK and mark content sensitive, fix VPC-SC logging project fallback and dry-run active status preservation, and scope dev/prod KMS restricted admins to environment-specific service accounts.
  • Expand sa_lockdown.sh service account coverage with nullglob, update validation.sh IaC core project filter, replace eval in scripts/destroy.sh with printf -v, harden scripts/restore.sh and tools/create_e2e_sandbox.sh, and fix the Stage 2a path in generate-mocks.sh.

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: AC-3, AC-4, AC-6, CM-6, SC-7, SC-12, SC-28

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

  • Verified bash tools/lint.sh passes all 10 repository checks (Boilerplate check, Terraform format, Terraform lint, READMEs, Links, FAST Names, Python formatting, Python lint, Blueprint metadata, Version checks).
  • Verified bash tools/run_tests.sh, ruff check ., and ruff format --check . pass with zero errors.

@aghassemlouei aghassemlouei added Bug Something isn't working Framework - FedRAMP High FedRAMP High compliance regime and controls Framework - IL5 DoD Impact Level 5 (IL5) compliance regime and controls Level of Effort - Medium Moderate task requiring thought and testing; typically takes a couple of days to a week Priority - High Critical issues blocking development or users; urgent bugs or core features for release Scope - Fast Related to Fabric FAST deployment stages in the fast directory Security Something is insecure or can be secured labels Oct 23, 2026
@aghassemlouei
aghassemlouei force-pushed the fix/stages-2-3-networking-security-and-tools branch from 983a117 to 4ed9b30 Compare October 26, 2026 17:27
… scripts

- Fix Stage 2 host_project_ids output, add default hierarchical firewall policy factory data files, remove redundant private.googleapis.com routes, and gate PSC/PSA address and connection resources when psa_ranges is configured
- Remove management VPC default internet route and Cloud NAT, parameterize NGFW template region, disable serial console, block project SSH keys, and harden PAN-OS bootstrap crypto and management profiles
- Restrict Stage 3 tfvars file permissions to 0600, mark GCS tfvars object content sensitive with CMEK encryption, fix VPC-SC logging project fallback and dry-run active status preservation, and scope dev/prod KMS restricted admins to environment-specific service accounts
- Expand sa_lockdown.sh service account coverage with nullglob, relax validation.sh project filter to match stage-specific IaC core naming, replace eval in scripts/destroy.sh with printf -v, harden scripts/restore.sh and tools/create_e2e_sandbox.sh, and update generate-mocks.sh Stage 2a path
@aghassemlouei
aghassemlouei force-pushed the fix/stages-2-3-networking-security-and-tools branch from 4ed9b30 to e259ba2 Compare October 28, 2026 04:09
@aghassemlouei

Copy link
Copy Markdown
Member Author

Rebased onto main (db8271cf) and refined the diff to preserve existing Stage 2 private.googleapis.com routes, management VPC Cloud NAT, and default-peering PSC address names/prefix lengths while dropping the hardcoded compute.requireOsLogin import in scripts/restore.sh to stay compatible with regime-conditional OS Login in #293.

@aghassemlouei

Copy link
Copy Markdown
Member Author

Closing this multi-directory bundle PR so Stage 2, Stage 3, and script fixes can land in smaller, single-purpose pull requests against current main. The remaining Stage 2 networking findings are tracked in #370 and the Stage 3 security and script findings are tracked in #371 under #33.

@aghassemlouei
aghassemlouei deleted the fix/stages-2-3-networking-security-and-tools branch October 28, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Framework - FedRAMP High FedRAMP High compliance regime and controls Framework - IL5 DoD Impact Level 5 (IL5) compliance regime and controls Level of Effort - Medium Moderate task requiring thought and testing; typically takes a couple of days to a week Priority - High Critical issues blocking development or users; urgent bugs or core features for release Scope - Fast Related to Fabric FAST deployment stages in the fast directory Security Something is insecure or can be secured

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant