global

package
v1.2.11 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PeriodicFullScan represents the global program used for periodic full scans.
	PeriodicFullScan = Program{
		ID:   "periodic-full-scan",
		Name: "Periodic Scan",
		Policies: []PolicyGroup{
			PolicyGroup{
				Group:  "default-global",
				Policy: "default-global",
			},
			PolicyGroup{
				Group:  "sensitive-global",
				Policy: "sensitive-global",
			},
		},
		DefaultMetadata: api.GlobalProgramsMetadata{

			Cron: "0 8 * * 1",

			Autosend: &vFalse,

			Disabled: &vFalse,
		},
	}
	// RedconScan represents the global program used for periodic scans
	// of the Redcon discovered assets.
	RedconScan = Program{
		ID:   "redcon-scan",
		Name: "Redcon Scan",
		Policies: []PolicyGroup{
			PolicyGroup{
				Group:  "redcon-global",
				Policy: "redcon-global",
			},
		},
		DefaultMetadata: api.GlobalProgramsMetadata{

			Cron: "0 12 * * 2",

			Autosend: &vFalse,

			Disabled: &vFalse,
		},
	}
	// WebScanning represents the global program used for web scans
	WebScanning = Program{
		ID:   "web-scanning",
		Name: "Web Scanning",
		Policies: []PolicyGroup{
			PolicyGroup{
				Group:  "web-scanning-global",
				Policy: "web-scanning-global",
			},
		},
		DefaultMetadata: api.GlobalProgramsMetadata{

			Cron: "0 8 * * 3",

			Autosend: &vFalse,

			Disabled: &vFalse,
		},
	}
	// CPScan represents the global program used for periodic scans
	// of the Common Platform discovered assets.
	CPScan = Program{
		ID:   "cp-scan",
		Name: "CP Scan",
		Policies: []PolicyGroup{
			PolicyGroup{
				Group:  "cp-global",
				Policy: "cp-global",
			},
		},
		DefaultMetadata: api.GlobalProgramsMetadata{

			Cron: "0 6 * * 3",

			Autosend: &vFalse,

			Disabled: &vFalse,
		},
	}
)
View Source
var (
	// PeriodicDigestReport specifies the data for the digest report
	// to be sent on every Wednesday at 8am UTC.
	PeriodicDigestReport = Report{
		ID:              "periodic-digest-report",
		Name:            "Periodic Digest Report",
		DefaultSchedule: "0 8 * * 3",
	}
)

Functions

This section is empty.

Types

type CPGroup

type CPGroup struct {
	// contains filtered or unexported fields
}

CPGroup resolves the assets detected by CP excluding those present in the Default, Sensitive and Redcon groups.

func (*CPGroup) Description

func (g *CPGroup) Description() string

Description returns a meaningful explanation of the group.

func (*CPGroup) Eval

func (g *CPGroup) Eval(teamID string) ([]*api.Asset, error)

Eval returns the current assets of a team belonging to this group.

func (CPGroup) Init

func (g CPGroup) Init(store api.VulcanitoStore) error

func (*CPGroup) Name

func (g *CPGroup) Name() string

Name returns the name of the group.

func (CPGroup) Options

func (d CPGroup) Options() string

func (CPGroup) ShadowTeamGroup

func (g CPGroup) ShadowTeamGroup() string

type CPPolicy

type CPPolicy struct {
	// contains filtered or unexported fields
}

CPPolicy contains all checks associated with the "DefaultPolicy", but excluding "vulcan-nessus"

func (*CPPolicy) Description

func (r *CPPolicy) Description() string

Description returns a meaningful explanation of the group.

func (*CPPolicy) Eval

func (*CPPolicy) Init

func (r *CPPolicy) Init(informer ChecktypesInformer) error

func (*CPPolicy) Name

func (r *CPPolicy) Name() string

Name returns the name of the group.

type ChecksByAssetType

type ChecksByAssetType struct {
	Assettype string
	Name      []string
}

type ChecktypesInformer

type ChecktypesInformer interface {
	ByAssettype(ctx context.Context) (map[string][]string, error)
}

ChecktypesInformer defines the functions that the component providing checktypes info to the global policies must implement.

