firewall

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BringUpStack added in v0.12.0

func BringUpStack(ctx context.Context, ios *iostreams.IOStreams, client adminv1.AdminServiceClient) error

BringUpStack sends the idempotent FirewallInit RPC under a spinner with the shared bringup deadline, prints the stack-up summary on success, and on failure prints the stack-down exposure warning and returns the remediation-wrapped error. Shared by `firewall up` and `controlplane up` (which brings the stack up when firewall.enable is set in settings.yaml) so both verbs present identical bringup UX. The caller owns CP bootstrap and the AdminClient dial.

func NewCmdAdd

func NewCmdAdd(f *cmdutil.Factory, runF func(context.Context, *AddOptions) error) *cobra.Command

NewCmdAdd creates the firewall add command.

func NewCmdBypass

func NewCmdBypass(f *cmdutil.Factory, runF func(context.Context, *BypassOptions) error) *cobra.Command

NewCmdBypass creates the firewall bypass command.

func NewCmdDisable

func NewCmdDisable(f *cmdutil.Factory, runF func(context.Context, *DisableOptions) error) *cobra.Command

NewCmdDisable creates the firewall disable command.

func NewCmdDown

func NewCmdDown(f *cmdutil.Factory, runF func(context.Context, *DownOptions) error) *cobra.Command

NewCmdDown creates the firewall down command. Calls FirewallRemove — global teardown: stops Envoy + CoreDNS, flushes all eBPF state, cancels pending bypass timers.

func NewCmdEnable

func NewCmdEnable(f *cmdutil.Factory, runF func(context.Context, *EnableOptions) error) *cobra.Command

NewCmdEnable creates the firewall enable command.

func NewCmdFirewall

func NewCmdFirewall(f *cmdutil.Factory) *cobra.Command

NewCmdFirewall creates the parent command for firewall management.

func NewCmdList

func NewCmdList(f *cmdutil.Factory, runF func(context.Context, *ListOptions) error) *cobra.Command

NewCmdList creates the firewall list command.

func NewCmdRefresh added in v0.10.0

func NewCmdRefresh(f *cmdutil.Factory, runF func(context.Context, *RefreshOptions) error) *cobra.Command

NewCmdRefresh creates the firewall refresh command.

func NewCmdReload

func NewCmdReload(f *cmdutil.Factory, runF func(context.Context, *ReloadOptions) error) *cobra.Command

NewCmdReload creates the firewall reload command.

func NewCmdRemove

func NewCmdRemove(f *cmdutil.Factory, runF func(context.Context, *RemoveOptions) error) *cobra.Command

NewCmdRemove creates the firewall remove command.

func NewCmdRotateCA

func NewCmdRotateCA(f *cmdutil.Factory, runF func(context.Context, *RotateCAOptions) error) *cobra.Command

NewCmdRotateCA creates the firewall rotate-ca command.

func NewCmdStatus

func NewCmdStatus(f *cmdutil.Factory, runF func(context.Context, *StatusOptions) error) *cobra.Command

NewCmdStatus creates the firewall status command.

func NewCmdUp

func NewCmdUp(f *cmdutil.Factory, runF func(context.Context, *UpOptions) error) *cobra.Command

NewCmdUp creates the firewall up command. Ensures the control plane is running, then sends an idempotent FirewallInit RPC which brings up the Envoy + CoreDNS stack and confirms BPF programs are attached. `firewall up` is one of the explicit verbs that owns CP bootstrap (alongside `controlplane up` and `container start`); all other firewall admin commands fail fast when the CP is down.

Types

type AddOptions

type AddOptions struct {
	IOStreams   *iostreams.IOStreams
	AdminClient func(context.Context) (adminv1.AdminServiceClient, error)
	Domain      string
	Proto       string
	Port        string
	Path        string
	Action      string
	Methods     []string
}

AddOptions holds the options for the firewall add command.

type BypassDashboardConfig

type BypassDashboardConfig struct {
	Agent    string
	Duration time.Duration
}

