v1alpha1

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 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 v1alpha1 holds the Inkwall Kubernetes API (group waf.inkwall.dev): the cluster configuration, the policies app teams attach to their routes, and the rule sets those policies use. Design: docs/design/0002 §4.2 and docs/design/0004 §3.

+kubebuilder:object:generate=true +groupName=waf.inkwall.dev

Index

Constants

View Source
const (
	// ConditionAccepted is True when the spec is valid and its references
	// resolve.
	ConditionAccepted = "Accepted"
	// ConditionProgrammed is True when every targeted route's proxy sends
	// traffic to Inkwall.
	ConditionProgrammed = "Programmed"
	// ConditionEnforced is True when every engine serving the targets has
	// applied a bundle containing the current generation.
	ConditionEnforced = "Enforced"
	// ConditionReady is True when Accepted, Programmed and Enforced are.
	ConditionReady = "Ready"
	// ConditionControlPlaneConnected, on the InkwallConfig, says whether the
	// cluster is enrolled and connected to the optional control plane
	// (GitOps and Managed mode only).
	ConditionControlPlaneConnected = "ControlPlaneConnected"
	// ConditionSuspended, on the InkwallConfig, is True while the published
	// bundle suspends inspection (spec.suspend): every engine allows every
	// request.
	ConditionSuspended = "Suspended"
	// ConditionSigningKeyRotation, on the InkwallConfig, is True while a
	// bundle signing key rotation is in progress; its message says what the
	// rotation waits for.
	ConditionSigningKeyRotation = "SigningKeyRotation"
	// ConditionIntegrationsConfigured, on the InkwallConfig, is False when
	// spec.integrations can't be applied (an invalid selector), with why.
	ConditionIntegrationsConfigured = "IntegrationsConfigured"
	// ConditionEngineRollout, on the InkwallConfig, is True while the
	// operator replaces proxy pods for a new engine (spec.engine.rollout:
	// Automatic), and False when it has nothing to replace, is paused
	// (reason Paused, saying why) or the rollout is Manual.
	ConditionEngineRollout = "EngineRollout"
	// ConditionEngineConfigured, on the InkwallConfig, is False when the
	// engine pinned in spec.engine.image is injected without some
	// spec.engine settings, because its release (or a custom build) may
	// not know their flags; the message names them.
	ConditionEngineConfigured = "EngineConfigured"
)

Condition types. Every WAFPolicy reports all four (0004 §3.2); the other kinds report Accepted.

View Source
const (
	SourceLabel = "inkwall.dev/source"
	SourceSaaS  = "saas"
)

SourceLabel says where a WAFPolicy, WAFRuleSet, ClusterWAFRuleSet or WAFIPList comes from. In Managed mode the operator writes the control plane's policies labelled SourceSaaS (0004 §4.9), and the validating webhook lets no one else create, change or delete them, or add or remove the label.

View Source
const RotateSigningKeyAnnotation = "waf.inkwall.dev/rotate-signing-key"

RotateSigningKeyAnnotation on the InkwallConfig requests a rotation of the bundle signing key: each new value starts one (a timestamp, say). The operator publishes a new key to the engines, switches to it once every connected engine trusts it, and retires the old key once every engine runs a bundle signed with the new one. A request made during a rotation starts another one after it.

Variables

