Skip to content

Commit

Permalink
Update policy example in the documentation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
HorizonNet committed Dec 4, 2020
1 parent 929e377 commit 9ff312a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
```

Expand Down

0 comments on commit 9ff312a

Please sign in to comment.