Skip to content

fix(0-bootstrap): let the Stage 0 folders inherit the logging settings - #361

Merged
aghassemlouei merged 1 commit into
google:mainfrom
digitalresistor:fix/bootstrap-folder-logging
Oct 26, 2026
Merged

aghassemlouei merged 1 commit into
google:mainfrom
digitalresistor:fix/bootstrap-folder-logging

Conversation

@digitalresistor

Copy link
Copy Markdown
Contributor

Description

Let the first Stage 0 apply finish under Assured Workloads regimes that enforce CMEK for Logging, such as IL5, by letting the Stage 0 folders inherit the organization logging settings.

The fast/stages-aw/0-bootstrap/ stage sets the same storage_location value three times: on the organization, on the common services folder, and on the no-compliance folder. The common services folder sits under the Assured Workloads folder. IL5 enforces the constraints/gcp.restrictNonCmekServices constraint for logging.googleapis.com there, so the API rejects folder logging settings without a KMS key, and the modules/folder/ module has no CMEK input for them.

  • Folder logging settings inherit from the nearest ancestor that sets them, so both folders already get the storage location from the organization settings that Stage 0 applies first.
  • The change removes the logging_settings argument from the branch-common-services-folder and no-compliance-folder modules in the organization.tf file.
  • A comment next to the organization-logging module now explains why the folders set no settings of their own.
  • A new test in the tests/test_bootstrap_logging_order.py file checks that only the organization sets the logging settings.
  • Released versions never created these folder settings, because the request returned 404 until fix(modules/folder): pass the folder number to the logging settings #359.
  • A deployment that applies fix(modules/folder): pass the folder number to the logging settings #359 first under a regime without CMEK enforcement for Logging plans a destroy of the folder settings, which only removes them from the Terraform state and leaves the inherited values in place.
  • The change needs no README update, because no variable or output changes.

No GitHub issue exists for this change. The stellar CLI work in #306 found it during a lab Stage 0 apply, right after #359 fixed the folder number.

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: None changed. The folders keep the organization log storage location, which supports the existing regional data boundary, and the change leaves the CMEK enforcement in place.

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

  • A lab IL5 Stage 0 apply failed on module.branch-common-services-folder.google_logging_folder_settings.default[0] with a constraints/gcp.restrictNonCmekServices violation for logging.googleapis.com.
  • The effective policy on the lab Assured Workloads folder lists logging.googleapis.com among the services that require CMEK.
  • The organization logging settings applied in the same lab run.
  • terraform init -backend=false and terraform validate pass for the fast/stages-aw/0-bootstrap/ stage.
  • terraform fmt -check passes for the stage.
  • uv run --locked pytest in the repository root passes 109 tests.
  • The new test fails against the code on main.

Under Assured Workloads regimes that enforce CMEK for Logging through
constraints/gcp.restrictNonCmekServices, such as IL5, the API rejects
folder logging settings without a KMS key, and the folder module has no
CMEK input. The common services folder therefore failed the first
Stage 0 apply. The folders gain nothing from their own settings,
because Stage 0 already applies the same storage location on the
organization and folders inherit it.

- Remove logging_settings from the common services and no-compliance
  folders.
- Explain the inheritance next to the organization settings.
- Add a test that only the organization sets the logging settings.
@github-actions github-actions Bot added the Scope - Fast Related to Fabric FAST deployment stages in the fast directory label Oct 26, 2026
@aghassemlouei
aghassemlouei enabled auto-merge (squash) October 26, 2026 18:28
@digitalresistor

digitalresistor commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Fixing the issue found by CI/CD.

edit: it is in gem4gov CLI testing...

@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 - 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 labels Oct 26, 2026

@aghassemlouei aghassemlouei left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified fast/stages-aw/0-bootstrap across both IL5 and COMPLIANCE_REGIME_UNSPECIFIED configurations alongside bash tools/run_tests.sh and bash tools/lint.sh:

  • Setting logging_settings exclusively on module.organization-logging while retaining depends_on = [module.organization-logging] on module.no-compliance-folder and module.branch-common-services-folder preserves regional log storage inheritance from the organization and avoids CMEK kms_key_name rejection on google_logging_folder_settings.default[0] inside IL5 and FEDRAMP_HIGH Assured Workloads folders.
  • tests/test_bootstrap_logging_order.py (test_only_the_organization_sets_logging_settings) passes cleanly.
  • Re-ran the Python Unit Tests & Code Quality workflow job after the test_generate_id_format flake addressed in #362, and all CI checks are now green.

@aghassemlouei
aghassemlouei merged commit 0a140dd into google:main Oct 26, 2026
21 of 22 checks passed
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 - 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 - Fast Related to Fabric FAST deployment stages in the fast directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants