v1alpha1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=research.dynatrace.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "research.dynatrace.com", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type CaptorDeployment

type CaptorDeployment struct {
	// Strategy is the technical method to deploy the captor.
	// Currently, only "tetragon" is supported, which is also the default.
	// It requires the Tetragon controller to be installed.
	// +kubebuilder:validation:Enum=tetragon
	// +optional
	// +kubebuilder:default="tetragon"
	Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"`
}

CaptorDeployment is the entity that monitors access to the traps.

func (*CaptorDeployment) DeepCopy

func (in *CaptorDeployment) DeepCopy() *CaptorDeployment

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

func (*CaptorDeployment) DeepCopyInto

func (in *CaptorDeployment) DeepCopyInto(out *CaptorDeployment)

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

type ChangeAnnotation

type ChangeAnnotation struct {
	// DeceptionPolicyName is the name of the DeceptionPolicy that was applied to the object.
	DeceptionPolicyName string `json:"deceptionPolicyName"`

	// Traps is the list of traps that were added to the object.
	Traps []TrapAnnotation `json:"traps"`
}

ChangeAnnotation stores changes made by Koney to an object.

func (*ChangeAnnotation) DeepCopy

func (in *ChangeAnnotation) DeepCopy() *ChangeAnnotation

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

func (*ChangeAnnotation) DeepCopyInto

func (in *ChangeAnnotation) DeepCopyInto(out *ChangeAnnotation)

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

type DeceptionPolicy

type DeceptionPolicy struct {
	metav1.TypeMeta `json:",inline" yaml:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

	// Spec is the specification of the DeceptionPolicy.
	Spec DeceptionPolicySpec `json:"spec,omitempty" yaml:"spec,omitempty"`

	// Status is the status of the DeceptionPolicy.
	Status DeceptionPolicyStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

DeceptionPolicy is the Schema for the deceptionpolicies API

func (*DeceptionPolicy) DeepCopy

func (in *DeceptionPolicy) DeepCopy() *DeceptionPolicy

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

func (*DeceptionPolicy) DeepCopyInto

func (in *DeceptionPolicy) DeepCopyInto(out *DeceptionPolicy)

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

func (*DeceptionPolicy) DeepCopyObject

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

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

type DeceptionPolicyCondition

type DeceptionPolicyCondition struct {
	// Type of deception policy condition.
	// The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=316
	Type string `json:"type" yaml:"type"`

	// Status of the condition, one of True, False, Unknown.
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=True;False;Unknown
	Status metav1.ConditionStatus `json:"status" yaml:"status"`

	// LastTransitionTime is the last time the condition transitioned from one status to another,
	// i.e., when the underlying condition changed.
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Format=date-time
	LastTransitionTime metav1.Time `json:"lastTransitionTime" yaml:"lastTransitionTime"`

	// Reason indicates the reason for the condition's last transition.
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$`
	Reason string `json:"reason" yaml:"reason"`

	// Message is a human-readable explanation indicating details about the transition.
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=32768
	Message string `json:"message" yaml:"message"`
}

DeceptionPolicyCondition describes the state of one aspect of a DeceptionPolicy at a certain point.

func (*DeceptionPolicyCondition) DeepCopy

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

func (*DeceptionPolicyCondition) DeepCopyInto

func (in *DeceptionPolicyCondition) DeepCopyInto(out *DeceptionPolicyCondition)

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

func (*DeceptionPolicyCondition) Equals

func (condition *DeceptionPolicyCondition) Equals(other *DeceptionPolicyCondition) bool

Equals returns true if the conditions are equal (excluding LastTransitionTime).

type DeceptionPolicyList

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

DeceptionPolicyList contains a list of DeceptionPolicy

func (*DeceptionPolicyList) DeepCopy

func (in *DeceptionPolicyList) DeepCopy() *DeceptionPolicyList

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

func (*DeceptionPolicyList) DeepCopyInto

func (in *DeceptionPolicyList) DeepCopyInto(out *DeceptionPolicyList)

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

func (*DeceptionPolicyList) DeepCopyObject

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

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

type DeceptionPolicySpec

type DeceptionPolicySpec struct {
	// Traps is a list of traps to be deployed by the deception policy.
	// Each trap represents a cyber deception technique.
	Traps []Trap `json:"traps,omitempty" yaml:"traps,omitempty"`

	// StrictValidation is a flag that indicates whether the policy should be strictly validated.
	// If set to true, the traps will be deployed only if all the traps in the policy are valid.
	// If set to false, the valid traps will be deployed even if some of the traps are invalid.
	// By default, it is set to true.
	// +optional
	// +kubebuilder:default:=true
	StrictValidation *bool `json:"strictValidation,omitempty" yaml:"strictValidation,omitempty"`

	// MutateExisting is a flag to also allow adding traps to existing resources.
	// Typically, that means that existing resource definitions will be updated to include the traps.
	// Depending on the decoy and captor deployment strategies, this may require restarting the pods.
	// +optional
	// +kubebuilder:default=true
	MutateExisting *bool `json:"mutateExisting,omitempty" yaml:"mutateExisting,omitempty"`
}

DeceptionPolicySpec defines the desired state of DeceptionPolicy

func (*DeceptionPolicySpec) DeepCopy

func (in *DeceptionPolicySpec) DeepCopy() *DeceptionPolicySpec

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

func (*DeceptionPolicySpec) DeepCopyInto

func (in *DeceptionPolicySpec) DeepCopyInto(out *DeceptionPolicySpec)

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

type DeceptionPolicyStatus

type DeceptionPolicyStatus struct {
	// Conditions is an array of conditions that the DeceptionPolicy can be in.
	// +listType=map
	// +listMapKey=type
	Conditions []DeceptionPolicyCondition `json:"conditions" yaml:"conditions"`
}

DeceptionPolicyStatus defines the observed state of DeceptionPolicy

func (*DeceptionPolicyStatus) ContainsCondition

func (status *DeceptionPolicyStatus) ContainsCondition(conditionType string) bool

ContainsCondition returns true if the DeceptionPolicy status contains a condition with the provided type.

func (*DeceptionPolicyStatus) DeepCopy

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

func (*DeceptionPolicyStatus) DeepCopyInto

func (in *DeceptionPolicyStatus) DeepCopyInto(out *DeceptionPolicyStatus)

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

func (*DeceptionPolicyStatus) GetCondition

func (status *DeceptionPolicyStatus) GetCondition(conditionType string) *DeceptionPolicyCondition

GetCondition returns a pointer to the first condition with the provided type, if it exists.

func (*DeceptionPolicyStatus) PutCondition

func (status *DeceptionPolicyStatus) PutCondition(conditionType string, conditionStatus metav1.ConditionStatus, conditionReason, conditionMessage string) bool

PutCondition adds a new condition to the DeceptionPolicy status, or updates the first existing condition of the same type, if it exists. The function returns true if the conditions were modified as a result of the operation.

func (*DeceptionPolicyStatus) PutConditionStruct

func (status *DeceptionPolicyStatus) PutConditionStruct(condition DeceptionPolicyCondition) bool

PutConditionStruct adds a new condition to the DeceptionPolicy status, or updates the first existing condition of the same type, if it exists. The function returns true if the conditions were modified as a result of the operation.

type DecoyDeployment

type DecoyDeployment struct {
	// Strategy is the technical method to deploy the trap.
	// +kubebuilder:validation:Enum=volumeMount;containerExec;kyvernoPolicy
	// +optional
	// +kubebuilder:default="volumeMount"
	Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"`
}

DecoyDeployment is the entities that is attacked (e.g., the honeytoken).

func (*DecoyDeployment) DeepCopy

func (in *DecoyDeployment) DeepCopy() *DecoyDeployment

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

func (*DecoyDeployment) DeepCopyInto

func (in *DecoyDeployment) DeepCopyInto(out *DecoyDeployment)

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

type FilesystemHoneytoken

type FilesystemHoneytoken struct {
	// FilePath is the path of the file to be created.
	FilePath string `json:"filePath" yaml:"filePath"`

	// FileContent is the content of the file to be created.
	// +optional
	// +kubebuilder:default=""
	FileContent string `json:"fileContent" yaml:"fileContent"`

	// ReadOnly is a flag to make the file read-only.
	// +optional
	// +kubebuilder:default=true
	ReadOnly bool `json:"readOnly" yaml:"readOnly"`
}

FilesystemHoneytoken defines the configuration for a filesystem honeytoken trap.

func (*FilesystemHoneytoken) DeepCopy

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

func (*FilesystemHoneytoken) DeepCopyInto

func (in *FilesystemHoneytoken) DeepCopyInto(out *FilesystemHoneytoken)

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

func (*FilesystemHoneytoken) IsValid

func (f *FilesystemHoneytoken) IsValid() error

IsValid checks if the filesystem honeytoken trap is valid. The file path must be absolute.

type FilesystemHoneytokenAnnotation

type FilesystemHoneytokenAnnotation struct {
	// FilePath is the absolute path to the honeytoken file.
	FilePath string `json:"filePath"`

	// FileContentHash is the MD5 hash of the file content.
	FileContentHash string `json:"fileContentHash"`

	// ReadOnly is true if the file is read-only.
	ReadOnly bool `json:"readOnly"`
}

