369
This project intends can help you to ensure that projects into your organization be following a defined compliance policy.
You can:
docker run -it rafaelleonardocruz/terraform-github-compliance-validator <github token> <organization name>
terraform plan isn't compliance with defined policy. (Ex.:) + resource "github_branch_protection" "this" {
+ branch = "master"
+ enforce_admins = true
+ etag = (known after apply)
+ id = (known after apply)
+ repository = "secret"
+ require_signed_commits = false
+ required_pull_request_reviews {
+ dismiss_stale_reviews = true
+ required_approving_review_count = 1
}
}
# github_branch_protection.this[1] will be created
+ resource "github_branch_protection" "this" {
+ branch = "master"
+ enforce_admins = true
+ etag = (known after apply)
+ id = (known after apply)
+ repository = "project"
+ require_signed_commits = false
+ required_pull_request_reviews {
+ dismiss_stale_reviews = true
+ required_approving_review_count = 1
}
}
# github_branch_protection.this[2] will be created
+ resource "github_branch_protection" "this" {
+ branch = "master"
+ enforce_admins = true
+ etag = (known after apply)
+ id = (known after apply)
+ repository = "back"
+ require_signed_commits = false
+ required_pull_request_reviews {
+ dismiss_stale_reviews = true
+ required_approving_review_count = 1
}
}
# github_branch_protection.this[3] will be created
+ resource "github_branch_protection" "this" {
+ branch = "master"
+ enforce_admins = true
+ etag = (known after apply)
+ id = (known after apply)
+ repository = "front"
+ require_signed_commits = false
+ required_pull_request_reviews {
+ dismiss_stale_reviews = true
+ required_approving_review_count = 1
}
}
Plan: 4 to add, 0 to change, 0 to destroy.
terraform refresh are public exposed. (Ex.:)Outputs:
public_repositories = [
"secret",
"project",
"back",
"front",
]
To define your policy, you need customize the file compliant_check/policy-check.tf exploring the possibilities offered by terrafrom github_branch_protection resource
Content type
Image
Digest
Size
29.3 MB
Last updated
over 6 years ago
docker pull rafaelleonardocruz/terraform-github-compliance-validator