scc

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package scc is the Google Cloud Security Command Center source: it turns a Pub/Sub push delivery into patchy Findings.

SCC has no webhook. Its only egress is a NotificationConfig publishing to a Pub/Sub topic, so deliveries arrive as a push envelope whose message.data is a base64-encoded NotificationMessage. Unlike GHAS the notification is self-contained — everything the finding needs is in the payload — so this handler holds no API client and makes no network call.

SCC findings are about cloud resources, not repository code, so they carry a source.CloudResource and no Repo. Whether such a finding ever gets a repository is a later question, answered by a pkg/enhance enhancer reading ownership labels off the resource.

Index

Constants

View Source
const CloudProvider = "google"

CloudProvider is the platform value stamped on every finding's cloud resource.

View Source
const EventType = "scc.notification"

EventType is the event discriminator for this source. SCC's endpoint carries exactly one kind of delivery, so unlike a GitHub webhook there is no header to read it from — the route itself is the discriminator.

View Source
const ID = "gcp-scc"

ID is the source identifier stamped into the security-source label.

Variables

This section is empty.

Functions

func Decode

func Decode(payload []byte) (*notification, error)

Decode unwraps a Pub/Sub push envelope into the SCC notification it carries. Exported so the receiver can read the delivery id off the same body it validates, without decoding twice in two places.

func DeliveryID

func DeliveryID(payload []byte) string

DeliveryID reads the Pub/Sub message id from a push envelope, for the receiver's dedup window. An undecodable body yields "", which the receiver treats as "cannot dedup" rather than an error — the body is validated downstream.

Types

type Handler

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

Handler is the Security Command Center source plugin. It does not implement source.Resolver: muting a finding needs a Google Cloud write credential the integration-controller does not hold, so the write-back is deliberately absent rather than present and failing.

func New

func New(o Options) *Handler

New builds the handler. It takes no client: an SCC notification carries everything patchy needs, so unlike the GHAS source there is nothing to fetch.

func (*Handler) Findings

func (h *Handler) Findings(_ context.Context, event string, payload []byte) ([]source.Finding, error)

Findings implements source.Handler: it unwraps the Pub/Sub envelope, decodes the notification, and normalizes it into at most one Finding. Deliveries the pipeline does not act on return (nil, nil).

func (*Handler) ID

func (h *Handler) ID() string

ID implements source.Handler.

type Options

type Options struct {
	// MinSeverity drops findings below this level, using patchy's vocabulary
	// (low/medium/high/critical). Empty admits everything.
	MinSeverity string
	// Organization is the numeric Google Cloud organization id, used to
	// compose a Console link for findings that carry no externalUri.
	Organization string
}

Options configure the handler.

Jump to

Keyboard shortcuts

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