gitregostore

package
v1.0.316 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TypeCompliance = "compliance"
	TypeSecurity   = "security"
)
View Source
const (
	ControlRuleRelationsFileName = "ControlID_RuleName.csv"
)

Variables

This section is empty.

Functions

func HTTPRespToString

func HTTPRespToString(resp *http.Response) (string, error)

HTTPRespToString parses the body as string and checks the HTTP status code, it closes the body reader at the end TODO: FIX BUG: status code is not being checked when the body is empty

func HttpGetter

func HttpGetter(httpClient *http.Client, fullURL string) (string, error)

func JSONDecoder

func JSONDecoder(origin string) *json.Decoder

JSONDecoder returns JSON decoder for given string

Types

type GitRegoStore

type GitRegoStore struct {
	DefaultConfigInputsLock sync.RWMutex

	ControlRuleRelations      dataframe.DataFrame
	FrameworkControlRelations dataframe.DataFrame

	Tag                            string
	Owner                          string
	CurGitVersion                  string
	Branch                         string
	URL                            string
	Path                           string
	BaseUrl                        string
	Repository                     string
	DefaultConfigInputs            armotypes.CustomerConfig
	AttackTracks                   []v1alpha1.AttackTrack
	Frameworks                     []opapolicy.Framework
	Controls                       []opapolicy.Control
	AttackTrackControls            []opapolicy.Control
	Rules                          []opapolicy.PolicyRule
	SystemPostureExceptionPolicies []armotypes.PostureExceptionPolicy
	FrequencyPullFromGitMinutes    int
	Watch                          bool
	StripFilesExtension            bool
	// contains filtered or unexported fields
}

func NewDefaultGitRegoStore

func NewDefaultGitRegoStore(frequency int) *GitRegoStore

NewDefaultGitRegoStore - generates git store object for production regolibrary release files. Release files source: "https://github.com/kubescape/regolibrary/releases/latest/download"

func NewDevGitRegoStore

func NewDevGitRegoStore(frequency int) *GitRegoStore

NewDevGitRegoStore - generates git store object for dev regolibrary release files Release files source: "https://raw.githubusercontent.com/kubescape/regolibrary-dev/main/releaseDev"

func NewGitRegoStore

func NewGitRegoStore(baseUrl string, owner string, repository string, path string, tag string, branch string, frequency int) *GitRegoStore

NewGitRegoStore return gitregostore obj with basic fields, before pulling from git

func (*GitRegoStore) GetAttackTracks

func (gs *GitRegoStore) GetAttackTracks() ([]v1alpha1.AttackTrack, error)

func (*GitRegoStore) GetDefaultConfigInputs

func (gs *GitRegoStore) GetDefaultConfigInputs() (armotypes.CustomerConfig, error)

func (*GitRegoStore) GetOPAAttackTrackControls added in v1.0.300

func (gs *GitRegoStore) GetOPAAttackTrackControls() ([]opapolicy.Control, error)

func (*GitRegoStore) GetOPAControl

func (gs *GitRegoStore) GetOPAControl(c string) (*opapolicy.Control, error)

GetOPAControl returns specific control by the name or ID

func (*GitRegoStore) GetOPAControlByFrameworkNameAndControlName

func (gs *GitRegoStore) GetOPAControlByFrameworkNameAndControlName(frameworkName string, controlName string) (*opapolicy.Control, error)

GetOPAControlByFrameworkNameAndControlName - get framework name and control name and return the relevant control object

func (*GitRegoStore) GetOPAControlByID

func (gs *GitRegoStore) GetOPAControlByID(controlID string) (*opapolicy.Control, error)

GetOPAControlByID returns specific BaseControl by the ID

func (*GitRegoStore) GetOPAControlByName deprecated

func (gs *GitRegoStore) GetOPAControlByName(controlName string) (*opapolicy.Control, error)

GetOPAControlByName returns specific BaseControl by the name.

Deprecated: use GetOPAControlByFrameworkNameAndControlName.

func (*GitRegoStore) GetOPAControls

func (gs *GitRegoStore) GetOPAControls() ([]opapolicy.Control, error)

GetOPAControls returns all the controls of given customer

func (*GitRegoStore) GetOPAControlsIDsList

func (gs *GitRegoStore) GetOPAControlsIDsList() ([]string, error)

func (*GitRegoStore) GetOPAControlsNamesList

func (gs *GitRegoStore) GetOPAControlsNamesList() ([]string, error)

func (*GitRegoStore) GetOPAFrameworkByName

func (gs *GitRegoStore) GetOPAFrameworkByName(frameworkName string) (*opapolicy.Framework, error)

GetOPAFrameworkByName returns specific framework by the name

func (*GitRegoStore) GetOPAFrameworkTypeTags added in v1.0.300

func (gs *GitRegoStore) GetOPAFrameworkTypeTags(frameworkName string) ([]string, error)

GetOPAFrameworkTypeTags returns all type tags of given framework

func (*GitRegoStore) GetOPAFrameworks

func (gs *GitRegoStore) GetOPAFrameworks() ([]opapolicy.Framework, error)

GetOPAFrameworks returns all compliance frameworks

func (*GitRegoStore) GetOPAFrameworksNamesList

func (gs *GitRegoStore) GetOPAFrameworksNamesList() ([]string, error)

GetOPAFrameworksNamesList returns all compliance frameworks names

func (*GitRegoStore) GetOPAPolicies

func (gs *GitRegoStore) GetOPAPolicies() ([]opapolicy.PolicyRule, error)

GetOPAPolicies returns all the policies of given customer

func (*GitRegoStore) GetOPAPoliciesNamesList

func (gs *GitRegoStore) GetOPAPoliciesNamesList() ([]string, error)

func (*GitRegoStore) GetOPAPolicyByName

func (gs *GitRegoStore) GetOPAPolicyByName(ruleName string) (*opapolicy.PolicyRule, error)

GetOPAPolicyByName returns specific policy by the name

func (*GitRegoStore) GetOPASecurityFrameworks added in v1.0.300

func (gs *GitRegoStore) GetOPASecurityFrameworks() ([]opapolicy.Framework, error)

GetOPAFrameworks returns all security frameworks

func (*GitRegoStore) GetOPASecurityFrameworksNamesList added in v1.0.300

func (gs *GitRegoStore) GetOPASecurityFrameworksNamesList() ([]string, error)

GetOPAFrameworksNamesList returns all security frameworks names

func (*GitRegoStore) GetOpaFrameworkListByControlID

func (gs *GitRegoStore) GetOpaFrameworkListByControlID(controlID string) []string

GetOpaFrameworkListByControlID returns a list of framework names this control is in

func (*GitRegoStore) GetOpaFrameworkListByControlName

func (gs *GitRegoStore) GetOpaFrameworkListByControlName(controlName string) []string

GetOpaFrameworkListByControlName returns a list of framework names this control is in

func (*GitRegoStore) GetSystemPostureExceptionPolicies

func (gs *GitRegoStore) GetSystemPostureExceptionPolicies() ([]armotypes.PostureExceptionPolicy, error)

func (*GitRegoStore) SetRegoObjects

func (gs *GitRegoStore) SetRegoObjects() error

SetRegoObjects pulls opa obj from git and stores in gitregostore

type InnerTree

type InnerTree []struct {
	PATH string `json:"path"`
}

type Tree

type Tree struct {
	TREE InnerTree `json:"tree"`
}

Jump to

Keyboard shortcuts

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