Skip to content

Files

Latest commit

 

History

History
45 lines (31 loc) · 873 Bytes

GEN004.md

File metadata and controls

45 lines (31 loc) · 873 Bytes

Pattern: Github repository shouldn't be public

Issue: -

Description

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'.

Resolution: Make sensitive or commercially importnt repositories private.

Examples

Example of incorrect code:

resource "github_repository" "bad_example" {
  name        = "example"
  description = "My awesome codebase"

  visibility  = "public"

  template {
    owner = "github"
    repository = "terraform-module-template"
  }
}

Example of correct code:

resource "github_repository" "good_example" {
  name        = "example"
  description = "My awesome codebase"

  visibility  = "private"

  template {
    owner = "github"
    repository = "terraform-module-template"
  }
}