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 = action.VerbApprove // VerbRetry is the custom RBAC verb behind the retry action (recover a // Failed finding to the state it failed from). VerbRetry = action.VerbRetry // VerbExpedite is the custom RBAC verb behind the expedite action (skip // the waiting stages: accumulation, minimum age, queue position). VerbExpedite = action.VerbExpedite // VerbSuspend is the custom RBAC verb behind the suspend action. VerbSuspend = action.VerbSuspend // VerbResume is the custom RBAC verb behind the resume action. VerbResume = action.VerbResume // VerbReplay is the custom RBAC verb behind the namespace-wide replay // action (redeliver the webhook delivery log — demo tooling). VerbReplay = action.VerbReplay // VerbReset is the custom RBAC verb behind the namespace-wide reset // action (delete every pipeline resource — demo tooling). VerbReset = action.VerbReset )
The verb vocabulary is owned by internal/action, which also holds the state-machine gating behind each verb; authz only resolves who may use them. Re-exported here so the server keeps reading its grants and its actions from one place.
Variables ¶
var ActionVerbs = action.ActionVerbs
ActionVerbs lists the per-finding custom verbs in the order the UI receives them.
var AdminVerbs = action.AdminVerbs
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 ResourceReviewer ¶ added in v0.9.3
type ResourceReviewer struct {
// contains filtered or unexported fields
}
ResourceReviewer answers "may this identity <verb> <resource>?" through SubjectAccessReviews, cached briefly per identity+verb. It is the resource-parameterized sibling of Reviewer (which is findings-specific and grant-shaped); the evaluation API uses it with native verbs only — create/get/delete on evaluations — so RBAC is the whole authorization surface, no admission-policy change involved.
func NewResourceReviewer ¶ added in v0.9.3
func NewResourceReviewer(c client.Client, namespace, group, resource string, ttl time.Duration) *ResourceReviewer
NewResourceReviewer builds a ResourceReviewer for one resource in one namespace. ttl <= 0 uses the package default.
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.