View Source
var (
	// GroupVersion is the API group and version of these types.
	GroupVersion = schema.GroupVersion{Group: "waf.inkwall.dev", Version: "v1alpha1"}

	// SchemeBuilder registers the types with a runtime.Scheme.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme adds the types to a runtime.Scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type AdapterKind

type AdapterKind string

AdapterKind is how a proxy hands requests to the engine (0006). +kubebuilder:validation:Enum=ExtProc;ExtAuthz;LuaPlugin;AuthURL;ForwardAuth;SPOE;Module

const (
	AdapterExtProc     AdapterKind = "ExtProc"
	AdapterExtAuthz    AdapterKind = "ExtAuthz"
	AdapterLuaPlugin   AdapterKind = "LuaPlugin"
	AdapterAuthURL     AdapterKind = "AuthURL"
	AdapterForwardAuth AdapterKind = "ForwardAuth"
	AdapterSPOE        AdapterKind = "SPOE"
	AdapterModule      AdapterKind = "Module"
)

The adapter kinds.

type ArgumentPattern added in v0.5.0

type ArgumentPattern string

ArgumentPattern is part of an argument name, as WAFPolicy exclusions name arguments. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=256 +kubebuilder:validation:Pattern=`^[A-Za-z0-9_.\-\[\]]+$`

type BodySpec

type BodySpec struct {
	// Inspect turns body inspection on or off.
	// +kubebuilder:default=true
	// +optional
	Inspect *bool `json:"inspect,omitempty"`

	// MaxBytes is how much of a body is inspected, at most 10 MiB. Unset:
	// the engine's default (64 KiB).
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=10485760
	// +optional
	MaxBytes *int64 `json:"maxBytes,omitempty"`

	// OnOversize is what happens to a body over maxBytes: Deny (413 in
	// Block mode) or Allow (forwarded uninspected, and logged). Unset: Deny
	// in Block mode, Allow in Detect mode.
	// +optional
	OnOversize OversizeAction `json:"onOversize,omitempty"`

	// GRPCMessages decides whether the text in gRPC calls' messages is
	// inspected: Inspect reads each protobuf message without its schema
	// and gives its text fields to the rules as form arguments; a message
	// that can't be read (cut at maxBytes, compressed other than with
	// gzip, not protobuf) is handled by onOversize. Unset: Skip, only the
	// call's path and metadata are inspected. See docs/grpc.md.
	// +optional
	GRPCMessages GRPCMessagesAction `json:"grpcMessages,omitempty"`

	// GRPCStreams decides how the messages are read, with grpcMessages:
	// Inspect. PerMessage inspects each message on its own as it comes,
	// up to maxBytes each, so long client streams and bidirectional calls
	// work; the messages before a denied one have already reached the
	// application. Through Envoy Gateway and Istio; other proxies buffer
	// the body as with Buffer. Unset: Buffer, the body the proxy buffers,
	// up to maxBytes in all. Requires engines 0.6.0 or later. See
	// docs/grpc.md.
	// +optional
	GRPCStreams GRPCStreamsMode `json:"grpcStreams,omitempty"`

	// GRPC: Deny refuses requests with a gRPC or gRPC-Web content type
	// (403, or the gRPC status PermissionDenied to a gRPC client; logged in
	// Detect mode), for routes that serve no gRPC. Unset: Allow. Requires
	// engines 0.5.0 or later. See docs/grpc.md.
	// +optional
	GRPC GRPCAction `json:"grpc,omitempty"`
}

BodySpec configures request body inspection. +kubebuilder:validation:XValidation:rule="!has(self.grpcStreams) || self.grpcStreams != 'PerMessage' || (has(self.grpcMessages) && self.grpcMessages == 'Inspect' && (!has(self.inspect) || self.inspect))",message="grpcStreams: PerMessage needs grpcMessages: Inspect and body inspection"

func (*BodySpec) DeepCopy

func (in *BodySpec) DeepCopy() *BodySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BodySpec.

func (*BodySpec) DeepCopyInto

func (in *BodySpec) DeepCopyInto(out *BodySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BootstrapMode

type BootstrapMode string

BootstrapMode is what an engine does with requests before it has a policy bundle (0004 §4.6). +kubebuilder:validation:Enum=AllowAll;DenyAll

const (
	// BootstrapAllowAll lets requests through uninspected: availability
	// first.
	BootstrapAllowAll BootstrapMode = "AllowAll"
	// BootstrapDenyAll rejects them with 503.
	BootstrapDenyAll BootstrapMode = "DenyAll"
)

The bootstrap modes.

type BuiltinRuleSet

type BuiltinRuleSet string

BuiltinRuleSet names a rule set shipped inside the engine image, pinned to the engine's version. +kubebuilder:validation:Enum=crs-v4

const BuiltinCRSv4 BuiltinRuleSet = "crs-v4"

BuiltinCRSv4 is the OWASP Core Rule Set v4.

type BundleStatus added in v0.5.0

type BundleStatus struct {
	// Version of the bundle published.
	Version int64 `json:"version"`

	// CompressedBytes is its size as stored, gzip-compressed.
	CompressedBytes int64 `json:"compressedBytes"`

	// LimitBytes is the largest bundle that can be published: past it,
	// policy changes aren't published (BundleTooLarge).
	LimitBytes int64 `json:"limitBytes"`
}

BundleStatus describes the published bundle.

func (*BundleStatus) DeepCopy added in v0.5.0

func (in *BundleStatus) DeepCopy() *BundleStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BundleStatus.

func (*BundleStatus) DeepCopyInto added in v0.5.0

func (in *BundleStatus) DeepCopyInto(out *BundleStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CIDR added in v0.5.0

type CIDR string

CIDR is an IPv4 or IPv6 prefix (10.0.0.0/8) or address. +kubebuilder:validation:MinLength=2 +kubebuilder:validation:MaxLength=49 +kubebuilder:validation:Pattern=`^[0-9A-Fa-f.:]+(/[0-9]{1,3})?$`

type CRSSettings added in v0.5.0

type CRSSettings struct {
	// AllowedMethods replaces the request methods the CRS allows (GET, HEAD,
	// POST and OPTIONS by default; rule 911100). List every method the
	// application serves, for example PUT, PATCH and DELETE for a REST API.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=64
	// +listType=set
	// +optional
	AllowedMethods []HTTPMethodToken `json:"allowedMethods,omitempty"`

	// AllowedRequestContentTypes replaces the request media types the CRS
	// allows (rule 920420), as type/subtype without parameters, for example
	// application/json. Compared case-insensitively.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=64
	// +listType=set
	// +optional
	AllowedRequestContentTypes []MediaType `json:"allowedRequestContentTypes,omitempty"`

	// DetectionParanoiaLevel runs the rules above paranoiaLevel, up to this
	// level, without blocking: a request they would have blocked is
	// logged. From paranoiaLevel to 4.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=4
	// +optional
	DetectionParanoiaLevel *int32 `json:"detectionParanoiaLevel,omitempty"`

	// OutboundAnomalyThreshold is the response anomaly score at which a
	// response is blocked (the CRS's default is 4). Only used when the
	// policy inspects responses.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=10000
	// +optional
	OutboundAnomalyThreshold *int32 `json:"outboundAnomalyThreshold,omitempty"`
}

CRSSettings are OWASP CRS settings (its tx variables), applied to each request before the CRS's defaults. Unset fields keep the CRS's defaults.

func (*CRSSettings) DeepCopy added in v0.5.0

func (in *CRSSettings) DeepCopy() *CRSSettings

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRSSettings.

func (*CRSSettings) DeepCopyInto added in v0.5.0

func (in *CRSSettings) DeepCopyInto(out *CRSSettings)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CRSSettings) IsZero added in v0.5.0

func (s *CRSSettings) IsZero() bool

IsZero reports whether s sets nothing (s may be nil).

type ClientIPSpec added in v0.5.0

type ClientIPSpec struct {
	// TrustedProxies are the addresses or CIDR prefixes of proxies in front
	// of the proxy the engine runs beside (load balancers) whose
	// X-Forwarded-For entries are trusted. The loopback is always trusted.
	// +kubebuilder:validation:MaxItems=32
	// +listType=set
	// +optional
	TrustedProxies []CIDR `json:"trustedProxies,omitempty"`

	// TrustedHops is how many X-Forwarded-For entries, from the right and
	// after those the proxy beside the engine added, are proxies whatever
	// their address: for load balancers without fixed addresses. 0: none.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=10
	// +optional
	TrustedHops *int32 `json:"trustedHops,omitempty"`
}

ClientIPSpec configures how engines find the client's address.

func (*ClientIPSpec) DeepCopy added in v0.5.0

func (in *ClientIPSpec) DeepCopy() *ClientIPSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientIPSpec.

func (*ClientIPSpec) DeepCopyInto added in v0.5.0

func (in *ClientIPSpec) DeepCopyInto(out *ClientIPSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ClusterMode

type ClusterMode string

ClusterMode is where a cluster's policy comes from (0002 §4.1). +kubebuilder:validation:Enum=Standalone;GitOps;Managed

const (
	// ModeStandalone takes policy from the CRDs, with no control plane.
	ModeStandalone ClusterMode = "Standalone"
	// ModeGitOps takes policy from the CRDs and mirrors it, read-only, to
	// the control plane.
	ModeGitOps ClusterMode = "GitOps"
	// ModeManaged takes policy from the control plane, which the operator
	// writes as CRDs; edits by anyone else are rejected.
	ModeManaged ClusterMode = "Managed"
)

type ClusterRuleSetSource

type ClusterRuleSetSource struct {
	// Builtin is a rule set shipped in the engine image.
	// +optional
	Builtin BuiltinRuleSet `json:"builtin,omitempty"`

	// SecLang holds the rules inline, at most 256 KiB.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=262144
	// +optional
	SecLang string `json:"seclang,omitempty"`

	// ConfigMapRef reads the rules from a ConfigMap.
	// +optional
	ConfigMapRef *NamespacedConfigMapKeyRef `json:"configMapRef,omitempty"`
}

ClusterRuleSetSource is where a ClusterWAFRuleSet's rules come from: exactly one of builtin, seclang or configMapRef. +kubebuilder:validation:XValidation:rule="[has(self.builtin), has(self.seclang), has(self.configMapRef)].filter(x, x).size() == 1",message="set exactly one of builtin, seclang or configMapRef"

func (*ClusterRuleSetSource) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRuleSetSource.

func (*ClusterRuleSetSource) DeepCopyInto

func (in *ClusterRuleSetSource) DeepCopyInto(out *ClusterRuleSetSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ClusterWAFRuleSet

type ClusterWAFRuleSet struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec ClusterWAFRuleSetSpec `json:"spec"`
	// +optional
	Status RuleSetStatus `json:"status,omitempty"`
}

ClusterWAFRuleSet is a set of rules that policies in any namespace can use.

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster,categories=inkwall,shortName=cwafrs +kubebuilder:printcolumn:name="Builtin",type=string,JSONPath=`.spec.source.builtin` +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*ClusterWAFRuleSet) DeepCopy

func (in *ClusterWAFRuleSet) DeepCopy() *ClusterWAFRuleSet

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterWAFRuleSet.

func (*ClusterWAFRuleSet) DeepCopyInto

func (in *ClusterWAFRuleSet) DeepCopyInto(out *ClusterWAFRuleSet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterWAFRuleSet) DeepCopyObject

func (in *ClusterWAFRuleSet) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterWAFRuleSetList

type ClusterWAFRuleSetList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterWAFRuleSet `json:"items"`
}

ClusterWAFRuleSetList is a list of ClusterWAFRuleSet.

+kubebuilder:object:root=true

func (*ClusterWAFRuleSetList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterWAFRuleSetList.

func (*ClusterWAFRuleSetList) DeepCopyInto

func (in *ClusterWAFRuleSetList) DeepCopyInto(out *ClusterWAFRuleSetList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterWAFRuleSetList) DeepCopyObject

func (in *ClusterWAFRuleSetList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterWAFRuleSetSpec

type ClusterWAFRuleSetSpec struct {
	// Source of the rules.
	Source ClusterRuleSetSource `json:"source"`
}

ClusterWAFRuleSetSpec defines a cluster-wide rule set.

func (*ClusterWAFRuleSetSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterWAFRuleSetSpec.

func (*ClusterWAFRuleSetSpec) DeepCopyInto

func (in *ClusterWAFRuleSetSpec) DeepCopyInto(out *ClusterWAFRuleSetSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConfigMapKeyRef

type ConfigMapKeyRef struct {
	// Name of the ConfigMap.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	Name string `json:"name"`

	// Key holding the SecLang rules.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	Key string `json:"key"`
}

ConfigMapKeyRef names a key of a ConfigMap in the rule set's namespace.

func (*ConfigMapKeyRef) DeepCopy

func (in *ConfigMapKeyRef) DeepCopy() *ConfigMapKeyRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapKeyRef.

func (*ConfigMapKeyRef) DeepCopyInto

func (in *ConfigMapKeyRef) DeepCopyInto(out *ConfigMapKeyRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ControlPlane

type ControlPlane struct {
	// Endpoint is the control plane's gRPC address, as grpcs://host:port.
	// +kubebuilder:validation:Pattern=`^grpcs://[^/\s]+$`
	// +kubebuilder:validation:MaxLength=512
	Endpoint string `json:"endpoint"`

	// EnrollmentSecretRef is the Secret holding the enrollment token.
	EnrollmentSecretRef SecretReference `json:"enrollmentSecretRef"`
}

ControlPlane is the connection to the optional control plane.

func (*ControlPlane) DeepCopy

func (in *ControlPlane) DeepCopy() *ControlPlane

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlane.

func (*ControlPlane) DeepCopyInto

func (in *ControlPlane) DeepCopyInto(out *ControlPlane)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EngineCounts added in v0.5.0

type EngineCounts struct {
	// Connected engines.
	Connected int32 `json:"connected"`

	// Current engines run the published bundle.
	Current int32 `json:"current"`

	// Behind engines run an older bundle, and haven't rejected the
	// published one.
	Behind int32 `json:"behind"`

	// Rejected engines rejected the published bundle.
	Rejected int32 `json:"rejected"`

	// Outdated engines are too old for a field some policy sets, which they
	// ignore (EnginesOutdated).
	Outdated int32 `json:"outdated"`
}

EngineCounts counts the connected engines, as of the replicas' latest engine reports.

func (*EngineCounts) DeepCopy added in v0.5.0

func (in *EngineCounts) DeepCopy() *EngineCounts

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EngineCounts.

func (*EngineCounts) DeepCopyInto added in v0.5.0

func (in *EngineCounts) DeepCopyInto(out *EngineCounts)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EngineSpec

type EngineSpec struct {
	// Image is the engine image. Empty means the image released with this
	// operator version. An image whose tag is an older release (0.4.1) is
	// injected without the settings below that release doesn't know, and
	// one whose tag isn't a release (latest, a digest alone) without any
	// setting some release doesn't know, so it starts: the EngineConfigured
	// condition names them.
	// +kubebuilder:validation:MaxLength=512
	// +optional
	Image string `json:"image,omitempty"`

	// Resources of the engine container. Setting no CPU limit is
	// recommended: CPU throttling shows up as tail latency on every request.
	// +optional
	Resources *corev1.ResourceRequirements `json:"resources,omitempty"`

	// SocketDir is ignored: each integration places the engine's socket
	// itself (Envoy Gateway's in /var/run/inkwall-socket; Traefik reaches
	// the engine over loopback TCP). It stays so that InkwallConfigs that
	// set it remain valid; setting it draws a warning.
	//
	// Deprecated: remove it from the InkwallConfig.
	//
	// +kubebuilder:validation:MaxLength=64
	// +optional
	SocketDir string `json:"socketDir,omitempty"`

	// BootstrapMode is what a new engine does with requests when it has no
	// bundle yet: no cached bundle, the bundle Secret unreadable and the
	// operator unreachable. It waits up to 10 seconds for one before its
	// proxy takes traffic, then allows (AllowAll) or rejects (DenyAll) the
	// requests until a bundle arrives. Applies to pods injected from then
	// on.
	// +kubebuilder:default=AllowAll
	// +optional
	BootstrapMode BootstrapMode `json:"bootstrapMode,omitempty"`

	// LogLevel is the engines' log level: Debug, Info, Warn or Error.
	// Security events are logged at Warn, so Error hides them (they still
	// go to the operator). Unset: the engine's default, Info. Applies to
	// pods injected from then on.
	// +optional
	LogLevel LogLevel `json:"logLevel,omitempty"`

	// Rollout is how proxy pods that need a new engine (none: started
	// before Inkwall; or another image than the one configured) get one.
	// Manual: they are reported (PendingRestart) and you restart them.
	// Automatic: the operator evicts them one at a time through the
	// Eviction API, which respects PodDisruptionBudgets, waiting for each
	// replacement to be ready and run the current bundle before the next;
	// it pauses, and says why on the InkwallConfig (EngineRollout), when an
	// eviction is refused or a replacement isn't ready in time. Pods the
	// Pod webhook injects only (Traefik, HAProxy, Istio's ingress gateways):
	// Envoy Gateway and Istio's Gateway API deployments roll their pods
	// themselves. Unset: Manual.
	// +optional
	Rollout RolloutPolicy `json:"rollout,omitempty"`

	// PolicyMetrics adds inkwall_policy_requests_total, the engines'
	// requests by policy, for up to 500 policies per engine (the rest count
	// as policy="other"). Off by default: one series per policy, action and
	// reason. Applies to pods injected from then on.
	// +optional
	PolicyMetrics bool `json:"policyMetrics,omitempty"`

	// JSONDenials answers a denied client that accepts application/json
	// with a JSON body, {"error":"forbidden","status":403,"request_id":...},
	// instead of text. Every denial carries X-Request-Id either way.
	// Through Traefik, Envoy Gateway and Istio; HAProxy writes its own
	// denials. Applies to pods injected from then on.
	// +optional
	JSONDenials bool `json:"jsonDenials,omitempty"`

	// ClientIP configures which forwarding headers the engines trust for
	// the client's address, behind an HTTP load balancer that appends it to
	// X-Forwarded-For. Unset: only the proxy beside the engine is trusted.
	// A wrong setting lets clients choose their address: see
	// docs/client-ip.md. Applies to pods injected from then on (Envoy
	// Gateway rolls its pods itself).
	// +optional
	ClientIP *ClientIPSpec `json:"clientIP,omitempty"`
}

EngineSpec configures the engine sidecars.

func (*EngineSpec) DeepCopy

func (in *EngineSpec) DeepCopy() *EngineSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EngineSpec.

func (*EngineSpec) DeepCopyInto

func (in *EngineSpec) DeepCopyInto(out *EngineSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EventsSpec added in v0.5.0

type EventsSpec struct {
	// Redact keeps more of what rules matched out of the events.
	// +optional
	Redact RedactSpec `json:"redact,omitempty"`
}

EventsSpec configures the engines' security events.

func (*EventsSpec) DeepCopy added in v0.5.0

func (in *EventsSpec) DeepCopy() *EventsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventsSpec.

func (*EventsSpec) DeepCopyInto added in v0.5.0

func (in *EventsSpec) DeepCopyInto(out *EventsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Exclusion

type Exclusion struct {
	// RuleIDs are the rules to turn off. An ID no rule has is ignored.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=64
	// +kubebuilder:validation:items:Minimum=1
	RuleIDs []int32 `json:"ruleIDs"`

	// When narrows the exclusion. Unset: the rules are off for every request
	// this policy covers.
	// +optional
	When *ExclusionMatch `json:"when,omitempty"`
}

Exclusion turns rules off, everywhere or only for one path or argument.

func (*Exclusion) DeepCopy

func (in *Exclusion) DeepCopy() *Exclusion

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Exclusion.

func (*Exclusion) DeepCopyInto

func (in *Exclusion) DeepCopyInto(out *Exclusion)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExclusionMatch

type ExclusionMatch struct {
	// Path the exclusion applies to.
	// +optional
	Path PathPattern `json:"path,omitempty"`

	// Argument is a query or body argument the rules, and the rules chained
	// to them, stop looking at. With a rule set whose own SecLang negates
	// ARGS targets (!ARGS:name), the policy gets its own compiled rules, and
	// the exclusion covers the rule only, not its chained rules.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=256
	// +kubebuilder:validation:Pattern=`^[A-Za-z0-9_.\-\[\]]+$`
	// +optional
	Argument string `json:"argument,omitempty"`

	// ArgumentName is a query or body argument whose name (ARGS_NAMES) the
	// rules stop looking at. Requires engines 0.5.0 or later: older ones
	// ignore the exclusion.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=256
	// +kubebuilder:validation:Pattern=`^[A-Za-z0-9_.\-\[\]]+$`
	// +optional
	ArgumentName string `json:"argumentName,omitempty"`

	// Cookie is a request cookie (REQUEST_COOKIES) the rules stop looking
	// at, such as a session token. Requires engines 0.5.0 or later.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=256
	// +kubebuilder:validation:Pattern=`^[A-Za-z0-9_.\-\[\]]+$`
	// +optional
	Cookie string `json:"cookie,omitempty"`

	// Header is a request header (REQUEST_HEADERS) the rules stop looking
	// at, such as Referer, compared case-insensitively. Requires engines
	// 0.5.0 or later.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=256
	// +kubebuilder:validation:Pattern=`^[A-Za-z0-9_.\-\[\]]+$`
	// +optional
	Header string `json:"header,omitempty"`
}

ExclusionMatch narrows an exclusion to a path, to what in the request the rules stop looking at (an argument, an argument name, a cookie or a header), or both. +kubebuilder:validation:XValidation:rule="has(self.path) || has(self.argument) || has(self.argumentName) || has(self.cookie) || has(self.header)",message="when needs a path, or what in the request to stop looking at" +kubebuilder:validation:XValidation:rule="[has(self.argument), has(self.argumentName), has(self.cookie), has(self.header)].filter(x, x).size() <= 1",message="at most one of argument, argumentName, cookie and header"

func (*ExclusionMatch) DeepCopy

func (in *ExclusionMatch) DeepCopy() *ExclusionMatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExclusionMatch.

func (*ExclusionMatch) DeepCopyInto

func (in *ExclusionMatch) DeepCopyInto(out *ExclusionMatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ExclusionMatch) Target added in v0.5.0

func (m *ExclusionMatch) Target() bool

Target reports whether m narrows its exclusion to an argument name, a cookie or a header (m may be nil).

type FailureMode

type FailureMode string

FailureMode is what happens to a request that can't be inspected in time (timeout, error, overload). +kubebuilder:validation:Enum=Open;Closed

const (
	// FailOpen lets the request through uninspected.
	FailOpen FailureMode = "Open"
	// FailClosed rejects the request with 503.
	FailClosed FailureMode = "Closed"
)

type GRPCAction added in v0.5.0

type GRPCAction string

GRPCAction is whether a policy lets gRPC calls through. +kubebuilder:validation:Enum=Allow;Deny

const (
	// GRPCAllow inspects gRPC calls as gRPC (the default).
	GRPCAllow GRPCAction = "Allow"
	// GRPCDeny denies them: for routes that serve no gRPC.
	GRPCDeny GRPCAction = "Deny"
)

type GRPCMessagesAction added in v0.4.0

type GRPCMessagesAction string

GRPCMessagesAction is whether gRPC messages are inspected. +kubebuilder:validation:Enum=Inspect;Skip

const (
	// GRPCMessagesInspect inspects the text in gRPC calls' messages.
	GRPCMessagesInspect GRPCMessagesAction = "Inspect"
	// GRPCMessagesSkip inspects a gRPC call's path and metadata only.
	GRPCMessagesSkip GRPCMessagesAction = "Skip"
)

type GRPCStreamsMode added in v0.6.0

type GRPCStreamsMode string

GRPCStreamsMode is how a gRPC call's messages are read: the buffered body, or one by one as they come. +kubebuilder:validation:Enum=Buffer;PerMessage

const (
	// GRPCStreamsBuffer inspects the messages in the body the proxy
	// buffers, up to maxBytes in all (the default).
	GRPCStreamsBuffer GRPCStreamsMode = "Buffer"
	// GRPCStreamsPerMessage inspects each message as it comes, up to
	// maxBytes each, through Envoy (#315).
	GRPCStreamsPerMessage GRPCStreamsMode = "PerMessage"
)

type HTTPMethodToken added in v0.5.0

type HTTPMethodToken string

HTTPMethodToken is an HTTP request method, such as PUT. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=32 +kubebuilder:validation:Pattern=`^[!#$%&'*+.^_~0-9A-Za-z-]+$`

type HeaderName added in v0.4.0

type HeaderName string

HeaderName is an HTTP header name. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=256 +kubebuilder:validation:Pattern=`^[A-Za-z0-9!#$%&'*+.^_|~-]+$`

type IPListEntry added in v0.5.0

type IPListEntry struct {
	// CIDR is an IPv4 or IPv6 prefix (203.0.113.0/24, 2001:db8::/32) or
	// address.
	CIDR CIDR `json:"cidr"`

	// Description says what the entry is, for people.
	// +kubebuilder:validation:MaxLength=256
	// +optional
	Description string `json:"description,omitempty"`
}

IPListEntry is one address or CIDR prefix of a WAFIPList.

func (*IPListEntry) DeepCopy added in v0.5.0

func (in *IPListEntry) DeepCopy() *IPListEntry

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPListEntry.

func (*IPListEntry) DeepCopyInto added in v0.5.0

func (in *IPListEntry) DeepCopyInto(out *IPListEntry)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IPListName added in v0.5.0

type IPListName string

IPListName names a WAFIPList. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=253

type IPListsSpec added in v0.5.0

type IPListsSpec struct {
	// Allow lists clients whose requests aren't inspected: health checkers,
	// a scanner you run yourself. Their requests are not logged either.
	// +kubebuilder:validation:MaxItems=16
	// +listType=set
	// +optional
	Allow []IPListName `json:"allow,omitempty"`

	// Deny lists clients whose requests are denied (403) before any rule,
	// or logged in Detect mode.
	// +kubebuilder:validation:MaxItems=16
	// +listType=set
	// +optional
	Deny []IPListName `json:"deny,omitempty"`
}

IPListsSpec names a policy's IP lists.

func (*IPListsSpec) DeepCopy added in v0.5.0

func (in *IPListsSpec) DeepCopy() *IPListsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPListsSpec.

func (*IPListsSpec) DeepCopyInto added in v0.5.0

func (in *IPListsSpec) DeepCopyInto(out *IPListsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InkwallConfig

type InkwallConfig struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// +optional
	Spec InkwallConfigSpec `json:"spec,omitempty"`
	// +optional
	Status InkwallConfigStatus `json:"status,omitempty"`
}

InkwallConfig is the cluster-wide Inkwall configuration. There is one, named default.

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster,categories=inkwall +kubebuilder:validation:XValidation:rule="self.metadata.name == 'default'",message="the InkwallConfig must be named default" +kubebuilder:printcolumn:name="Mode",type=string,JSONPath=`.spec.mode` +kubebuilder:printcolumn:name="Suspended",type=boolean,JSONPath=`.spec.suspend` +kubebuilder:printcolumn:name="Bundle",type=integer,JSONPath=`.status.bundle.version` +kubebuilder:printcolumn:name="Engines",type=integer,JSONPath=`.status.engines.connected` +kubebuilder:printcolumn:name="Current",type=integer,JSONPath=`.status.engines.current` +kubebuilder:printcolumn:name="Key",type=string,JSONPath=`.status.signingKey.phase` +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*InkwallConfig) DeepCopy

func (in *InkwallConfig) DeepCopy() *InkwallConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InkwallConfig.

func (*InkwallConfig) DeepCopyInto

func (in *InkwallConfig) DeepCopyInto(out *InkwallConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*InkwallConfig) DeepCopyObject

func (in *InkwallConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InkwallConfigList

type InkwallConfigList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []InkwallConfig `json:"items"`
}

InkwallConfigList is a list of InkwallConfig.

+kubebuilder:object:root=true

func (*InkwallConfigList) DeepCopy

func (in *InkwallConfigList) DeepCopy() *InkwallConfigList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InkwallConfigList.

func (*InkwallConfigList) DeepCopyInto

func (in *InkwallConfigList) DeepCopyInto(out *InkwallConfigList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*InkwallConfigList) DeepCopyObject

func (in *InkwallConfigList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InkwallConfigSpec

type InkwallConfigSpec struct {
	// Mode is where policy comes from: Standalone (the CRDs), GitOps (the
	// CRDs, mirrored to the control plane) or Managed (the control plane).
	// +kubebuilder:default=Standalone
	// +optional
	Mode ClusterMode `json:"mode,omitempty"`

	// ControlPlane is the control plane to connect to. Required in GitOps
	// and Managed mode, ignored in Standalone.
	// +optional
	ControlPlane *ControlPlane `json:"controlPlane,omitempty"`

	// Engine configures the engine sidecars the operator injects.
	// +optional
	Engine EngineSpec `json:"engine,omitempty"`

	// Integrations pins how a proxy controller is wired. Controllers are
	// discovered without an entry here; an entry overrides the workload
	// selector or the adapter for one controller.
	// +listType=map
	// +listMapKey=controller
	// +kubebuilder:validation:MaxItems=32
	// +optional
	Integrations []IntegrationSpec `json:"integrations,omitempty"`

	// Suspend switches every engine to allow-all within seconds, without
	// removing anything: the emergency switch (0004 §5).
	// +optional
	Suspend bool `json:"suspend,omitempty"`

	// SigningKey configures the key the operator signs policy bundles with.
	// +optional
	SigningKey SigningKeySpec `json:"signingKey,omitempty"`

	// Events configures what the engines' security events carry to the
	// operator (and on to the control plane, when one is connected).
	// +optional
	Events EventsSpec `json:"events,omitempty"`
}

InkwallConfigSpec is the cluster-wide configuration. +kubebuilder:validation:XValidation:rule="!has(self.mode) || self.mode == 'Standalone' || has(self.controlPlane)",message="controlPlane is required in GitOps and Managed mode"

func (*InkwallConfigSpec) DeepCopy

func (in *InkwallConfigSpec) DeepCopy() *InkwallConfigSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InkwallConfigSpec.

func (*InkwallConfigSpec) DeepCopyInto

func (in *InkwallConfigSpec) DeepCopyInto(out *InkwallConfigSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InkwallConfigStatus

type InkwallConfigStatus struct {
	// ObservedGeneration is the generation the status describes.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions describe the configuration's state.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Proxies are the proxy controllers the cluster's IngressClasses and
	// GatewayClasses name, and how far Inkwall wires each.
	// +listType=map
	// +listMapKey=controllerName
	// +optional
	Proxies []ProxyStatus `json:"proxies,omitempty"`

	// Bundle is the bundle the engines get.
	// +optional
	Bundle *BundleStatus `json:"bundle,omitempty"`

	// Engines counts the connected engines by the bundle they run.
	// +optional
	Engines *EngineCounts `json:"engines,omitempty"`

	// SigningKey is the bundle signing key and its rotation.
	// +optional
	SigningKey *SigningKeyStatus `json:"signingKey,omitempty"`
}

InkwallConfigStatus is the cluster view.

func (*InkwallConfigStatus) DeepCopy

func (in *InkwallConfigStatus) DeepCopy() *InkwallConfigStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InkwallConfigStatus.

func (*InkwallConfigStatus) DeepCopyInto

func (in *InkwallConfigStatus) DeepCopyInto(out *InkwallConfigStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IntegrationSpec

type IntegrationSpec struct {
	// Controller is the integration name, such as traefik or ingress-nginx.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	Controller string `json:"controller"`

	// Selector matches the controller's proxy pods, when they don't carry
	// the controller's default labels. It must select by something (an
	// empty selector would match every pod). The operator restarts to
	// apply a change; pods already running are injected when they restart.
	// +kubebuilder:validation:XValidation:rule="(has(self.matchLabels) && size(self.matchLabels) > 0) || (has(self.matchExpressions) && size(self.matchExpressions) > 0)",message="selector must not be empty: it would select every pod"
	// +optional
	Selector *metav1.LabelSelector `json:"selector,omitempty"`

	// Adapter is how the proxy hands requests to the engine, when the
	// controller supports several.
	// +optional
	Adapter AdapterKind `json:"adapter,omitempty"`
}

IntegrationSpec overrides discovery for one proxy controller.

func (*IntegrationSpec) DeepCopy

func (in *IntegrationSpec) DeepCopy() *IntegrationSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationSpec.

func (*IntegrationSpec) DeepCopyInto

func (in *IntegrationSpec) DeepCopyInto(out *IntegrationSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogLevel added in v0.5.0

type LogLevel string

LogLevel is an engine's log level. +kubebuilder:validation:Enum=Debug;Info;Warn;Error

const (
	LogLevelDebug LogLevel = "Debug"
	LogLevelInfo  LogLevel = "Info"
	LogLevelWarn  LogLevel = "Warn"
	LogLevelError LogLevel = "Error"
)

Engine log levels.

type MediaType added in v0.5.0

type MediaType string

MediaType is a media type without parameters, such as application/json. +kubebuilder:validation:MinLength=3 +kubebuilder:validation:MaxLength=129 +kubebuilder:validation:Pattern=`^[!#$%&'*+.^_~0-9A-Za-z-]+/[!#$%&'*+.^_~0-9A-Za-z-]+$`

type NamespacedConfigMapKeyRef

type NamespacedConfigMapKeyRef struct {
	ConfigMapKeyRef `json:",inline"`

	// Namespace of the ConfigMap.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	Namespace string `json:"namespace"`
}

NamespacedConfigMapKeyRef names a key of a ConfigMap in any namespace.

func (*NamespacedConfigMapKeyRef) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedConfigMapKeyRef.

func (*NamespacedConfigMapKeyRef) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OversizeAction

type OversizeAction string

OversizeAction is what happens to a body larger than body.maxBytes. +kubebuilder:validation:Enum=Allow;Deny

const (
	// OversizeAllow forwards the request with the body uninspected, and logs
	// it.
	OversizeAllow OversizeAction = "Allow"
	// OversizeDeny rejects the request with 413 in Block mode.
	OversizeDeny OversizeAction = "Deny"
)

type PathPattern

type PathPattern string

PathPattern is an exact path ("/healthz") or a prefix ending in "*" ("/static/*"), using only plain ASCII path characters, as the engine matches paths (pkg/router). +kubebuilder:validation:MaxLength=1024 +kubebuilder:validation:Pattern=`^/[A-Za-z0-9._~/:@!$&'()+,=-]*\*?$`

type PolicyMode

type PolicyMode string

PolicyMode is what the engine does with a request the rules flag. +kubebuilder:validation:Enum=Detect;Block

const (
	// PolicyDetect logs the verdict and lets the request through.
	PolicyDetect PolicyMode = "Detect"
	// PolicyBlock rejects the request.
	PolicyBlock PolicyMode = "Block"
)

type ProxyStatus added in v0.3.0

type ProxyStatus struct {
	// ControllerName is the controller its classes name: an IngressClass's
	// spec.controller, a GatewayClass's spec.controllerName.
	// +kubebuilder:validation:MaxLength=253
	ControllerName string `json:"controllerName"`

	// Integration is Inkwall's integration for the controller, such as
	// traefik; empty when Inkwall has none.
	// +kubebuilder:validation:MaxLength=63
	// +optional
	Integration string `json:"integration,omitempty"`

	// IngressClasses are the IngressClasses of the controller.
	// +optional
	IngressClasses []string `json:"ingressClasses,omitempty"`

	// GatewayClasses are the GatewayClasses of the controller.
	// +optional
	GatewayClasses []string `json:"gatewayClasses,omitempty"`

	// Support is Full, Partial or Unsupported.
	Support Support `json:"support"`

	// Message says what isn't wired.
	// +kubebuilder:validation:MaxLength=1024
	// +optional
	Message string `json:"message,omitempty"`
}

ProxyStatus is a proxy controller found in the cluster.

func (*ProxyStatus) DeepCopy added in v0.3.0

func (in *ProxyStatus) DeepCopy() *ProxyStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyStatus.

func (*ProxyStatus) DeepCopyInto added in v0.3.0

func (in *ProxyStatus) DeepCopyInto(out *ProxyStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RedactSpec added in v0.5.0

type RedactSpec struct {
	// Headers are more header names whose values leave no snippet, matched
	// without regard to case.
	// +kubebuilder:validation:MaxItems=64
	// +listType=set
	// +optional
	Headers []HeaderName `json:"headers,omitempty"`

	// Arguments are more argument-name patterns: a match on a query or
	// body argument whose name contains one, without regard to case, leaves
	// no snippet ("email" covers email, user_email and json.user.Email).
	// +kubebuilder:validation:MaxItems=64
	// +listType=set
	// +optional
	Arguments []ArgumentPattern `json:"arguments,omitempty"`

	// Snippets set to false sends no snippets at all: events keep the rule
	// and the variable it matched, never what it matched.
	// +kubebuilder:default=true
	// +optional
	Snippets *bool `json:"snippets,omitempty"`
}

RedactSpec adds to the redaction every engine applies to the snippets of its security events: the up to 64 bytes of what each rule matched. Always redacted: cookies, response bodies, the Authorization, Cookie, Set-Cookie and Proxy-Authorization headers, and arguments and headers whose names look like credentials (password, secret, token, api key, auth, session, JWT, card, SSN; see docs/design/0002 §8.3).

func (*RedactSpec) DeepCopy added in v0.5.0

func (in *RedactSpec) DeepCopy() *RedactSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedactSpec.

func (*RedactSpec) DeepCopyInto added in v0.5.0

func (in *RedactSpec) DeepCopyInto(out *RedactSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResponsesSpec added in v0.4.0

type ResponsesSpec struct {
	// Inspect turns response inspection on: the status and headers, and
	// the body when its media type is text (plain, HTML, XML, CSV),
	// JavaScript, JSON or XML (a +json or +xml type too), malformed, or
	// missing. A request's Range is removed, so the body comes whole.
	// In Block mode a response the rules flag is replaced with the
	// rule's status (403) and a plain-text error.
	// +optional
	Inspect bool `json:"inspect,omitempty"`

	// MaxBytes is how much of a response body is inspected, at most 10
	// MiB. Unset: 64 KiB (each KiB costs about 0.3 ms of inspection: raise
	// timeout with it). A longer body has this much inspected, and then
	// gets onOversize.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=10485760
	// +optional
	MaxBytes *int64 `json:"maxBytes,omitempty"`

	// OnOversize is what happens to a response whose body is over maxBytes
	// or can't be inspected (an encoding other than gzip or deflate): Deny
	// (replaced with 502 in Block mode) or Allow (forwarded, and logged).
	// Unset: Deny in Block mode, Allow in Detect mode.
	// +optional
	OnOversize OversizeAction `json:"onOversize,omitempty"`

	// Streams is what happens to the body of a streamed response: Server-
	// Sent Events (text/event-stream) and gRPC responses. Inspect: each
	// event, or message, is inspected on its own, up to maxBytes; in Block
	// mode one that leaks ends the stream (the client gets the events
	// before it), and one over maxBytes gets onOversize. Each event is an
	// evaluation, so a token-by-token stream costs many. Skip: only their
	// status and headers are inspected. Through Envoy Gateway and Istio;
	// HAProxy doesn't send their bodies (the policy is then not Programmed
	// on its Ingresses, ResponsesNotInspected), and engines before 0.6.0
	// skip them (the policy is then not Enforced).
	// Unset: Skip.
	// +optional
	Streams StreamsAction `json:"streams,omitempty"`
}

ResponsesSpec configures response inspection. +kubebuilder:validation:XValidation:rule="(has(self.inspect) && self.inspect) || (!has(self.maxBytes) && !has(self.onOversize) && !has(self.streams))",message="maxBytes, onOversize and streams need inspect: true"

func (*ResponsesSpec) DeepCopy added in v0.4.0

func (in *ResponsesSpec) DeepCopy() *ResponsesSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResponsesSpec.

func (*ResponsesSpec) DeepCopyInto added in v0.4.0

func (in *ResponsesSpec) DeepCopyInto(out *ResponsesSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RolloutPolicy added in v0.5.0

type RolloutPolicy string

RolloutPolicy is how proxy pods get a new engine. +kubebuilder:validation:Enum=Manual;Automatic

const (
	RolloutManual    RolloutPolicy = "Manual"
	RolloutAutomatic RolloutPolicy = "Automatic"
)

The rollout policies.

type RuleSetBinding

type RuleSetBinding struct {
	// Ref is the rule set.
	Ref RuleSetRef `json:"ref"`

	// ParanoiaLevel is the OWASP CRS paranoia level, 1 to 4. Only used by
	// the built-in CRS.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=4
	// +optional
	ParanoiaLevel *int32 `json:"paranoiaLevel,omitempty"`

	// InboundAnomalyThreshold is the OWASP CRS anomaly score at which a
	// request is flagged. Only used by the built-in CRS.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=10000
	// +optional
	InboundAnomalyThreshold *int32 `json:"inboundAnomalyThreshold,omitempty"`

	// CRS sets the OWASP CRS's own settings. Only used by the built-in CRS.
	// Requires engines 0.5.0 or later: older ones ignore it.
	// +optional
	CRS *CRSSettings `json:"crs,omitempty"`

	// Placement is where a SecLang rule set loads: AfterCRS (the default)
	// or BeforeCRS, before the CRS's initialization, so its rules can set
	// the CRS's tx variables or turn CRS rules off with
	// ctl:ruleRemoveById. A BeforeCRS rule set can't use SecRuleRemoveBy*
	// or SecRuleUpdate*, which only reach rules loaded before them. Not
	// for the built-in CRS. Requires engines 0.6.0 or later: older ones
	// load the rule set after the CRS.
	// +optional
	Placement RuleSetPlacement `json:"placement,omitempty"`
}

RuleSetBinding uses a rule set in a policy.

func (*RuleSetBinding) DeepCopy

func (in *RuleSetBinding) DeepCopy() *RuleSetBinding

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleSetBinding.

func (*RuleSetBinding) DeepCopyInto

func (in *RuleSetBinding) DeepCopyInto(out *RuleSetBinding)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuleSetPlacement added in v0.6.0

type RuleSetPlacement string

RuleSetPlacement is where a rule set loads, relative to the built-in CRS. +kubebuilder:validation:Enum=BeforeCRS;AfterCRS

const (
	// PlacementAfterCRS loads the rule set after the CRS (the default).
	PlacementAfterCRS RuleSetPlacement = "AfterCRS"
	// PlacementBeforeCRS loads the rule set before the CRS.
	PlacementBeforeCRS RuleSetPlacement = "BeforeCRS"
)

type RuleSetRef

type RuleSetRef struct {
	// Kind is WAFRuleSet or ClusterWAFRuleSet.
	// +kubebuilder:validation:Enum=WAFRuleSet;ClusterWAFRuleSet
	Kind string `json:"kind"`

	// Name of the rule set.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	Name string `json:"name"`

	// Namespace of a WAFRuleSet. Unset: the policy's namespace.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +optional
	Namespace string `json:"namespace,omitempty"`
}

RuleSetRef names a WAFRuleSet or a ClusterWAFRuleSet. +kubebuilder:validation:XValidation:rule="self.kind == 'WAFRuleSet' || !has(self.__namespace__)",message="namespace is only allowed for a WAFRuleSet"

func (*RuleSetRef) DeepCopy

func (in *RuleSetRef) DeepCopy() *RuleSetRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleSetRef.

func (*RuleSetRef) DeepCopyInto

func (in *RuleSetRef) DeepCopyInto(out *RuleSetRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuleSetSource

type RuleSetSource struct {
	// Builtin is a rule set shipped in the engine image.
	// +optional
	Builtin BuiltinRuleSet `json:"builtin,omitempty"`

	// SecLang holds the rules inline, at most 256 KiB.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=262144
	// +optional
	SecLang string `json:"seclang,omitempty"`

	// ConfigMapRef reads the rules from a ConfigMap in the rule set's
	// namespace.
	// +optional
	ConfigMapRef *ConfigMapKeyRef `json:"configMapRef,omitempty"`
}

RuleSetSource is where a WAFRuleSet's rules come from: exactly one of builtin, seclang or configMapRef. +kubebuilder:validation:XValidation:rule="[has(self.builtin), has(self.seclang), has(self.configMapRef)].filter(x, x).size() == 1",message="set exactly one of builtin, seclang or configMapRef"

func (*RuleSetSource) DeepCopy

func (in *RuleSetSource) DeepCopy() *RuleSetSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleSetSource.

func (*RuleSetSource) DeepCopyInto

func (in *RuleSetSource) DeepCopyInto(out *RuleSetSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuleSetStatus

type RuleSetStatus struct {
	// ObservedGeneration is the generation the status describes.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions describe the rule set's state.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

RuleSetStatus reports whether a rule set is usable.

func (*RuleSetStatus) DeepCopy

func (in *RuleSetStatus) DeepCopy() *RuleSetStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleSetStatus.

func (*RuleSetStatus) DeepCopyInto

func (in *RuleSetStatus) DeepCopyInto(out *RuleSetStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretReference

type SecretReference struct {
	// Name of the Secret.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	Name string `json:"name"`

	// Namespace of the Secret.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	Namespace string `json:"namespace"`
}

SecretReference names a Secret in a given namespace.

func (*SecretReference) DeepCopy

func (in *SecretReference) DeepCopy() *SecretReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretReference.

func (*SecretReference) DeepCopyInto

func (in *SecretReference) DeepCopyInto(out *SecretReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SigningKeyPhase added in v0.5.0

type SigningKeyPhase string

SigningKeyPhase is where a signing key rotation is. +kubebuilder:validation:Enum=Idle;Publishing;Retiring

const (
	// SigningKeyIdle: one key, which signs.
	SigningKeyIdle SigningKeyPhase = "Idle"
	// SigningKeyPublishing: the next key is published to the engines; the
	// active one still signs.
	SigningKeyPublishing SigningKeyPhase = "Publishing"
	// SigningKeyRetiring: the new key signs; the previous one stays trusted
	// until every engine runs a bundle the new one signed.
	SigningKeyRetiring SigningKeyPhase = "Retiring"
)

The phases of a signing key rotation.

type SigningKeySpec added in v0.1.1

type SigningKeySpec struct {
	// RotationInterval rotates the signing key once it has signed for this
	// long, e.g. 2160h (90 days); at least 1h. Empty: the key rotates only
	// when requested with the waf.inkwall.dev/rotate-signing-key
	// annotation.
	// +kubebuilder:validation:XValidation:rule="duration(self) >= duration('1h')",message="rotationInterval must be at least 1h"
	// +optional
	RotationInterval *metav1.Duration `json:"rotationInterval,omitempty"`
}

SigningKeySpec configures the bundle signing key.

func (*SigningKeySpec) DeepCopy added in v0.1.1

func (in *SigningKeySpec) DeepCopy() *SigningKeySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SigningKeySpec.

func (*SigningKeySpec) DeepCopyInto added in v0.1.1

func (in *SigningKeySpec) DeepCopyInto(out *SigningKeySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SigningKeyStatus added in v0.5.0

type SigningKeyStatus struct {
	// ActiveKeyID is the ID of the key that signs bundles.
	// +kubebuilder:validation:MaxLength=128
	ActiveKeyID string `json:"activeKeyID"`

	// Phase of the rotation.
	Phase SigningKeyPhase `json:"phase"`

	// Since is when the phase began (Publishing, Retiring), or when the
	// active key began to sign (Idle).
	// +optional
	Since *metav1.Time `json:"since,omitempty"`

	// WaitingFor says what the rotation waits for; empty when it waits for
	// nothing.
	// +kubebuilder:validation:MaxLength=1024
	// +optional
	WaitingFor string `json:"waitingFor,omitempty"`
}

SigningKeyStatus describes the bundle signing key.

func (*SigningKeyStatus) DeepCopy added in v0.5.0

func (in *SigningKeyStatus) DeepCopy() *SigningKeyStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SigningKeyStatus.

func (*SigningKeyStatus) DeepCopyInto added in v0.5.0

func (in *SigningKeyStatus) DeepCopyInto(out *SigningKeyStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SkipSpec

type SkipSpec struct {
	// Paths that are never inspected.
	// +kubebuilder:validation:MaxItems=64
	// +optional
	Paths []PathPattern `json:"paths,omitempty"`

	// BodyPaths are paths whose body is not inspected; their headers and URI
	// still are.
	// +kubebuilder:validation:MaxItems=64
	// +optional
	BodyPaths []PathPattern `json:"bodyPaths,omitempty"`
}

SkipSpec lists requests that are never inspected.

func (*SkipSpec) DeepCopy

func (in *SkipSpec) DeepCopy() *SkipSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SkipSpec.

func (*SkipSpec) DeepCopyInto

func (in *SkipSpec) DeepCopyInto(out *SkipSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StreamsAction added in v0.6.0

type StreamsAction string

StreamsAction is whether streamed responses are inspected event by event. +kubebuilder:validation:Enum=Inspect;Skip

const (
	// StreamsInspect inspects each event of a Server-Sent Events stream
	// and each message of a gRPC response on its own.
	StreamsInspect StreamsAction = "Inspect"
	// StreamsSkip inspects a stream's status and headers only.
	StreamsSkip StreamsAction = "Skip"
)

type Support added in v0.3.0

type Support string

Support is how far Inkwall wires a proxy controller's routes (0004 §4.1). +kubebuilder:validation:Enum=Full;Partial;Unsupported

const (
	// SupportFull: Inkwall wires the routes of every class of the
	// controller.
	SupportFull Support = "Full"
	// SupportPartial: it wires those of some of its classes; the message
	// says which aren't.
	SupportPartial Support = "Partial"
	// SupportUnsupported: it wires none; a policy on one of its routes is
	// not Programmed (ControllerUnsupported).
	SupportUnsupported Support = "Unsupported"
)

The support levels.

type TargetRef

type TargetRef struct {
	// Group of the target: networking.k8s.io (the default, for Ingress),
	// gateway.networking.k8s.io (for HTTPRoute), traefik.io (for Traefik's
	// IngressRoute) or networking.istio.io (for Istio's VirtualService).
	// +kubebuilder:validation:MaxLength=253
	// +optional
	Group string `json:"group,omitempty"`

	// Kind of the target: Ingress, HTTPRoute, IngressRoute or
	// VirtualService. An
	// IngressRoute's hosts and paths come from its routes' match rules,
	// which may combine Host, Path and PathPrefix with &&; a rule with
	// anything else (||, !, other matchers) is not accepted. An HTTPRoute's routes
	// are each of its hostnames (none: any host) with each of its rules'
	// matches, which may have an Exact or PathPrefix path and a method; a
	// match with a RegularExpression path, headers or queryParams is not
	// accepted. A VirtualService's routes are each of its hosts ("*": any
	// host) with each of its http routes' matches, which may have an exact
	// or prefix uri and an exact method; a match with anything else (a regex
	// uri, headers, query parameters, ...), a delegate, or a short host name
	// is not accepted. Whether a proxy wires HTTPRoute targets depends
	// on its integration; VirtualService targets are wired through Istio's
	// ingress gateways.
	// +kubebuilder:validation:Enum=Ingress;HTTPRoute;IngressRoute;VirtualService
	Kind string `json:"kind"`

	// Name of the target.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	Name string `json:"name"`

	// SectionName narrows an HTTPRoute target to the rule of that name:
	// only its matches are protected, and it takes precedence over a policy
	// on the whole HTTPRoute. A name no rule has is a missing target.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +optional
	SectionName string `json:"sectionName,omitempty"`
}

TargetRef names a route in the policy's namespace. +kubebuilder:validation:XValidation:rule="(self.kind == 'Ingress' && (!has(self.group) || self.group == 'networking.k8s.io')) || (self.kind == 'HTTPRoute' && has(self.group) && self.group == 'gateway.networking.k8s.io') || (self.kind == 'IngressRoute' && has(self.group) && self.group == 'traefik.io') || (self.kind == 'VirtualService' && has(self.group) && self.group == 'networking.istio.io')",message="target must be a networking.k8s.io Ingress, a gateway.networking.k8s.io HTTPRoute, a traefik.io IngressRoute or a networking.istio.io VirtualService" +kubebuilder:validation:XValidation:rule="!has(self.sectionName) || self.kind == 'HTTPRoute'",message="sectionName is only allowed for an HTTPRoute"

func (*TargetRef) DeepCopy

func (in *TargetRef) DeepCopy() *TargetRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetRef.

func (*TargetRef) DeepCopyInto

func (in *TargetRef) DeepCopyInto(out *TargetRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WAFIPList added in v0.5.0

type WAFIPList struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec WAFIPListSpec `json:"spec"`
}

WAFIPList is a list of client addresses that WAFPolicies in its namespace allow or deny (spec.ipLists). The client address is the one the engine resolves: see docs/client-ip.md.

+kubebuilder:object:root=true +kubebuilder:resource:categories=inkwall,shortName=wafip +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*WAFIPList) DeepCopy added in v0.5.0

func (in *WAFIPList) DeepCopy() *WAFIPList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WAFIPList.

func (*WAFIPList) DeepCopyInto added in v0.5.0

func (in *WAFIPList) DeepCopyInto(out *WAFIPList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WAFIPList) DeepCopyObject added in v0.5.0

func (in *WAFIPList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type WAFIPListList added in v0.5.0

type WAFIPListList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []WAFIPList `json:"items"`
}

WAFIPListList is a list of WAFIPList.

+kubebuilder:object:root=true

func (*WAFIPListList) DeepCopy added in v0.5.0

func (in *WAFIPListList) DeepCopy() *WAFIPListList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WAFIPListList.

func (*WAFIPListList) DeepCopyInto added in v0.5.0

func (in *WAFIPListList) DeepCopyInto(out *WAFIPListList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WAFIPListList) DeepCopyObject added in v0.5.0

func (in *WAFIPListList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type WAFIPListSpec added in v0.5.0

type WAFIPListSpec struct {
	// Entries are the list's addresses and prefixes.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=10000
	Entries []IPListEntry `json:"entries"`
}

WAFIPListSpec is a list of client addresses.

func (*WAFIPListSpec) DeepCopy added in v0.5.0

func (in *WAFIPListSpec) DeepCopy() *WAFIPListSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WAFIPListSpec.

func (*WAFIPListSpec) DeepCopyInto added in v0.5.0

func (in *WAFIPListSpec) DeepCopyInto(out *WAFIPListSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WAFPolicy

type WAFPolicy struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec WAFPolicySpec `json:"spec"`
	// +optional
	Status WAFPolicyStatus `json:"status,omitempty"`
}

WAFPolicy protects routes: which rules run, in which mode, and what happens when inspection fails.

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:categories=inkwall,shortName=wafp +kubebuilder:printcolumn:name="Mode",type=string,JSONPath=`.spec.mode` +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` +kubebuilder:printcolumn:name="Reason",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].reason` +kubebuilder:printcolumn:name="Bundle",type=integer,JSONPath=`.status.bundleVersion` +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*WAFPolicy) DeepCopy

func (in *WAFPolicy) DeepCopy() *WAFPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WAFPolicy.

func (*WAFPolicy) DeepCopyInto

func (in *WAFPolicy) DeepCopyInto(out *WAFPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WAFPolicy) DeepCopyObject

func (in *WAFPolicy) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type WAFPolicyList

type WAFPolicyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []WAFPolicy `json:"items"`
}

WAFPolicyList is a list of WAFPolicy.

+kubebuilder:object:root=true

func (*WAFPolicyList) DeepCopy

func (in *WAFPolicyList) DeepCopy() *WAFPolicyList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WAFPolicyList.

func (*WAFPolicyList) DeepCopyInto

func (in *WAFPolicyList) DeepCopyInto(out *WAFPolicyList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WAFPolicyList) DeepCopyObject

func (in *WAFPolicyList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type WAFPolicySpec

type WAFPolicySpec struct {
	// TargetRefs are the routes this policy protects, in the policy's
	// namespace.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=16
	// +kubebuilder:validation:XValidation:rule="self.all(a, self.exists_one(b, b.kind == a.kind && b.name == a.name && (has(b.sectionName) ? b.sectionName : ”) == (has(a.sectionName) ? a.sectionName : ”)))",message="targetRefs must not repeat a target"
	TargetRefs []TargetRef `json:"targetRefs"`

	// Mode is Detect (log, let through) or Block (reject).
	// +kubebuilder:default=Detect
	// +optional
	Mode PolicyMode `json:"mode,omitempty"`

	// FailureMode is what happens to a request that can't be inspected in
	// time. Unset: Closed in Block mode, Open in Detect mode.
	// +optional
	FailureMode FailureMode `json:"failureMode,omitempty"`

	// Timeout is the inspection deadline per request, at most 1s. Unset:
	// the engine's default (250ms).
	// +kubebuilder:validation:XValidation:rule="duration(self) > duration('0s') && duration(self) <= duration('1s')",message="timeout must be more than 0s and at most 1s"
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`

	// Skip lists requests that are never inspected.
	// +optional
	Skip *SkipSpec `json:"skip,omitempty"`

	// RuleSets are the rules to run, in order. Empty: the built-in OWASP CRS
	// with its default paranoia level and threshold.
	// +kubebuilder:validation:MaxItems=8
	// +optional
	RuleSets []RuleSetBinding `json:"ruleSets,omitempty"`

	// Exclusions turn rules off where they cause false positives.
	// +kubebuilder:validation:MaxItems=128
	// +optional
	Exclusions []Exclusion `json:"exclusions,omitempty"`

	// Body configures request body inspection.
	// +optional
	Body *BodySpec `json:"body,omitempty"`

	// WebSocket is what a WebSocket handshake on the policy's routes must
	// meet, on top of the rules: the origins it may come from, the headers
	// it must have. A handshake that doesn't is denied with 403 in Block
	// mode (logged in Detect mode), and isn't upgraded. Other requests
	// aren't affected. The handshake's URL and headers are inspected by
	// the rules whether this is set or not; the messages after it are not
	// inspected (docs/websocket.md). Engines before 0.4.0 ignore it: the
	// policy isn't Enforced while one is connected.
	// +optional
	WebSocket *WebSocketSpec `json:"webSocket,omitempty"`

	// Responses configures response inspection, for data leaks (the CRS's
	// RESPONSE-95x rules, and the rule sets' rules on RESPONSE_*
	// variables). Unset: responses are not inspected. Envoy Gateway,
	// Istio and the HAProxy Kubernetes Ingress Controller (once its pods
	// run an engine of 0.6.0 or later) send responses to the engine; on a
	// route of Traefik (its ForwardAuth can't), or of HAProxy before then,
	// the policy is not Programmed (ResponsesNotInspected).
	// +optional
	Responses *ResponsesSpec `json:"responses,omitempty"`

	// IPLists names WAFIPLists in the policy's namespace whose client
	// addresses are denied, or let through uninspected. A deny list wins
	// over an allow list. They are only as good as the client IP the
	// engine resolves (docs/client-ip.md). Requires engines 0.5.0 or
	// later.
	// +optional
	IPLists *IPListsSpec `json:"ipLists,omitempty"`
}

WAFPolicySpec is what to enforce on which routes.

func (*WAFPolicySpec) DeepCopy

func (in *WAFPolicySpec) DeepCopy() *WAFPolicySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WAFPolicySpec.

func (*WAFPolicySpec) DeepCopyInto

func (in *WAFPolicySpec) DeepCopyInto(out *WAFPolicySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WAFPolicyStatus

type WAFPolicyStatus struct {
	// ObservedGeneration is the generation the status describes.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// BundleVersion is the first bundle that enforces this generation as it
	// is now: later bundles do too, until one changes the policy (its
	// spec, routes or rule sets) or suspends the cluster. Bundles that
	// change only other policies leave it.
	// +optional
	BundleVersion int64 `json:"bundleVersion,omitempty"`

	// Conditions are Accepted, Programmed, Enforced and Ready.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

WAFPolicyStatus reports how far the policy got: accepted, programmed into the proxy, enforced by every engine (0004 §3.2).

func (*WAFPolicyStatus) DeepCopy

func (in *WAFPolicyStatus) DeepCopy() *WAFPolicyStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WAFPolicyStatus.

func (*WAFPolicyStatus) DeepCopyInto

func (in *WAFPolicyStatus) DeepCopyInto(out *WAFPolicyStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WAFRuleSet

type WAFRuleSet struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec WAFRuleSetSpec `json:"spec"`
	// +optional
	Status RuleSetStatus `json:"status,omitempty"`
}

WAFRuleSet is a set of rules that policies in its namespace can use.

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:categories=inkwall,shortName=wafrs +kubebuilder:printcolumn:name="Builtin",type=string,JSONPath=`.spec.source.builtin` +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*WAFRuleSet) DeepCopy

func (in *WAFRuleSet) DeepCopy() *WAFRuleSet

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WAFRuleSet.

func (*WAFRuleSet) DeepCopyInto

func (in *WAFRuleSet) DeepCopyInto(out *WAFRuleSet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WAFRuleSet) DeepCopyObject

func (in *WAFRuleSet) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type WAFRuleSetList

type WAFRuleSetList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []WAFRuleSet `json:"items"`
}

WAFRuleSetList is a list of WAFRuleSet.

+kubebuilder:object:root=true

func (*WAFRuleSetList) DeepCopy

func (in *WAFRuleSetList) DeepCopy() *WAFRuleSetList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WAFRuleSetList.

func (*WAFRuleSetList) DeepCopyInto

func (in *WAFRuleSetList) DeepCopyInto(out *WAFRuleSetList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WAFRuleSetList) DeepCopyObject

func (in *WAFRuleSetList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type WAFRuleSetSpec

type WAFRuleSetSpec struct {
	// Source of the rules.
	Source RuleSetSource `json:"source"`
}

WAFRuleSetSpec defines a namespaced rule set.

func (*WAFRuleSetSpec) DeepCopy

func (in *WAFRuleSetSpec) DeepCopy() *WAFRuleSetSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WAFRuleSetSpec.

func (*WAFRuleSetSpec) DeepCopyInto

func (in *WAFRuleSetSpec) DeepCopyInto(out *WAFRuleSetSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WebSocketOrigin added in v0.4.0

type WebSocketOrigin string

WebSocketOrigin is an origin, "scheme://host[:port]", lower case; the host may start with "*." to match subdomains. +kubebuilder:validation:MaxLength=270 +kubebuilder:validation:Pattern=`^https?://(\*\.)?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*(:[0-9]{1,5})?$`

type WebSocketSpec added in v0.4.0

type WebSocketSpec struct {
	// AllowedOrigins are the origins a handshake may come from, against
	// cross-site WebSocket hijacking: a page on another site can open a
	// WebSocket to the application with the user's cookies, and only the
	// Origin header tells. Each is "scheme://host" or "scheme://host:port",
	// lower case, with scheme http or https; a host "*.example.com"
	// matches any subdomain of example.com, not example.com itself. A
	// handshake without Origin is denied unless allowMissingOrigin is set.
	// Empty: any origin.
	// +kubebuilder:validation:MaxItems=64
	// +listType=set
	// +optional
	AllowedOrigins []WebSocketOrigin `json:"allowedOrigins,omitempty"`

	// AllowMissingOrigin lets a handshake without an Origin header pass
	// the origin check. Browsers always send Origin; other clients (a
	// mobile app, a service) may not, and aren't the target of cross-site
	// hijacking.
	// +optional
	AllowMissingOrigin bool `json:"allowMissingOrigin,omitempty"`

	// RequiredHeaders are headers a handshake must have, not empty: a
	// token (Authorization), a subprotocol (Sec-WebSocket-Protocol). Their
	// values aren't checked.
	// +kubebuilder:validation:MaxItems=16
	// +listType=set
	// +optional
	RequiredHeaders []HeaderName `json:"requiredHeaders,omitempty"`
}

WebSocketSpec is what a WebSocket handshake must meet. +kubebuilder:validation:XValidation:rule="!has(self.allowMissingOrigin) || !self.allowMissingOrigin || (has(self.allowedOrigins) && size(self.allowedOrigins) > 0)",message="allowMissingOrigin needs allowedOrigins"

func (*WebSocketSpec) DeepCopy added in v0.4.0

func (in *WebSocketSpec) DeepCopy() *WebSocketSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebSocketSpec.

func (*WebSocketSpec) DeepCopyInto added in v0.4.0

func (in *WebSocketSpec) DeepCopyInto(out *WebSocketSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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