Documentation
¶
Overview ¶
Package authz resolves what an identity may do to findings. It asks the cluster directly — SubjectAccessReviews with the identity's user and groups — so the grant grammar is ordinary Kubernetes RBAC: native get on findings gates viewing, and the custom verbs approve, suspend, and resume on findings.patchy.bitwisemedia.uk gate the actions. Reviews run as the server's own ServiceAccount (which needs only create on subjectaccessreviews), never via impersonation.
Index ¶
Constants ¶
const ( // VerbApprove is the custom RBAC verb behind the approve action. VerbApprove = "approve" // VerbRetry is the custom RBAC verb behind the retry action (recover a // Failed finding to the state it failed from). VerbRetry = "retry" // VerbExpedite is the custom RBAC verb behind the expedite action (skip // the waiting stages: accumulation, minimum age, queue position). VerbExpedite = "expedite" // VerbSuspend is the custom RBAC verb behind the suspend action. VerbSuspend = "suspend" // VerbResume is the custom RBAC verb behind the resume action. VerbResume = "resume" // VerbReplay is the custom RBAC verb behind the namespace-wide replay // action (redeliver the webhook delivery log — demo tooling). VerbReplay = "replay" // VerbReset is the custom RBAC verb behind the namespace-wide reset // action (delete every pipeline resource — demo tooling). VerbReset = "reset" )
Verbs the status server understands.
Variables ¶
var ActionVerbs = []string{VerbApprove, VerbRetry, VerbExpedite, VerbSuspend, VerbResume}
ActionVerbs lists the per-finding custom verbs in the order the UI receives them.
var AdminVerbs = []string{VerbReplay, VerbReset}
AdminVerbs lists the namespace-wide custom verbs, resolved the same way but surfaced on the dataset's user rather than per finding.
Functions ¶
This section is empty.
Types ¶
type Full ¶
type Full struct{}
Full is the bypass granter for auth mode none: everything, for everyone.
type Grants ¶
type Grants struct {
// View reports native get on findings — the dashboard read gate.
View bool
// Verbs are the granted custom action verbs, in ActionVerbs order.
Verbs []string
// Admin are the granted namespace-wide verbs, in AdminVerbs order.
Admin []string
}
Grants is what one identity may do in the server's namespace. RBAC is namespace-scoped, so grants apply uniformly across findings.
func (Grants) AllowsAdmin ¶ added in v0.5.4
AllowsAdmin reports whether the namespace-wide verb is granted.
type Reviewer ¶
type Reviewer struct {
// contains filtered or unexported fields
}
Reviewer resolves grants through SubjectAccessReviews, cached briefly per identity.
func NewReviewer ¶
NewReviewer builds a Reviewer for the server's namespace. ttl <= 0 uses the default.