CRITICAL
Source
Trivy
ID
AVD-GIT-0001

Github repository shouldn’t be public.

Github repository should be set to be private.

You can do this by either setting private attribute to ‘true’ or visibility attribute to ‘internal’ or ‘private’.

Impact

Anyone can read the contents of the GitHub repository and leak IP

Follow the appropriate remediation steps below to resolve the issue.

Make sensitive or commercially important repositories private

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 resource "github_repository" "good_example" {
   name        = "example"
   description = "My awesome codebase"
 
   visibility  = "private"
 
   template {
     owner = "github"
     repository = "terraform-module-template"
   }
 }