Skip to content

Conversation

@vannicktrinquier
Copy link
Collaborator

@vannicktrinquier vannicktrinquier commented Jan 9, 2026

This PR focuses on tightening security controls to align with the principle of Least Privilege for the various service account, and specifically targeting hardened datasets.

It also includes configuration updates to address findings (or false positives) from compliance standards like CIS GCP, CIS GKE, and NIST, ensuring the foundation can be ready for more sensitive organization (FSI)

Main changes:

  • Restricted IAM permissions on hardened datasets to ensure only authorized service accounts and groups have access.
  • Applied least privilege to prevent over-privileged access patterns in the data layer (by not using basic roles anymore)
  • Update various configurations to satisfy NIST controls (storage lifecycle, log retention, firewall logs, vpc flow logs)
  • Enforce Organization Policy compute.disableVpcInternalIpv6 as recommended by Compliance Manager
  • Provide commented sample of configuration to enable VPC Flow Logs at subnet level, logging on firewall rules ...

I applicable, I acknowledge that I have:

  • Read the contributing guide
  • Ran terraform fmt on all modified files
  • Regenerated the relevant README.md files using tools/tfdoc.py
  • Made sure all relevant tests pass

@github-actions github-actions bot added on:FAST on:tools New or changed tool labels Jan 9, 2026
```tfvars
factories_config = {
defaults = "datasets/hardened/defaults.yaml"
folders = "datasets/hardened/folders"
Copy link
Collaborator Author

@vannicktrinquier vannicktrinquier Jan 9, 2026

Choose a reason for hiding this comment

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

Update documentation which was incomplete previously.

Also mainly in this PR datasets/hardened/folders has been added with drift with classic datasets as follow mainly:

  • classic still use owner and viewer role for *-rw and *-ro service account
  • hardened now use predefined and custom roles.

Tests have been done extensively already to validate the permissions are the good ones:

  • stage 0 to 3 tested (except 3-secops and 3-gcve-dev) but rest has been validate


# yaml-language-server: $schema=../../../../schemas/custom-role.schema.json
# the following permissions are a descoped version of storage.admin

Copy link
Collaborator Author

@vannicktrinquier vannicktrinquier Jan 9, 2026

Choose a reason for hiding this comment

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

All the roles created below ar eneeded because generally predenefined roles does not provided permissions for *. getIamPolicy

This requires creation of multiple roles so readonly service account can retrieve iam policy when doing terraform plan in pipeline

- bigquerydatatransfer.googleapis.com
- cloudkms.googleapis.com
- logging.googleapis.com
- storage.googleapis.com
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Use authoritative bindings for roles/owner, this to ensure:

  • no roles owner permissions are provided
  • but also, when a project is created, the creator principal is automatically being set as owner of the project. This ensure that once project is created, the owner role is removed to the creator

keys:
bigquery:
rotation_period: 7776000s
log_buckets:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done in hardened datasets to follow NIST requirements where logs have to be made available at least for 90d.

iac-outputs:
description: Terraform state for the org-level automation.
versioning: true
encryption_key: $kms_keys:iac-0/ew1/storage
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Compliance requirement to update storage class based on object activity

ingress_rules:
allow-healthchecks:
description: Enable SSH, HTTP and HTTPS healthchecks
priority: 1001
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For 2-networking and 2-project-factory, i have added commented line to ensure:

  • logging enablement
  • enforce owner role removed for project creator
  • log retention
  • vpc flow logs

Those have been commented only

var.billing_account.id
)
), null)
prefix = coalesce(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Was buggy when both var.data_defaults.billing_account and var.billing_account.id were empty

@vannicktrinquier vannicktrinquier marked this pull request as ready for review January 9, 2026 05:02
@vannicktrinquier vannicktrinquier changed the title Principle of least privilege to hardened dataset and various compliance configuration Implement various compliance configuration and principle of least privilege for hardened dataset Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on:FAST on:tools New or changed tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant