# Copyright 2021 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.

apiVersion: constraints.gatekeeper.sh/v1alpha1
kind: GCPVPCSCEnsureProjectConstraintV1
metadata:
  name: vpc_sc_ensure_project
  annotations:
    description: Checks if a VPC Service Controls perimeter has correct projects in
      them.
spec:
  severity: high
  match:
    gcp:
      target: # {"$ref":"#/definitions/io.k8s.cli.setters.target"}
      - "organizations/**"
  parameters:
    required_projects:
    - "NON_CONFIDENTIAL_DATA_PROJECT_NUMBER_1"
    - "NON_CONFIDENTIAL_DATA_PROJECT_NUMBER_2"
    - "DATA_INGESTION_PROJECT_NUMBER_1"
    - "DATA_INGESTION_PROJECT_NUMBER_2"
    - "DATA_GOVERNANCE_PROJECT_NUMBER_1"
    - "DATA_GOVERNANCE_PROJECT_NUMBER_2"
    - "CONFIDENTIAL_PROJECT_NUMBER_1"
    - "CONFIDENTIAL_PROJECT_NUMBER_2"
