ghas

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 7 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 ghas implements the pkg/source plugin for GitHub Advanced Security code-scanning alerts (CodeQL first): it consumes code_scanning_alert webhook deliveries, fetches the full alert for rule help and location detail, and normalizes it into a source.Finding — extracting CWE identifiers from CodeQL rule tags as the advisory categorization.

Index

Constants

View Source
const ID = "ghas"

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

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertGetter

type AlertGetter interface {
	GetAlert(ctx context.Context, repo ghclient.Repo, number int) (*ghclient.Alert, error)
}

AlertGetter fetches the full code-scanning alert; the webhook payload carries a summary, but the rule help markdown only comes from the API.

type Handler

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

Handler is the GHAS source plugin.

func New

func New(alerts AlertGetter) *Handler

New builds the handler around an alert fetcher (typically an adapter that resolves the right installation client per repository).

func (*Handler) Events

func (h *Handler) Events() []string

Events implements source.Handler.

func (*Handler) Findings

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

Findings implements source.Handler: it normalizes one delivery, fetching the full alert from the API.

func (*Handler) ID

func (h *Handler) ID() string

ID implements source.Handler.

Jump to

Keyboard shortcuts

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