FilesystemHoneytokenAnnotation represents a concrete deployment of a filesystem honeytoken trap.

func (*FilesystemHoneytokenAnnotation) DeepCopy

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

func (*FilesystemHoneytokenAnnotation) DeepCopyInto

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

func (*FilesystemHoneytokenAnnotation) Equals

Equals returns true if the filesystem honeytoken annotations are equal.

type HttpEndpoint

type HttpEndpoint struct {
}

HttpEndpoint defines the configuration for an HTTP endpoint trap.

func (*HttpEndpoint) DeepCopy

func (in *HttpEndpoint) DeepCopy() *HttpEndpoint

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

func (*HttpEndpoint) DeepCopyInto

func (in *HttpEndpoint) DeepCopyInto(out *HttpEndpoint)

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

func (*HttpEndpoint) IsValid

func (f *HttpEndpoint) IsValid() error

IsValid checks if the HTTP endpoint trap is valid.

type HttpEndpointAnnotation

type HttpEndpointAnnotation struct {
}

HttpEndpointAnnotation represents a concrete deployment of an HTTP endpoint trap.

func (*HttpEndpointAnnotation) DeepCopy

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

func (*HttpEndpointAnnotation) DeepCopyInto

func (in *HttpEndpointAnnotation) DeepCopyInto(out *HttpEndpointAnnotation)

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

func (*HttpEndpointAnnotation) Equals

func (annotation *HttpEndpointAnnotation) Equals(other *HttpEndpointAnnotation) bool

Equals returns true if the HTTP endpoint annotations are equal.

type HttpPayload

type HttpPayload struct {
}

HttpPayload defines the configuration for an HTTP payload trap.

func (*HttpPayload) DeepCopy

func (in *HttpPayload) DeepCopy() *HttpPayload

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

func (*HttpPayload) DeepCopyInto

func (in *HttpPayload) DeepCopyInto(out *HttpPayload)

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

func (*HttpPayload) IsValid

func (f *HttpPayload) IsValid() error

IsValid checks if the HTTP payload trap is valid.

type HttpPayloadAnnotation

type HttpPayloadAnnotation struct {
}

AnnotationHttpEndpoint represents a concrete deployment of an HTTP payload trap.

func (*HttpPayloadAnnotation) DeepCopy

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

func (*HttpPayloadAnnotation) DeepCopyInto

func (in *HttpPayloadAnnotation) DeepCopyInto(out *HttpPayloadAnnotation)

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

func (*HttpPayloadAnnotation) Equals

func (annotation *HttpPayloadAnnotation) Equals(other *HttpPayloadAnnotation) bool

Equals returns true if the HTTP payload annotations are equal.

type MatchResources

type MatchResources struct {
	// Any is a list of resource filters.
	Any []ResourceFilter `json:"any,omitempty" yaml:"any,omitempty"`
}

MatchResources is used to specify resource matching criteria for a trap.

func (*MatchResources) DeepCopy

func (in *MatchResources) DeepCopy() *MatchResources

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

func (*MatchResources) DeepCopyInto

func (in *MatchResources) DeepCopyInto(out *MatchResources)

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

type ResourceDescription

