cli

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 23 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 cli holds the testable parts of the flightbay and flightbay-desk commands: policy flags, bundle inspection and extraction, and the small desk client behind the fbq and fbfind shell helpers.

Index

Constants

View Source
const SQLHelp = `` /* 1430-byte string literal not displayed */

SQLHelp describes the database for the fbsql prompt.

Variables

This section is empty.

Functions

func Activity

func Activity(w io.Writer, base, token, view string) error

Activity prints who called which tool, model or agent (the fbactivity helper). view is "", "tools", "models", "denials" or "changes".

func Explain

func Explain(w io.Writer, base, token, cluster, from, to string) error

Explain prints why from can or cannot reach to (the fbexplain helper).

func Extract

func Extract(src io.Reader, dir string, ids []age.Identity) error

Extract writes every member under dir after validating its path, then verifies.

func Findings

func Findings(w io.Writer, base, token string) error

Findings prints analyzer results (the fbfind helper).

func Flows

func Flows(w io.Writer, base, token, cluster, source string, limit int) error

Flows prints observed traffic grouped by source and destination (the fbflows helper): who actually called whom, from every flow source.

func Inspect

func Inspect(w io.Writer, src io.Reader, o InspectOptions) error

Inspect reads a whole bundle, verifies it and prints what it contains.

func LoadIdentities

func LoadIdentities(files []string) ([]age.Identity, error)

LoadIdentities reads age identity files.

func NewRedactor

func NewRedactor(p *policy.Policy) (*redact.Redactor, error)

NewRedactor builds the redactor a policy asks for: the built-in scrubbers, the customer's extra patterns and the fields to drop.

func ParseRecipients

func ParseRecipients(specs []string) ([]age.Recipient, error)

ParseRecipients reads age recipients: age1... strings or @file.

func PolicySource

func PolicySource(file string, keyFiles []string) (*bundle.PolicySource, error)

PolicySource hashes a policy file and checks FILE.sig when it exists. With trusted keys the signature is required and must be by one of them.

func Posture

func Posture(w io.Writer, base, token, area string, all bool, top int) error

Posture prints best-practice scores and what to fix.

func ProxyConfig

func ProxyConfig(w io.Writer, base, token string, o ProxyConfigOptions) error

ProxyConfig prints a captured component's summary or one of its files (the fbpc helper). With no pod it lists what was captured.

func Query

func Query(w io.Writer, base, token, q string, limit int) error

Query prints log search results (the fbq helper).

func Reach

func Reach(w io.Writer, base, token, agent string, showFix bool) error

Reach prints agent reach (the fbreach helper): every agent's blast radius, or one agent's paths, findings and fixes.

func SQL

func SQL(w io.Writer, base, token, q string, limit int) error

SQL runs one read-only query and prints a table (the fbsql helper).

func Search(w io.Writer, base, token, q string, limit int) error

Search prints objects of any kind matching a query (the fbsearch helper).

func Traffic

func Traffic(w io.Writer, base, token, flag, ns string, showFix bool) error

Traffic prints the ambient traffic map (the fbtraffic helper). flag keeps only edges with that flag (plaintext, unpoliced, denied, mismatch).

Types

type FlowFile

type FlowFile struct {
	Path    string
	Cluster string // "" = the first cluster in the bundle
}

FlowFile is one --flows / --attach-flows argument: FILE or FILE@CLUSTER.

func ParseFlowFiles

func ParseFlowFiles(args []string) ([]FlowFile, error)

ParseFlowFiles splits FILE[@CLUSTER] arguments and checks each file exists.

type InspectOptions

type InspectOptions struct {
	Contents, Redactions, Policy bool
	Identities                   []age.Identity
	Trusted                      []sign.PublicKey // keys to check the signature against
	RequireTrusted               bool             // fail unless signed by one of Trusted
}

InspectOptions choose what inspect prints.

type PolicyFlags

type PolicyFlags struct {
	// contains filtered or unexported fields
}

PolicyFlags are the collection flags shared by collect, rbac and dry runs.

func (*PolicyFlags) Register

func (f *PolicyFlags) Register(fs *pflag.FlagSet)

Register adds the flags to a flag set.

func (*PolicyFlags) Resolve

func (f *PolicyFlags) Resolve(fs *pflag.FlagSet) (*policy.Policy, error)

Resolve builds the policy: profile, then config file, then changed flags.

func (*PolicyFlags) ResolveFile

func (f *PolicyFlags) ResolveFile(file string) (*policy.Policy, error)

ResolveFile loads a policy file the way --config does, with no flags.

func (*PolicyFlags) Source

func (f *PolicyFlags) Source() *bundle.PolicySource

Source describes the policy file used, with its signature check; nil without --config. Valid after Resolve.

type ProxyConfigOptions

type ProxyConfigOptions struct {
	Cluster, Namespace, Pod string
	File                    string // print this captured file raw
	Section                 string // only tables whose title contains this
}

ProxyConfigOptions select what fbpc prints.

Jump to

Keyboard shortcuts

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