PaloAltoNetworks / terraform-provider-prismacloudcompute

Terraform provider for Prisma Cloud Compute
https://registry.terraform.io/providers/PaloAltoNetworks/prismacloudcompute/latest
Mozilla Public License 2.0
24 stars 28 forks source link

Add coderepo compliance and coderepo compliance ci resources #47

Closed hi-artem closed 2 years ago

hi-artem commented 2 years ago

Description

This pr adds 2 new resources to manage coderepo compliance.

How Has This Been Tested?


resource "prismacloudcompute_collection" "coderepo_collection" {
  name              = "test-coderepo-test"
  description       = "Collection for some coderepo"
  color             = "#FF0000"
  application_ids   = ["*"]
  code_repositories = ["virtru/test-app"]
  images            = ["*"]
  labels            = ["*"]
  namespaces        = ["*"]
  account_ids       = ["*"]
  clusters          = ["*"]
  containers        = ["*"]
  functions         = ["*"]
  hosts             = ["*"]
}

resource "prismacloudcompute_coderepo_compliance_policy" "ruleset" {
  rule {
    name        = "${prismacloudcompute_collection.coderepo_collection.name}-compliance"
    collections = [prismacloudcompute_collection.coderepo_collection.name]
    effect      = "alert"

    license {
      alert_threshold {
        enabled = true
        value   = 3
      }
      critical = ["GPL-1.0", "GPL-2.0"]
      high = ["GPL-1.0"]
      medium = ["AAL"]
      low = []
    }
  }
}

resource "prismacloudcompute_ci_coderepo_compliance_policy" "ruleset" {
  rule {
    name        = "${prismacloudcompute_collection.coderepo_collection.name}-ci-compliance"
    collections = [prismacloudcompute_collection.coderepo_collection.name]
    effect      = "ignore"

    license {
      alert_threshold {
        enabled = true
        value   = 3
      }
      block_threshold {
        enabled = true
        value   = 9
      }
      medium = ["AAL"]
      low = []
    }
  }
}

Types of changes

Checklist