From 9ff312ade80110e82b6298cf4af10c11d4bf322b Mon Sep 17 00:00:00 2001 From: Jan Hentschel Date: Fri, 4 Dec 2020 20:15:04 +0100 Subject: [PATCH] Update policy example in the documentation Update the policy example in the policies documentation to use the latest version of the policy definition for the visibility setting of GitHub repositories. Resolves #422 --- docs/policies.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/policies.md b/docs/policies.md index 2bb58ace1..f693ccb19 100644 --- a/docs/policies.md +++ b/docs/policies.md @@ -62,14 +62,15 @@ $ terrascan scan -i terraform --config-only -o json } ``` -You can use this `.json` output as the input in the (rego playgound)[https://play.openpolicyagent.org/]. The following policy can be used on the above Terraform to flag if the GitHub repository has been created with `private = false`. +You can use this `.json` output as the input in the (rego playgound)[https://play.openpolicyagent.org/]. The following policy can be used on the above Terraform to flag if the GitHub repository has been created with `private = false` or `visibility = public`, depending on the version used for the GitHub provider. ``` package accurics privateRepoEnabled[api.id] { -api := input.github_repository[_] -not api.config.private == true + api := input.github_repository[_] + not api.config.private == true + not api.config.visibility == "private" } ```