BypassDashboardConfig holds the configuration for the bypass dashboard.

type BypassDashboardResult

type BypassDashboardResult struct {
	Err         error
	Detached    bool // user pressed q/Esc (switch to non-interactive)
	Interrupted bool // user pressed Ctrl+C (stop bypass)
}

BypassDashboardResult is returned when the dashboard exits.

func RunBypassDashboard

func RunBypassDashboard(ios *iostreams.IOStreams, cfg BypassDashboardConfig, ch <-chan any) BypassDashboardResult

RunBypassDashboard runs the interactive bypass dashboard.

type BypassOptions

type BypassOptions struct {
	IOStreams      *iostreams.IOStreams
	TUI            *tui.TUI
	ProjectManager func() (project.ProjectManager, error)
	AdminClient    func(context.Context) (adminv1.AdminServiceClient, error)
	Agent          string
	Duration       time.Duration
	Stop           bool
	NonInteractive bool
}

BypassOptions holds the options for the firewall bypass command.

type DisableOptions

type DisableOptions struct {
	IOStreams      *iostreams.IOStreams
	ProjectManager func() (project.ProjectManager, error)
	AdminClient    func(context.Context) (adminv1.AdminServiceClient, error)
	Agent          string
}

DisableOptions holds the options for the firewall disable command.

type DownOptions

type DownOptions struct {
	IOStreams   *iostreams.IOStreams
	Client      func(context.Context) (*docker.Client, error)
	AdminClient func(context.Context) (adminv1.AdminServiceClient, error)
}

DownOptions holds the options for the firewall down command.

type EnableOptions

type EnableOptions struct {
	IOStreams      *iostreams.IOStreams
	ProjectManager func() (project.ProjectManager, error)
	AdminClient    func(context.Context) (adminv1.AdminServiceClient, error)
	Agent          string
}

EnableOptions holds the options for the firewall enable command.

type ListOptions

type ListOptions struct {
	IOStreams   *iostreams.IOStreams
	TUI         *tui.TUI
	AdminClient func(context.Context) (adminv1.AdminServiceClient, error)
	Format      *cmdutil.FormatFlags
}

ListOptions holds the options for the firewall list command.

type RefreshOptions added in v0.10.0

type RefreshOptions struct {
	IOStreams      *iostreams.IOStreams
	Config         func() (config.Config, error)
	ProjectManager func() (project.ProjectManager, error)
	AdminClient    func(context.Context) (adminv1.AdminServiceClient, error)
}

RefreshOptions holds the options for the firewall refresh command.

type ReloadOptions

type ReloadOptions struct {
	IOStreams   *iostreams.IOStreams
	AdminClient func(context.Context) (adminv1.AdminServiceClient, error)
}

ReloadOptions holds the options for the firewall reload command.

type RemoveOptions

type RemoveOptions struct {
	IOStreams   *iostreams.IOStreams
	AdminClient func(context.Context) (adminv1.AdminServiceClient, error)
	Domain      string
	Proto       string
	Port        string
	Path        string
}

RemoveOptions holds the options for the firewall remove command.

type RotateCAOptions

type RotateCAOptions struct {
	IOStreams   *iostreams.IOStreams
	AdminClient func(context.Context) (adminv1.AdminServiceClient, error)
}

RotateCAOptions holds the options for the firewall rotate-ca command.

type StatusOptions

type StatusOptions struct {
	IOStreams   *iostreams.IOStreams
	Client      func(context.Context) (*docker.Client, error)
	AdminClient func(context.Context) (adminv1.AdminServiceClient, error)
	Format      *cmdutil.FormatFlags
}

StatusOptions holds the options for the firewall status command.

type UpOptions

type UpOptions struct {
	IOStreams    *iostreams.IOStreams
	ControlPlane func() cpboot.Manager
	AdminClient  func(context.Context) (adminv1.AdminServiceClient, error)
}

UpOptions holds the options for the firewall up command.

Jump to

Keyboard shortcuts

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