Documentation
¶
Overview ¶
Package authz resolves what an identity may do in the status server's namespace. It asks the cluster directly (SubjectAccessReviews with the identity's user and groups), so the grant grammar is ordinary Kubernetes RBAC in the patchy.bitwisemedia.uk group: native get on findings, findingrollups and integrations gates the findings, metrics and configuration views; the custom verbs approve, retry, expedite, suspend and resume on findings gate the per-finding actions; and backfill, replay and reset on integrations gate the integration 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 // VerbBackfill is the custom RBAC verb (on integrations) behind the // backfill action: list an integration's pre-existing open alerts into // findings. VerbBackfill = action.VerbBackfill // VerbReplay is the custom RBAC verb (on integrations) behind the // replay action (redeliver the webhook delivery log; demo tooling). VerbReplay = action.VerbReplay // VerbReset is the custom RBAC verb (on integrations) behind the 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 demo-tooling custom verbs the user menu renders, resolved on integrations like every integration-scoped verb.
var IntegrationVerbs = action.IntegrationVerbs
IntegrationVerbs lists the integration-scoped custom verbs in the order the UI receives them.
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
// Metrics reports native get on findingrollups: the metrics read gate.
Metrics bool
// Config reports native get on integrations: the configuration-view
// read gate.
Config bool
// Verbs are the granted custom action verbs, in ActionVerbs order.
Verbs []string
// Integration are the granted integration-scoped verbs, in
// IntegrationVerbs order.
Integration []string
// Admin are the granted demo-tooling verbs (the AdminVerbs subset of
// Integration), kept separate so the user menu and the adminActions
// wire field stay stable.
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 demo-tooling verb is granted.
func (Grants) AllowsIntegration ¶ added in v0.10.0
AllowsIntegration reports whether the integration-scoped 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 and no admission-policy change is 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.