posture

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 18 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 posture scores a snapshot against security and operational checks for the agentic stack (agentgateway, kagent, agentregistry, MCP) and Istio ambient, and says what to change. The checks follow defence-in-depth guidance: authenticate every MCP and LLM route, authorise per tool, rate-limit and guard AI traffic, keep workloads in the mesh with STRICT mTLS and default-deny, and make L7 policy actually run.

Every check works from captured objects only. Where the customer excluded the data a check needs, or nothing it applies to exists, the check is marked not applicable with the reason, and never counted as a failure.

Index

Constants

View Source
const DeclaredWhy = "declared state only (repo scan)"

DeclaredWhy is the reason a check is not applicable on a repo scan: the bundle holds what the repository declares, with no status and no pods.

Variables

This section is empty.

Functions

func Impact

func Impact(c Check) float64

Impact is how much a problem matters regardless of which area it is in: severity weight times the share of credit missing. Ranking by area points alone would bury a critical check in a large area (agentic has many checks, so each is worth fewer of its points) under a high check in a small one.

func PointsIfFixed

func PointsIfFixed(r Report, c Check) float64

PointsIfFixed is the number of area score points a check would recover if every object it looked at passed: its severity weight times the credit it is missing, as a share of the area's total weight.

Types

type AreaScore

type AreaScore struct {
	Area       string         `json:"area"`
	Title      string         `json:"title"`
	Present    bool           `json:"present"`
	Reason     string         `json:"reason,omitempty"`
	Score      int            `json:"score"`
	Grade      string         `json:"grade"`
	Categories map[string]int `json:"categories"`
	Counts     map[Status]int `json:"counts"`
}

AreaScore summarises one area.

type Check

type Check struct {
	ID       string  `json:"id"`
	Area     string  `json:"area"` // agentic or ambient
	Category string  `json:"category"`
	Severity string  `json:"severity"`
	Title    string  `json:"title"`
	Why      string  `json:"why"`
	Fix      string  `json:"fix"`
	Source   string  `json:"source"`         // a related public field guide
	Docs     string  `json:"docs,omitempty"` // a related product documentation page
	Status   Status  `json:"status"`
	Reason   string  `json:"reason,omitempty"`
	Items    []Item  `json:"items"`
	Passed   int     `json:"passed"`
	Total    int     `json:"total"`
	Score    float64 `json:"score"`            // 0..1
	Points   float64 `json:"points,omitempty"` // area points recovered if fixed (Enterprise)
}

Check is one best practice and its result.

type Item

type Item struct {
	Cluster   string `json:"cluster"`
	Group     string `json:"group"`
	Resource  string `json:"resource"`
	Kind      string `json:"kind"`
	Namespace string `json:"namespace"`
	Name      string `json:"name"`
	Status    Status `json:"status"`
	Detail    string `json:"detail"`
}

Item is one object a check looked at.

type Priority

type Priority struct {
	Rank     int      `json:"rank"`
	ID       string   `json:"id"`
	Area     string   `json:"area"`
	Title    string   `json:"title"`
	Severity string   `json:"severity"`
	Status   Status   `json:"status"`
	Points   float64  `json:"points"` // area score points recovered if every object passed
	Impact   float64  `json:"impact"` // severity weight x share missing, the ranking key
	Failing  int      `json:"failing"`
	Warning  int      `json:"warning"`
	Total    int      `json:"total"`
	Objects  []string `json:"objects"` // the first few objects to change
	Fix      string   `json:"fix"`
	Source   string   `json:"source"`
	Docs     string   `json:"docs,omitempty"`
}

Priority is one problem to fix, ranked by the score it would give back.

func Priorities

func Priorities(r Report, n int) []Priority

Priorities ranks the failing and warning checks by impact, then severity, then points recovered, then objects affected. n <= 0 returns all.

type Report

type Report struct {
	Areas      []AreaScore `json:"areas"`
	Checks     []Check     `json:"checks"`
	Priorities []Priority  `json:"priorities,omitempty"` // Enterprise: fix-first ranking
}

Report is the full result.

func Evaluate

func Evaluate(ws *store.Workspace) Report

Evaluate runs every check on every cluster and scores each area.

func (Report) Only

func (r Report) Only(area string) Report

Only keeps one area: its score, its checks and its priorities.

func (Report) WithPriorities

func (r Report) WithPriorities(top int) Report

WithPriorities fills in points recovered per check and the fix-first ranking (the Flightbay Enterprise priority view). top <= 0 keeps them all.

type Status

type Status string

Status of a check or of one object within it.

const (
	Pass Status = "pass"
	Warn Status = "warn"
	Fail Status = "fail"
	NA   Status = "na"
)

Jump to

Keyboard shortcuts

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