Documentation
¶
Index ¶
- Constants
- func NewEnvelope(r *rand.Rand, in EnvelopeInput) *securitycenterpb.NotificationMessage
- func Register(class, category string, fn TemplateFunc)
- type EnvelopeInput
- type Provider
- func (p *Provider) ByCategory(class, category string, r *rand.Rand) (msg proto.Message, err error)
- func (p *Provider) ByClass(class string, r *rand.Rand) (proto.Message, error)
- func (*Provider) Catalog() secmock.Catalog
- func (*Provider) Name() string
- func (p *Provider) Random(r *rand.Rand) (proto.Message, error)
- type TemplateFunc
Constants ¶
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 ¶
func NewEnvelope(r *rand.Rand, in EnvelopeInput) *securitycenterpb.NotificationMessage
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 ¶
ByCategory implements secmock.Provider. Panics from template functions are recovered and returned as wrapped errors.
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. |