gcp

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClassThreat           = "THREAT"
	ClassVulnerability    = "VULNERABILITY"
	ClassMisconfiguration = "MISCONFIGURATION"
	ClassObservation      = "OBSERVATION"
	ClassSCCError         = "SCC_ERROR"
	ClassPostureViolation = "POSTURE_VIOLATION"
	ClassToxicCombination = "TOXIC_COMBINATION"
)

SCC v2 finding class string constants matching Finding_FindingClass enum names.

Variables

This section is empty.

Functions

func NewEnvelope

NewEnvelope returns a NotificationMessage with all common fields populated. Category templates extend this skeleton with class-specific data.

func Register

func Register(class, category string, fn TemplateFunc)

Register adds or overrides a category template.

Types

type EnvelopeInput

type EnvelopeInput struct {
	Class        string
	Category     string
	Severity     securitycenterpb.Finding_Severity
	ResourceType string // e.g., "google.compute.Instance"
}

EnvelopeInput is what a TemplateFunc supplies to NewEnvelope. Category-specific decorations are applied by the caller on the returned envelope.

type Provider

type Provider struct{}

Provider implements secmock.Provider for GCP Security Command Center.

func New

func New() *Provider

New returns a GCP Provider. The Provider is stateless; the package-level catalog is the source of truth for templates.

func (*Provider) ByCategory

func (p *Provider) ByCategory(class, category string, r *rand.Rand) (msg proto.Message, err error)

ByCategory implements secmock.Provider. Panics from template functions are recovered and returned as wrapped errors.

func (*Provider) ByClass

func (p *Provider) ByClass(class string, r *rand.Rand) (proto.Message, error)

ByClass implements secmock.Provider.

func (*Provider) Catalog

func (*Provider) Catalog() secmock.Catalog

Catalog implements secmock.Provider.

func (*Provider) Name

func (*Provider) Name() string

Name implements secmock.Provider.

func (*Provider) Random

func (p *Provider) Random(r *rand.Rand) (proto.Message, error)

Random implements secmock.Provider.

type TemplateFunc

type TemplateFunc func(r *rand.Rand) *securitycenterpb.NotificationMessage

TemplateFunc builds a NotificationMessage for a specific category. Must be deterministic when given the same *rand.Rand state.

Directories

Path Synopsis
Package categories registers the built-in GCP SCC category templates.
Package categories registers the built-in GCP SCC category templates.
Package faker produces deterministic GCP-shaped fake data for SCC findings.
Package faker produces deterministic GCP-shaped fake data for SCC findings.

Jump to

Keyboard shortcuts

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