configdump

package
v0.0.0-...-4b288b9 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationTunnel

type ApplicationTunnel struct {
	Protocol string  `json:"protocol"`
	Port     *uint16 `json:"port,omitempty"`
}

type Cert

type Cert struct {
	Pem            string `json:"pem"`
	SerialNumber   string `json:"serialNumber"`
	ValidFrom      string `json:"validFrom"`
	ExpirationTime string `json:"expirationTime"`
}

type CertsDump

type CertsDump struct {
	Identity  string  `json:"identity"`
	State     string  `json:"state"`
	CertChain []*Cert `json:"certChain"`
}

type ConfigWriter

type ConfigWriter struct {
	Stdout io.Writer

	FullDump []byte
	// contains filtered or unexported fields
}

ConfigWriter is a writer for processing responses from the Ztunnel Admin config_dump endpoint

func (*ConfigWriter) Prime

func (c *ConfigWriter) Prime(b []byte) error

Prime loads the config dump into the writer ready for printing

func (*ConfigWriter) PrintBootstrapDump

func (c *ConfigWriter) PrintBootstrapDump(outputFormat string) error

PrintBootstrapDump prints just the bootstrap config dump to the ConfigWriter stdout

func (*ConfigWriter) PrintConnectionsDump

func (c *ConfigWriter) PrintConnectionsDump(filter ConnectionsFilter, outputFormat string) error

func (*ConfigWriter) PrintConnectionsSummary

func (c *ConfigWriter) PrintConnectionsSummary(filter ConnectionsFilter) error

func (*ConfigWriter) PrintFullDump

func (c *ConfigWriter) PrintFullDump(outputFormat string) error

func (*ConfigWriter) PrintFullSummary

func (c *ConfigWriter) PrintFullSummary() error

func (*ConfigWriter) PrintPodRootCAFromDynamicSecretDump

func (c *ConfigWriter) PrintPodRootCAFromDynamicSecretDump() (string, error)

PrintPodRootCAFromDynamicSecretDump prints just pod's root ca from dynamic secret config dump to the ConfigWriter stdout

func (*ConfigWriter) PrintPolicyDump

func (c *ConfigWriter) PrintPolicyDump(filter PolicyFilter, outputFormat string) error

PrintPolicyDump prints the relevant services in the config dump to the ConfigWriter stdout

func (*ConfigWriter) PrintPolicySummary

func (c *ConfigWriter) PrintPolicySummary(filter PolicyFilter) error

PrintServiceSummary prints a summary of the relevant services in the config dump to the ConfigWriter stdout

func (*ConfigWriter) PrintSecretDump

func (c *ConfigWriter) PrintSecretDump(outputFormat string) error

PrintSecretDump prints just the secret config dump to the ConfigWriter stdout

func (*ConfigWriter) PrintSecretSummary

func (c *ConfigWriter) PrintSecretSummary() error

PrintSecretSummary prints a summary of dynamic active secrets from the config dump

func (*ConfigWriter) PrintServiceDump

func (c *ConfigWriter) PrintServiceDump(filter ServiceFilter, outputFormat string) error

PrintServiceDump prints the relevant services in the config dump to the ConfigWriter stdout

func (*ConfigWriter) PrintServiceSummary

func (c *ConfigWriter) PrintServiceSummary(filter ServiceFilter) error

PrintServiceSummary prints a summary of the relevant services in the config dump to the ConfigWriter stdout

func (*ConfigWriter) PrintVersionSummary

func (c *ConfigWriter) PrintVersionSummary() error

PrintVersionSummary prints version information for Istio and Ztunnel from the config dump

func (*ConfigWriter) PrintWorkloadDump

func (c *ConfigWriter) PrintWorkloadDump(filter WorkloadFilter, outputFormat string) error

PrintWorkloadDump prints the relevant workloads in the config dump to the ConfigWriter stdout

func (*ConfigWriter) PrintWorkloadSummary

func (c *ConfigWriter) PrintWorkloadSummary(filter WorkloadFilter) error

PrintWorkloadSummary prints a summary of the relevant listeners in the config dump to the ConfigWriter stdout

type ConnectionsFilter

type ConnectionsFilter struct {
	Namespace string
	Direction string
	Raw       bool
}

type GatewayAddress

type GatewayAddress struct {
	Destination string `json:"destination"`
}

type InboundConnection

type InboundConnection struct {
	Src         string `json:"src"`
	OriginalDst string `json:"originalDst"`
	ActualDst   string `json:"actualDst"`
}

type LoadBalancer

type LoadBalancer struct {
	Mode               string   `json:"mode"`
	RoutingPreferences []string `json:"routingPreferences"`
	HealthPolicy       string   `json:"healthPolicy"`
}

type Locality

type Locality struct {
	Region  string `json:"region,omitempty"`
	Zone    string `json:"zone,omitempty"`
	Subzone string `json:"subzone,omitempty"`
}

type OutboundConnection

type OutboundConnection struct {
	Src         string `json:"src"`
	OriginalDst string `json:"originalDst"`
	ActualDst   string `json:"actualDst"`
}

type PolicyFilter

type PolicyFilter struct {
	Namespace string
}

PolicyFilter is used to pass filter information into service based config writer print functions

func (*PolicyFilter) Verify

func (wf *PolicyFilter) Verify(pol *ZtunnelPolicy) bool

Verify returns true if the passed workload matches the filter fields

type PolicyMatch

