branch_protections

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckRequireSignedCommits = rules.Register(
	scan.Rule{
		AVDID:      "AVD-GIT-0004",
		Provider:   providers.GitHubProvider,
		Service:    "branch_protections",
		ShortCode:  "require_signed_commits",
		Summary:    "GitHub branch protection does not require signed commits.",
		Impact:     "Commits may not be verified and signed as coming from a trusted developer",
		Resolution: "Require signed commits",
		Explanation: `GitHub branch protection should be set to require signed commits.

You can do this by setting the <code>require_signed_commits</code> attribute to 'true'.`,
		Links: []string{
			"https://registry.terraform.io/providers/integrations/github/latest/docs/resources/branch_protection#require_signed_commits",
			"https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification",
			"https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches#require-signed-commits",
		},
		Terraform: &scan.EngineMetadata{
			GoodExamples:        terraformRequireSignedCommitsGoodExamples,
			BadExamples:         terraformRequireSignedCommitsBadExamples,
			Links:               terraformRequireSignedCommitsLinks,
			RemediationMarkdown: terraformRequireSignedCommitsRemediationMarkdown,
		},
		Severity: severity.High,
	},
	func(s *state.State) (results scan.Results) {
		for _, branchProtection := range s.GitHub.BranchProtections {
			if branchProtection.RequireSignedCommits.IsFalse() {
				results.Add(
					"Branch protection does not require signed commits,",
					branchProtection.RequireSignedCommits,
				)
			} else {
				results.AddPassed(branchProtection)
			}
		}
		return
	},
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL