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
- func Activity(w io.Writer, base, token, view string) error
- func Explain(w io.Writer, base, token, cluster, from, to string) error
- func Extract(src io.Reader, dir string, ids []age.Identity) error
- func Findings(w io.Writer, base, token string) error
- func Flows(w io.Writer, base, token, cluster, source string, limit int) error
- func Inspect(w io.Writer, src io.Reader, o InspectOptions) error
- func LoadIdentities(files []string) ([]age.Identity, error)
- func NewRedactor(p *policy.Policy) (*redact.Redactor, error)
- func ParseRecipients(specs []string) ([]age.Recipient, error)
- func PolicySource(file string, keyFiles []string) (*bundle.PolicySource, error)
- func Posture(w io.Writer, base, token, area string, all bool, top int) error
- func ProxyConfig(w io.Writer, base, token string, o ProxyConfigOptions) error
- func Query(w io.Writer, base, token, q string, limit int) error
- func Reach(w io.Writer, base, token, agent string, showFix bool) error
- func SQL(w io.Writer, base, token, q string, limit int) error
- func Search(w io.Writer, base, token, q string, limit int) error
- func Traffic(w io.Writer, base, token, flag, ns string, showFix bool) error
- type FlowFile
- type InspectOptions
- type PolicyFlags
- type ProxyConfigOptions
Constants ¶
const SQLHelp = `` /* 1430-byte string literal not displayed */
SQLHelp describes the database for the fbsql prompt.
Variables ¶
This section is empty.
Functions ¶
func Activity ¶
Activity prints who called which tool, model or agent (the fbactivity helper). view is "", "tools", "models", "denials" or "changes".
func Flows ¶
Flows prints observed traffic grouped by source and destination (the fbflows helper): who actually called whom, from every flow source.
func LoadIdentities ¶
LoadIdentities reads age identity files.
func NewRedactor ¶
NewRedactor builds the redactor a policy asks for: the built-in scrubbers, the customer's extra patterns and the fields to drop.
func ParseRecipients ¶
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 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 Reach ¶
Reach prints agent reach (the fbreach helper): every agent's blast radius, or one agent's paths, findings and fixes.
Types ¶
type FlowFile ¶
FlowFile is one --flows / --attach-flows argument: FILE or FILE@CLUSTER.
func ParseFlowFiles ¶
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 ¶
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.