type DefaultGroup

type DefaultGroup struct {
	// contains filtered or unexported fields
}

DefaultGroup resolves all the assets present

func (*DefaultGroup) Description

func (d *DefaultGroup) Description() string

Description returns a meanfull explanation of the group.

func (*DefaultGroup) Eval

func (d *DefaultGroup) Eval(teamID string) ([]*api.Asset, error)

Eval returns the current assets of a team belinging to this group.

func (DefaultGroup) Init

func (g DefaultGroup) Init(store api.VulcanitoStore) error

func (*DefaultGroup) Name

func (d *DefaultGroup) Name() string

Name returns the name of the group.

func (DefaultGroup) Options

func (d DefaultGroup) Options() string

func (DefaultGroup) ShadowTeamGroup

func (g DefaultGroup) ShadowTeamGroup() string

type DefaultPolicy

type DefaultPolicy struct {
	// contains filtered or unexported fields
}

DefaultPolicy contains all checks execpts the ones for docker images.

func (*DefaultPolicy) Description

func (d *DefaultPolicy) Description() string

Description returns a meanfull explanation of the group.

func (*DefaultPolicy) Eval

func (*DefaultPolicy) Init

func (d *DefaultPolicy) Init(informer ChecktypesInformer) error

func (*DefaultPolicy) Name

func (d *DefaultPolicy) Name() string

Name returns the name of the policy.

type Entities

type Entities struct {
	// contains filtered or unexported fields
}

Entities shapes the interface exposed to other packages to interact with global entities.

func NewEntities

func NewEntities(store api.VulcanitoStore, informer ChecktypesInformer) (*Entities, error)

NewEntities returns a struct that exposes the current defined global entities.

func (*Entities) Groups

func (c *Entities) Groups() map[string]Group

Groups returns the current defined current groups.

func (*Entities) Policies

func (c *Entities) Policies() map[string]Policy

Policies returns current defined global policies.

func (*Entities) Programs

func (c *Entities) Programs() map[string]Program

Programs returns current defined global programs.

func (*Entities) Reports

func (c *Entities) Reports() map[string]Report

Reports returns current defined global reports.

type GlobalPolicyConfig

type GlobalPolicyConfig map[string]GlobalPolicyConfigEntry

GlobalPolicyConfig defines the global policy configuration in terms of checks and assettypes to process.

type GlobalPolicyConfigEntry

type GlobalPolicyConfigEntry struct {
	AllowedChecks     []string `mapstructure:"allowed_checks"`
	BlockedChecks     []string `mapstructure:"blocked_checks"`
	AllowedAssettypes []string `mapstructure:"allowed_assettypes"`
	BlockedAssettypes []string `mapstructure:"blocked_assettypes"`
	ExcludingSuffixes []string `mapstructure:"excluding_suffixes"`
}

GlobalPolicyConfigEntry defines for a specific global policy the list of (allowed and blocked) (checks and assettypes) and a list of suffix to exclude if check name matches. Blocking takes precedence. Empty allowed slices means ALL allowed.

type Group

type Group interface {
	Init(api.VulcanitoStore) error
	Name() string
	Options() string
	Description() string
	// ShadowTeamGroup must return a group name if the global group is shadowing
	// a "normal" group of a team. A shadowed group is a global group that can
	// be referenced by a global program but acts as it is effectively the real
	// group of the team.
	ShadowTeamGroup() string
	Eval(teamID string) ([]*api.Asset, error)
}

Group defines the methods all the global groups must implement.

type Policy

type Policy interface {
	Init(ChecktypesInformer) error
	Description() string
	Name() string
	Eval(context.Context, GlobalPolicyConfig) ([]*api.ChecktypeSetting, error)
}

Policy defines the shape of a global policy.

type PolicyGroup

type PolicyGroup struct {
	Group  string
	Policy string
}

type Program

type Program struct {
	ID              string
	Name            string
	Policies        []PolicyGroup
	DefaultMetadata api.GlobalProgramsMetadata
}

Program defines the information required to define a global program.

type RedconGroup

type RedconGroup struct {
	// contains filtered or unexported fields
}

RedconGroup resolves the assets detected by Redcon excluding those present in the Default and Sensitive groups.

