Here is the stable v1
api available since version
1.0.0
of the operator.
type KivePolicy struct {
.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
metav1
`json:"spec,omitempty"`
Spec KivePolicySpec }
type KivePolicySpec struct {
// Version for KiveAlert output
string `json:"alertVersion,omitempty"`
AlertVersion // List of traps
[]KiveTrap `json:"traps,omitempty"`
Traps }
type KiveTrap struct {
// Specifies which path to monitor
string `json:"path,omitempty"`
Path // (optional) Whether to create the file or not if It was not found
bool `json:"create,omitempty"`
Create // (optional) The permissions of the file to be created if create is set to true
uint32 `json:"mode,omitempty"`
Mode // (optional) Send an HTTP POST request to this endpoint
string `json:"callback,omitempty"`
Callback // (optional) Additional information for this trap
string `json:"metadata,omitempty"`
Metadata // Match any of the following items (logical OR), at least one must be present
[]KiveTrapMatch `json:"matchAny,omitempty"`
MatchAny }
// Match all the following optional fields (logical AND)
type KiveTrapMatch struct {
// Filter pods by name
string `json:"pod,omitempty"`
PodName // Filter container by name.
// - if this field is prepended by "regex:", the rest of the string
// will represent a regular expression matched with go regexp
// library (https://golang.org/s/re2syntax)
// - if the field is prepended by "glob:", then this is a
// filesystem-style regex, as described in go filepath.Match
// library (https://pkg.go.dev/path/filepath#Match)
// - otherwise, the name of the container will be compared exactly
string `json:"containerName,omitempty"`
ContainerName // Filter pods by namespace
string `json:"namespace,omitempty"`
Namespace // Filter pods by IP
string `json:"ip,omitempty"`
IP // Filter pods by label
map[string]string `json:"matchLabels,omitempty"`
MatchLabels }
// File access alert
type KiveAlert struct {
// KiveAlert version
string `json:"kive-alert-version"`
AlertVersion // The policy that triggered the alert
string `json:"kive-policy-name"`
PolicyName // Alert creation time
string `json:"timestamp"` // RFC 3339
Timestamp // Additional information
`json:"metadata"`
Metadata KiveAlertMetadata // User specified metadata (from KivePolicy)
map[string]string `json:"custom-metadata"`
CustomMetadata // Information about the pod where the file lives
`json:"pod"`
Pod PodMetadata // Information about the node
`json:"node"`
Node NodeMetadata // Information about the process that accessed the file
`json:"process"`
Process ProcessMetadata }
// Additional information
type KiveAlertMetadata struct {
// File path
string `json:"path"`
Path // Inode number of the file
uint64 `json:"inode"`
Inode // Unix access permission mask
int32 `json:"mask"`
Mask // ID of the kernel where the alert was triggered
string `json:"kernel-id"`
KernelID // Callback URI
string `json:"callback"`
Callback }
// Information related to the process that accessed the file
type ProcessMetadata struct {
// Process ID
int32 `json:"pid"`
Pid // Thread group ID
uint32 `json:"tgid"`
Tgid // User ID
uint32 `json:"uid"`
Uid // Group ID
uint32 `json:"gid"`
Gid // Process binary
string `json:"binary"`
Binary // Current Working Directory
string `json:"cwd"`
Cwd // Arguments to the Binary
string `json:"arguments"`
Arguments }
// Information about the node
type NodeMetadata struct {
// Name of the node
string `json:"name"`
Name }
// Information about the pod where the file lives
type PodMetadata struct {
// Pod name
string `json:"name"`
Name // Pod namespace
string `json:"namespace"`
Namespace // Pod ip
string `json:"ip"`
Ip // Information about the container
`json:"container"`
Container ContainerMetadata }
// Information about the container
type ContainerMetadata struct {
// Container id
string `json:"id"`
Id // Container name
string `json:"name"`
Name }