Ensure GitHub repository is Private

Error: GitHub Repository is Public
Bridgecrew Policy ID: BC_REPO_GITHUB_TF_2
Checkov Check ID: CKV_GIT_1
Severity: LOW

GitHub Repository is Public

Description

GitHub allows you to set a repository to private to prevent unauthorized users from viewing the repository.

Fix - Buildtime

Terraform

  • Resource: github_repository
  • Attribute: private OR visibility (The visibility parameter overrides the private parameter)
resource "github_repository" "example" {
...
+  visibility = "private" or "internal"

or

+  private = true
}