type ResourceDescription struct {
	// Namespaces is a list of namespaces names.
	// It does not support wildcards.
	// +optional
	Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`

	// Selector is a label selector.
	// It does not support wildcards.
	// +optional
	Selector *metav1.LabelSelector `json:"selector,omitempty" yaml:"selector,omitempty"`

	// ContainerSelector is a selector to filter the containers to inject the trap into.
	// +optional
	// +kubebuilder:default="*"
	ContainerSelector string `json:"containerSelector,omitempty" yaml:"containerSelector,omitempty"`
}

func (*ResourceDescription) DeepCopy

func (in *ResourceDescription) DeepCopy() *ResourceDescription

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

func (*ResourceDescription) DeepCopyInto

func (in *ResourceDescription) DeepCopyInto(out *ResourceDescription)

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

type ResourceFilter

type ResourceFilter struct {
	// ResourceDescription contains information about the resource being created or modified.
	ResourceDescription `json:"resources,omitempty" yaml:"resources,omitempty"`
}

ResourceFilter allow users to "AND" or "OR" between resources

func (*ResourceFilter) DeepCopy

func (in *ResourceFilter) DeepCopy() *ResourceFilter

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

func (*ResourceFilter) DeepCopyInto

func (in *ResourceFilter) DeepCopyInto(out *ResourceFilter)

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

type Trap

type Trap struct {
	// FilesystemHoneytoken is the configuration for a filesystem honeytoken trap.
	// +optional
	FilesystemHoneytoken FilesystemHoneytoken `json:"filesystemHoneytoken,omitempty" yaml:"spec,omitempty"`

	// HttpEndpoint is the configuration for an HTTP endpoint trap.
	// +optional
	HttpEndpoint HttpEndpoint `json:"httpEndpoint,omitempty" yaml:"httpEndpoint,omitempty"`

	// HttpPayload is the configuration for an HTTP payload trap.
	// +optional
	HttpPayload HttpPayload `json:"httpPayload,omitempty" yaml:"httpPayload,omitempty"`

	// DecoyDeployment configures how traps (the entities that are attacked) are going to be deployed.
	// +optional
	DecoyDeployment DecoyDeployment `json:"decoyDeployment,omitempty" yaml:"decoyDeployment,omitempty"`

	// CaptorDeployment configures how captors (the entities that monitor access to the traps) are going to be deployed.
	// +optional
	CaptorDeployment CaptorDeployment `json:"captorDeployment,omitempty" yaml:"captorDeployment,omitempty"`

	// Match define what Kubernetes resources to apply this trap to.
	// Matching criteria are resources labels and/or namespaces.
	// +optional
	MatchResources MatchResources `json:"match,omitempty" yaml:"match,omitempty"`
}

Trap describes a cyber deception technique, also simply known as a trap.

func (*Trap) DeepCopy

func (in *Trap) DeepCopy() *Trap

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

func (*Trap) DeepCopyInto

func (in *Trap) DeepCopyInto(out *Trap)

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

func (*Trap) IsValid

func (trap *Trap) IsValid() error

IsValid checks if the trap specification is valid. The MatchResources field must include at least one of the MatchResources.Any.Namespaces or MatchResources.Any.Selector. Also, each individual trap will be validated as well. Note that only one trap can be specified at a time.

func (*Trap) TrapType

func (trap *Trap) TrapType() TrapType

TrapType returns the type of trap.

type TrapAnnotation

type TrapAnnotation struct {
	// DeploymentStrategy is the strategy to deploy the trap.
	DeploymentStrategy string `json:"deploymentStrategy"`

	// Containers is the list of containers where the trap is deployed.
	// kubebuilder:validation:UniqueItems=true
	Containers []string `json:"containers"`

	// CreatedAt is the time in the current local time when the trap was injected in the pod.
	// +kubebuilder:validation:Format=date-time
	CreatedAt string `json:"createdAt"`

	// UpdatedAt is the time in the current local time when the trap was last updated in the pod.
	// +kubebuilder:validation:Format=date-time
	// +optional
	UpdatedAt string `json:"updatedAt"`

	// FilesystemHoneytoken is the configuration for a filesystem honeytoken trap.
	// +optional
	FilesystemHoneytoken FilesystemHoneytokenAnnotation `json:"filesystemHoneytoken"`

	// HttpEndpoint is the configuration for an HTTP endpoint trap.
	// +optional
	HttpEndpoint HttpEndpointAnnotation `json:"httpEndpoint"`

	// HttpPayload is the configuration for an HTTP payload trap.
	// +optional
	HttpPayload HttpPayloadAnnotation `json:"httpPayload"`
}

TrapAnnotation stores the information of a trap that was added to some object.

func (*TrapAnnotation) DeepCopy

func (in *TrapAnnotation) DeepCopy() *TrapAnnotation

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

func (*TrapAnnotation) DeepCopyInto

func (in *TrapAnnotation) DeepCopyInto(out *TrapAnnotation)

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

func (*TrapAnnotation) Equals

func (annotation *TrapAnnotation) Equals(other *TrapAnnotation, ignoreContainers bool) bool

Equals returns true if the traps annotations are equal (excluding CreatedAt and UpdatedAt). If ignoreContainers is true, the function also ignores the containers list.

func (*TrapAnnotation) TrapType

func (trap *TrapAnnotation) TrapType() TrapType

TrapType translates a TrapAnnotation to a TrapType.

type TrapType

type TrapType string

TrapType is a string representation of a trap type and can be used like an enum.

const (
	// UnknownTrap is the default trap type.
	UnknownTrap TrapType = "Unknown"

	// FilesystemHoneytokenTrap is a filesystem honeytoken trap.
	FilesystemHoneytokenTrap TrapType = "FilesystemHoneytoken"

	// HttpEndpointTrap is an HTTP endpoint trap.
	HttpEndpointTrap TrapType = "HttpEndpoint"

	// HttpPayloadTrap is an HTTP payload trap.
	HttpPayloadTrap TrapType = "HttpPayload"
)

Jump to

Keyboard shortcuts

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