Documentation
¶
Overview ¶
Package collect contains read-only Kubernetes, Istio, and Gateway API collectors.
Index ¶
- Constants
- type Collector
- type PeerAuthenticationAvailability
- type Permission
- type Scope
- type ScopedAvailability
- type Snapshot
- func (s Snapshot) AuthorizationPoliciesAvailableFor(namespace, rootNamespace string) bool
- func (s Snapshot) ClientProxiesAvailable() bool
- func (s Snapshot) DaemonSetsAvailableFor(namespace string) bool
- func (s Snapshot) DestinationRulesAvailableFor(namespace, rootNamespace string) bool
- func (s Snapshot) EndpointSlicesAvailableFor(namespace string) bool
- func (s Snapshot) GatewaysAvailable() bool
- func (s Snapshot) GatewaysAvailableFor(namespace string) bool
- func (s Snapshot) PeerAuthenticationsAvailable() bool
- func (s Snapshot) PeerAuthenticationsAvailableFor(namespace, rootNamespace string) bool
- func (s Snapshot) PodsAvailableFor(namespace string) bool
- func (s Snapshot) ReplicaSetsAvailableFor(namespace string) bool
- func (s Snapshot) ServicesAvailableFor(namespace string) bool
- func (s Snapshot) SidecarsAvailableFor(namespace, rootNamespace string) bool
Constants ¶
const DefaultRootNamespace = "istio-system"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector performs bounded, read-only list collection through typed clients.
func New ¶
func New(kube kubernetes.Interface, istio istioclient.Interface, gateway gatewayclient.Interface) *Collector
New returns a collector using typed Kubernetes, Istio, and Gateway API clients.
func (*Collector) Collect ¶
Collect lists the current typed resource set. Permission-like failures are recorded and degraded; non-permission API failures are returned.
func (*Collector) SetMaxConcurrentLists ¶
SetMaxConcurrentLists overrides the list concurrency bound. Values below 1 are ignored so callers cannot accidentally remove the bound.
type PeerAuthenticationAvailability ¶
type PeerAuthenticationAvailability = ScopedAvailability
PeerAuthenticationAvailability remains an alias for compatibility with existing hand-built snapshots and tests.
type Permission ¶
type Permission struct {
APIGroup string
Resource string
Verbs []string
Granted bool
Optional bool
Impact string
AffectedControls []string
DeniedScopes []string `json:"-"`
}
Permission records the evidence available for one attempted API resource list.
type ScopedAvailability ¶
ScopedAvailability records which namespace list scopes were available.
type Snapshot ¶
type Snapshot struct {
RootNamespace string
Namespaces []corev1.Namespace
Nodes []corev1.Node
NodesKnown bool
Pods []corev1.Pod
PodAvailability PeerAuthenticationAvailability
ZtunnelPods []corev1.Pod
ZtunnelPodsKnown bool
Deployments []appsv1.Deployment
ReplicaSets []appsv1.ReplicaSet
ReplicaSetAvailability PeerAuthenticationAvailability
StatefulSets []appsv1.StatefulSet
DaemonSets []appsv1.DaemonSet
DaemonSetAvailability PeerAuthenticationAvailability
ZtunnelDaemonSets []appsv1.DaemonSet
ZtunnelDaemonSetsKnown bool
Services []corev1.Service
ServiceAvailability ScopedAvailability
EndpointSlices []discoveryv1.EndpointSlice
EndpointSliceAvailability ScopedAvailability
PeerAuthentications []*istiosecurityv1beta1.PeerAuthentication
PeerAuthAvailability ScopedAvailability
DestinationRules []*istionetworkingv1.DestinationRule
DestinationRuleAvailability ScopedAvailability
Sidecars []*istionetworkingv1.Sidecar
SidecarAvailability ScopedAvailability
AuthorizationPolicies []*istiosecurityv1.AuthorizationPolicy
AuthorizationPolicyAvailability ScopedAvailability
Gateways []gatewayv1.Gateway
GatewayAvailability ScopedAvailability
PermissionSummary []Permission
}
Snapshot is the raw typed-resource bundle returned by collectors.
func (Snapshot) AuthorizationPoliciesAvailableFor ¶
AuthorizationPoliciesAvailableFor reports whether mesh-root and workload namespace AuthorizationPolicy evidence was collected.
func (Snapshot) ClientProxiesAvailable ¶
ClientProxiesAvailable reports whether every resource collection used to discover sidecar client proxies was complete. A gap in any scanned namespace can hide a client-selected DestinationRule, so contradiction evidence must remain unavailable rather than becoming a known false.
func (Snapshot) DaemonSetsAvailableFor ¶
DaemonSetsAvailableFor reports whether workload DaemonSet evidence was available in the requested namespace. Dedicated cluster-wide ztunnel discovery is tracked separately and must not make workload discovery incomplete when a namespace-scoped identity cannot perform that list.
func (Snapshot) DestinationRulesAvailableFor ¶
DestinationRulesAvailableFor reports whether DestinationRule evidence was collected from both the workload and root configuration namespaces.
func (Snapshot) EndpointSlicesAvailableFor ¶
EndpointSlicesAvailableFor reports whether selectorless Service endpoint attachment evidence was collected for a workload namespace.
func (Snapshot) GatewaysAvailable ¶
GatewaysAvailable reports whether every attempted Gateway API list scope succeeded, which makes the aggregate waypoint count observable.
func (Snapshot) GatewaysAvailableFor ¶
GatewaysAvailableFor reports whether Gateway API waypoint evidence was collected for the namespace that owns a selected waypoint.
func (Snapshot) PeerAuthenticationsAvailable ¶
PeerAuthenticationsAvailable reports whether the scanner could list Istio PeerAuthentication resources. A missing CRD or permission denial makes mTLS posture unknown rather than silently defaulting.
func (Snapshot) PeerAuthenticationsAvailableFor ¶
PeerAuthenticationsAvailableFor reports whether PeerAuthentication evidence is sufficient for a workload namespace under the M1 mesh-wide/namespace-only resolver. It falls back to the aggregate permission summary for hand-built tests and future callers that do not populate per-scope availability.
func (Snapshot) PodsAvailableFor ¶
PodsAvailableFor reports whether pod evidence was available for the namespace. Hand-built snapshots without permission metadata default to available so unit tests can provide explicit pods without recreating collector bookkeeping.
func (Snapshot) ReplicaSetsAvailableFor ¶
ReplicaSetsAvailableFor reports whether ReplicaSet ownership evidence was available for Deployment pod matching in the namespace.
func (Snapshot) ServicesAvailableFor ¶
ServicesAvailableFor reports whether Service selection and Service-bound port evidence were collected for a workload namespace.
func (Snapshot) SidecarsAvailableFor ¶
SidecarsAvailableFor reports whether workload-namespace and mesh-root Sidecar resource scoping evidence was collected.