# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
# sample subset of useful organization policies, edit to suit requirements
# start of document (---) avoids errors if the file only contains comments

# yaml-language-server: $schema=../../../../schemas/org-policies.schema.json

compute.disableVpcInternalIpv6:
  rules:
    - enforce: true

compute.requireVpcFlowLogs:
  rules:
    - allow:
        values:
          - "ESSENTIAL"
          - "LIGHT"
          - "COMPREHENSIVE"

compute.restrictCloudNATUsage:
  rules:
    - allow:
        values:
          - "under:${folder_ids.networking}"

compute.restrictDedicatedInterconnectUsage:
  rules:
    - allow:
        values:
          - "under:${folder_ids.networking}"

compute.restrictPartnerInterconnectUsage:
  rules:
    - allow:
        values:
          - "under:${folder_ids.networking}"

compute.restrictSharedVpcHostProjects:
  rules:
    - allow:
        values:
          - "under:${folder_ids.networking}"

compute.restrictVpcPeering:
  rules:
    - allow:
        values:
          - "under:organizations/${organization.id}"

# compute.restrictVpnPeerIPs:
#   rules:
#     - allow:
#         values:
#           - "1.1.1.1"
#           - "2.2.2.2"

custom.networkDisableTargetHTTPProxy:
  rules:
    - enforce: true

custom.networkDisableWeakSSLPolicy:
  rules:
    - enforce: true

custom.networkRequireBackendServiceLogging:
  rules:
    - enforce: true

custom.networkRequireCustomModeVpc:
  rules:
    - enforce: true
