security

package
Version: v0.0.0-...-005854d Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 9 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 `yaml:"optConfig"`

	// Action defines which action to take, default log, other: issue...
	Action string `yaml:"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 `yaml:"optConfig"`

	// Action overrides the same setting in org-level, only if present.
	Action *string `yaml:"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 polcy 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) Name

func (s Security) Name() string

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

Source Files

Jump to

Keyboard shortcuts

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