func (*RedconGroup) Description

func (g *RedconGroup) Description() string

Description returns a meaningful explanation of the group.

func (*RedconGroup) Eval

func (g *RedconGroup) Eval(teamID string) ([]*api.Asset, error)

Eval returns the current assets of a team belonging to this group.

func (RedconGroup) Init

func (g RedconGroup) Init(store api.VulcanitoStore) error

func (*RedconGroup) Name

func (g *RedconGroup) Name() string

Name returns the name of the group.

func (RedconGroup) Options

func (d RedconGroup) Options() string

func (RedconGroup) ShadowTeamGroup

func (g RedconGroup) ShadowTeamGroup() string

type RedconPolicy

type RedconPolicy struct {
	// contains filtered or unexported fields
}

RedconPolicy contains all checks associated with the "DefaultPolicy", but excluding "vulcan-nessus"

func (*RedconPolicy) Description

func (r *RedconPolicy) Description() string

Description returns a meaningful explanation of the group.

func (*RedconPolicy) Eval

func (*RedconPolicy) Init

func (r *RedconPolicy) Init(informer ChecktypesInformer) error

func (*RedconPolicy) Name

func (r *RedconPolicy) Name() string

Name returns the name of the group.

type Report

type Report struct {
	ID              string
	Name            string
	DefaultSchedule string
}

Report defines the information required to define a global report.

type SensitiveGroup

type SensitiveGroup struct {
	// contains filtered or unexported fields
}

SensitiveGroup global group shadows the sensitive concrete group of a team.

func (*SensitiveGroup) Description

func (d *SensitiveGroup) Description() string

func (SensitiveGroup) Eval

func (g SensitiveGroup) Eval(teamID string) ([]*api.Asset, error)

func (SensitiveGroup) Init

func (g SensitiveGroup) Init(store api.VulcanitoStore) error

func (*SensitiveGroup) Name

func (d *SensitiveGroup) Name() string

Name returns the name of the group.

func (SensitiveGroup) Options

func (d SensitiveGroup) Options() string

func (*SensitiveGroup) ShadowTeamGroup

func (g *SensitiveGroup) ShadowTeamGroup() string

type SensitivePolicy

type SensitivePolicy struct {
	// contains filtered or unexported fields
}

func (*SensitivePolicy) Description

func (d *SensitivePolicy) Description() string

Description returns a meanfull explanation of the group.

func (*SensitivePolicy) Eval

Eval return same checktypes as default-global policy except vulcan-nessus.

func (*SensitivePolicy) Init

func (d *SensitivePolicy) Init(informer ChecktypesInformer) error

func (*SensitivePolicy) Name

func (d *SensitivePolicy) Name() string

Name returns the name of the group.

type WebScanningGroup

type WebScanningGroup struct {
	// contains filtered or unexported fields
}

WebScanning global group contains the assets which will be scanned by web scanners.

func (*WebScanningGroup) Description

func (d *WebScanningGroup) Description() string

func (*WebScanningGroup) Eval

func (g *WebScanningGroup) Eval(teamID string) ([]*api.Asset, error)

Eval returns the current assets of a team belonging to this group.

func (WebScanningGroup) Init

func (g WebScanningGroup) Init(store api.VulcanitoStore) error

func (*WebScanningGroup) Name

func (d *WebScanningGroup) Name() string

Name returns the name of the group.

func (WebScanningGroup) Options

func (d WebScanningGroup) Options() string

func (*WebScanningGroup) ShadowTeamGroup

func (g *WebScanningGroup) ShadowTeamGroup() string

type WebScanningPolicy

type WebScanningPolicy struct {
	// contains filtered or unexported fields
}

WebScanningPolicy contains all checks related with web scanning.

func (*WebScanningPolicy) Description

func (ws *WebScanningPolicy) Description() string

Description returns a meanfull explanation of the group.

func (*WebScanningPolicy) Eval

func (*WebScanningPolicy) Init

func (ws *WebScanningPolicy) Init(informer ChecktypesInformer) error

func (*WebScanningPolicy) Name

func (ws *WebScanningPolicy) Name() string

Name returns the name of the group.

Jump to

Keyboard shortcuts

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