Documentation
¶
Overview ¶
Package ghtasks runs the Vulnetix GitHub posture engine (vdb-sca-match ghaudit) for the `vulnetix gha` analysis tasks: workflows, actions, settings, org and audit. It owns everything the engine leaves to its callers: reading local workflow files, talking to the GitHub REST API, and rendering a report.
Index ¶
- Constants
- Variables
- func FailsAt(rep *ghaudit.Report, sev ghaudit.Severity) bool
- func HostForAPI(apiURL string) string
- func LoadLocal(root string) (map[string][]byte, error)
- func RepoFromRemote(remote, host string) string
- func RuleDocs() map[string]string
- func WriteTable(w io.Writer, rep *ghaudit.Report, s Summary, notes []string)
- type RESTGetter
- type Summary
Constants ¶
const DefaultAPIURL = "https://api.github.com"
DefaultAPIURL is api.github.com; GitHub Enterprise Server is passed in.
Variables ¶
var ErrRateLimited = errors.New("GitHub API rate limit exhausted")
ErrRateLimited is returned when GitHub refuses for quota.
Functions ¶
func HostForAPI ¶
HostForAPI is the web host that pairs with an API base URL.
func LoadLocal ¶
LoadLocal reads the files the engine evaluates from a checkout: workflows, action metadata under .github/ and at the root, and CODEOWNERS.
func RepoFromRemote ¶
RepoFromRemote returns owner/name for a github.com (or apiHost) remote URL.
Types ¶
type RESTGetter ¶
type RESTGetter struct {
BaseURL string
Token string
Client *http.Client
// Calls counts requests, for the report.
Calls int
}
RESTGetter is a ghaudit.Getter over net/http with a token.
func NewRESTGetter ¶
func NewRESTGetter(baseURL, token string) *RESTGetter
NewRESTGetter returns a getter for baseURL ("" for github.com).