security

package
v0.0.0-...-3d71f35 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package security implements the SECURITY.md security policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSecurity

func NewSecurity() policydef.Policy

NewSecurity returns a new SECURITY.md policy.

Types

type OrgConfig

type OrgConfig struct {
	// OptConfig is the standard org-level opt in/out config, RepoOverride applies to all
	// BP config.
	OptConfig config.OrgOptConfig `json:"optConfig"`

	// Action defines which action to take, default log, other: issue...
	Action string `json:"action"`
}

OrgConfig is the org-level config definition for Branch Protection.

type RepoConfig

type RepoConfig struct {
	// OptConfig is the standard repo-level opt in/out config.
	OptConfig config.RepoOptConfig `json:"optConfig"`

	// Action overrides the same setting in org-level, only if present.
	Action *string `json:"action"`
}

RepoConfig is the repo-level config for Branch Protection

type Security

type Security bool

Security is the SECURITY.md policy object, implements policydef.Policy.

func (Security) Check

func (s Security) Check(ctx context.Context, c *github.Client, owner,
	repo string) (*policydef.Result, error)

Check performs the policy check for SECURITY.md policy based on the configuration stored in the org/repo, implementing policydef.Policy.Check()

func (Security) Fix

func (s Security) Fix(ctx context.Context, c *github.Client, owner, repo string) error

Fix implementing policydef.Policy.Fix(). Currently not supported. Plan to support this TODO.

func (Security) GetAction

func (s Security) GetAction(ctx context.Context, c *github.Client, owner, repo string) string

GetAction returns the configured action from SECURITY.md policy's configuration stored in the org-level repo, default log. Implementing policydef.Policy.GetAction()

func (Security) IsEnabled

func (s Security) IsEnabled(ctx context.Context, c *github.Client, owner, repo string) (bool, error)

Check whether this policy is enabled or not

func (Security) Name

func (s Security) Name() string

Name returns the name of this policy, implementing policydef.Policy.Name()

Jump to

Keyboard shortcuts

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