Skip to content

Trongnhanphan#282

Merged
trongnhanphan223878459 merged 24 commits intodevfrom
trongnhanphan
Feb 3, 2026
Merged

Trongnhanphan#282
trongnhanphan223878459 merged 24 commits intodevfrom
trongnhanphan

Conversation

@trongnhanphan223878459
Copy link
Contributor

Finalizing policies and inputs for the Apikeys and Biglake service

trongnhanphan223878459 and others added 19 commits December 7, 2025 19:33
)

- Updated import statements in all policy.rego files to replace
`data.terraform.gcp.helpers` with `data.terraform.helpers` to point at
refactored helpers.
…253)

Refactors how the auto-test script locates and loads shared policy
helpers, ensuring robust and flexible handling of policy directory
structures. The goal is to make it easier for users to run policy tests
from service-specific directories while guaranteeing that the shared
`_helpers` module is always available for OPA evaluation. Additionally,
it removes a deprecated GCP helper shim, as all policies now use the
unified helpers location.

Key changes include:
* Added a `normalize_policies_root` function in `auto_test.py` to
traverse up from the user-provided policies directory to find the root
containing the `_helpers` module.
* Removed the obsolete `policies/gcp/_helpers/helpers.rego` shim, as GCP
policies now directly use the unified `terraform.helpers` module.
* Changed the `terraform show` command in `run_terraform_commands` to
use a pipe (`| cat > plan.json`) for improved cross-platform
compatibility.
Output of local run of auto-test - see my comment below for github
auto-test results explanation.

Summary of policy checks:
Service: access_context_manager_vpc_service_controls
  Resource: google_access_context_manager_access_level
    Policy: require_admin_approval - ✅
    Policy: os_type - ✅
    Policy: region - ✅
    Policy: combining_function - ✅
    Policy: require_corp_owned - ✅
    Policy: allowed_encryption_statuses - ✅
    Policy: require_screen_lock - ✅
    Policy: allowed_device_management_levels - ✅
  Resource: google_access_context_manager_access_level_condition
    Policy: require_admin_approval - ✅
    Policy: os_type - ✅
    Policy: region - ✅
    Policy: require_corp_owned - ✅
    Policy: require_screen_lock - ✅
  Resource: google_access_context_manager_access_levels
    Policy: os_type - ✅
    Policy: region - ✅
    Policy: require_screen_lock - ✅
  Resource: google_access_context_manager_service_perimeter
    Policy: status - ✅
This reverts commit fbf85fc.
Copy link
Contributor

@Shani1116 Shani1116 left a comment

Choose a reason for hiding this comment

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

  1. Policies for google_biglake_iceberg_catalog/ google_biglake_iceberg_catalog_iam are missing. Were you not able to find any security relevant attributes in these two resources?
  2. More policies can be written for google_biglake_table - such as TABLE_TYPE and sql version, etc.

@Shani1116 Shani1116 self-assigned this Feb 1, 2026
Copy link
Contributor

@Shani1116 Shani1116 left a comment

Choose a reason for hiding this comment

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

Resolved all PR comments. Approved!

@trongnhanphan223878459 trongnhanphan223878459 merged commit 38ab6e7 into dev Feb 3, 2026
1 check failed
@trongnhanphan223878459 trongnhanphan223878459 deleted the trongnhanphan branch February 3, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants