Back to Checks
iac

GitHub repository shouldn't be public.

GIT-0001
Service: repositoriesSeverity: critical
OfficialBuilt-inVerified

GitHub repository should be set to be private.

You can do this by either setting <code>private</code> attribute to 'true' or <code>visibility</code> attribute to 'internal' or 'private'.

Run this check with Prowler

Run in Prowler Cloud
Run
prowler iac --checks GIT-0001

Recommendation

Make sensitive or commercially important repositories private

Check Code

# METADATA
# title: GitHub repository shouldn't be public.
# description: |
#   GitHub repository should be set to be private.
#
#   You can do this by either setting <code>private</code> attribute to 'true' or <code>visibility</code> attribute to 'internal' or 'private'.
# scope: package
# schemas:
#   - input: schema["cloud"]
# related_resources:
#   - https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility
#   - https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories
# custom:
#   id: GIT-0001
#   long_id: github-repositories-private
#   aliases:
#     - AVD-GIT-0001
#     - private
#     - github-repositories-private
#   provider: github
#   service: repositories
#   severity: CRITICAL
#   recommended_action: Make sensitive or commercially important repositories private
#   input:
#     selector:
#       - type: cloud
#         subtypes:
#           - service: repositories
#             provider: github
#   examples: checks/cloud/github/repositories/private_repository.yaml
package builtin.github.repositories.github0001

import rego.v1

deny contains res if {
	some repo in input.github.repositories
	repo.public.value == true
	res := result.new("Repository is public.", repo.public)
}