type PolicyMatch struct {
	Namespaces          []StringMatch `json:"namespaces,omitempty"`
	NotNamespaces       []StringMatch `json:"notNamespaces,omitempty"`
	Principals          []StringMatch `json:"principals,omitempty"`
	NotPrincipals       []StringMatch `json:"notPrincipals,omitempty"`
	SourceIps           []string      `json:"sourceIps,omitempty"`
	NotSourceIps        []string      `json:"notSourceIps,omitempty"`
	DestinationIps      []string      `json:"destinationIps,omitempty"`
	NotDestinationIps   []string      `json:"notDestinationIps,omitempty"`
	DestinationPorts    []uint16      `json:"destinationPorts,omitempty"`
	NotDestinationPorts []uint16      `json:"notDestinationPorts,omitempty"`
}

type ServiceFilter

type ServiceFilter struct {
	Namespace string
}

ServiceFilter is used to pass filter information into service based config writer print functions

func (*ServiceFilter) Verify

func (wf *ServiceFilter) Verify(svc *ZtunnelService) bool

Verify returns true if the passed workload matches the filter fields

type StringMatch

type StringMatch struct {
	Exact    string `json:"Exact,omitempty"`
	Suffix   string `json:"Suffix,omitempty"`
	Prefix   string `json:"Prefix,omitempty"`
	Presence any    `json:"Presence,omitempty"`
}

type WorkloadConnection

type WorkloadConnection struct {
	Src         string `json:"src"`
	Dst         string `json:"dst"`
	SrcIdentity string `json:"src_identity"`
	DstNetwork  string `json:"dst_network"`
}

type WorkloadConnections

type WorkloadConnections struct {
	Inbound  []InboundConnection  `json:"inbound"`
	Outbound []OutboundConnection `json:"outbound"`
}

type WorkloadFilter

type WorkloadFilter struct {
	Address   string
	Node      string
	Namespace string
}

WorkloadFilter is used to pass filter information into workload based config writer print functions

func (*WorkloadFilter) Verify

func (wf *WorkloadFilter) Verify(workload *ZtunnelWorkload) bool

Verify returns true if the passed workload matches the filter fields

type WorkloadInfo

type WorkloadInfo struct {
	Name           string `json:"name"`
	Namespace      string `json:"namespace"`
	TrustDomain    string `json:"trustDomain"`
	ServiceAccount string `json:"serviceAccount"`
}

type WorkloadState

type WorkloadState struct {
	State       string              `json:"state,omitempty"`
	Connections WorkloadConnections `json:"connections,omitempty"`
	Info        WorkloadInfo        `json:"info"`
}

type ZtunnelDump

type ZtunnelDump struct {
	Workloads     []*ZtunnelWorkload       `json:"workloads"`
	Services      []*ZtunnelService        `json:"services"`
	Policies      []*ZtunnelPolicy         `json:"policies"`
	Certificates  []*CertsDump             `json:"certificates"`
	WorkloadState map[string]WorkloadState `json:"workloadState"`
}

type ZtunnelEndpoint

type ZtunnelEndpoint struct {
	WorkloadUID string            `json:"workloadUid"`
	Service     string            `json:"service"`
	Address     string            `json:"address,omitempty"`
	Port        map[uint16]uint16 `json:"port"`
}

type ZtunnelPolicy

type ZtunnelPolicy struct {
	Name      string             `json:"name"`
	Namespace string             `json:"namespace"`
	Scope     string             `json:"scope"`
	Action    string             `json:"action"`
	Rules     [][][]*PolicyMatch `json:"rules"`
}

type ZtunnelService

type ZtunnelService struct {
	Name            string                      `json:"name"`
	Namespace       string                      `json:"namespace"`
	Hostname        string                      `json:"hostname"`
	Addresses       []string                    `json:"vips"`
	Ports           map[string]int              `json:"ports"`
	LoadBalancer    *LoadBalancer               `json:"loadBalancer,omitempty"`
	Waypoint        *GatewayAddress             `json:"waypoint,omitempty"`
	Endpoints       map[string]*ZtunnelEndpoint `json:"endpoints"`
	SubjectAltNames []string                    `json:"subjectAltNames,omitempty"`
	IPFamilies      string                      `json:"ipFamilies"`
}

type ZtunnelWorkload

type ZtunnelWorkload struct {
	UID                   string            `json:"uid"`
	WorkloadIPs           []string          `json:"workloadIps"`
	Waypoint              *GatewayAddress   `json:"waypoint,omitempty"`
	NetworkGateway        *GatewayAddress   `json:"networkGateway,omitempty"`
	Protocol              string            `json:"protocol"`
	Name                  string            `json:"name"`
	Namespace             string            `json:"namespace"`
	ServiceAccount        string            `json:"serviceAccount"`
	WorkloadName          string            `json:"workloadName"`
	WorkloadType          string            `json:"workloadType"`
	CanonicalName         string            `json:"canonicalName"`
	CanonicalRevision     string            `json:"canonicalRevision"`
	ClusterID             string            `json:"clusterId"`
	TrustDomain           string            `json:"trustDomain,omitempty"`
	Locality              Locality          `json:"locality,omitempty"`
	Node                  string            `json:"node"`
	Network               string            `json:"network,omitempty"`
	Status                string            `json:"status"`
	Hostname              string            `json:"hostname"`
	ApplicationTunnel     ApplicationTunnel `json:"applicationTunnel,omitempty"`
	AuthorizationPolicies []string          `json:"authorizationPolicies,omitempty"`
}

Jump to

Keyboard shortcuts

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