diff --git a/.gitignore b/.gitignore index 4bb0fa8b..1ab7a413 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ DO-NOT-COMMIT-local-setup.yaml deployment/compose/minio/data deployment/compose/tempo/data deployment/compose/loki/data -.env \ No newline at end of file +.env +pod*.yaml diff --git a/actionners/actionners.go b/actionners/actionners.go index 6067e5b3..0bc75f4e 100644 --- a/actionners/actionners.go +++ b/actionners/actionners.go @@ -20,6 +20,7 @@ import ( lambdaInvoke "github.com/falcosecurity/falco-talon/actionners/aws/lambda" calicoNetworkpolicy "github.com/falcosecurity/falco-talon/actionners/calico/networkpolicy" ciliumNetworkpolicy "github.com/falcosecurity/falco-talon/actionners/cilium/networkpolicy" + gcpFunctionCall "github.com/falcosecurity/falco-talon/actionners/gcp/function" k8sCordon "github.com/falcosecurity/falco-talon/actionners/kubernetes/cordon" k8sDelete "github.com/falcosecurity/falco-talon/actionners/kubernetes/delete" k8sDownload "github.com/falcosecurity/falco-talon/actionners/kubernetes/download" @@ -81,6 +82,7 @@ func ListDefaultActionners() *Actionners { k8sDownload.Register(), k8sTcpdump.Register(), lambdaInvoke.Register(), + gcpFunctionCall.Register(), calicoNetworkpolicy.Register(), ciliumNetworkpolicy.Register(), ) diff --git a/actionners/gcp/function/function.go b/actionners/gcp/function/function.go new file mode 100644 index 00000000..bc5a4d59 --- /dev/null +++ b/actionners/gcp/function/function.go @@ -0,0 +1,255 @@ +package functions + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "strconv" + "time" + + "cloud.google.com/go/functions/apiv2/functionspb" + "google.golang.org/api/idtoken" + + "github.com/falcosecurity/falco-talon/internal/events" + "github.com/falcosecurity/falco-talon/internal/gcp/checks" + "github.com/falcosecurity/falco-talon/internal/gcp/client" + "github.com/falcosecurity/falco-talon/internal/models" + "github.com/falcosecurity/falco-talon/internal/rules" + "github.com/falcosecurity/falco-talon/utils" +) + +const ( + Name string = "function" + Category string = "gcp" + Description string = "Invoke a GCP function forwarding the Falco event payload" + Source string = "any" + Continue bool = true + AllowOutput bool = false + RequireOutput bool = false + Permissions string = `{ + "cloudfunctions.functions.get", + "cloudfunctions.functions.invoke" + }` + Example string = `- action: Invoke GCP Cloud Function + actionner: gcp:function + parameters: + gcp_function_name: sample-function + gcp_function_location: us-central1 + gcp_function_timeout: 10 + ` +) + +var ( + RequiredOutputFields = []string{} +) + +type Parameters struct { + GCPFunctionName string `mapstructure:"gcp_function_name" validate:"required"` + GCPFunctionLocation string `mapstructure:"gcp_function_location" validate:"required"` + GCPFunctionTimeout int `mapstructure:"gcp_function_timeout"` +} + +type Actionner struct{} + +func Register() *Actionner { + return new(Actionner) +} + +func (a Actionner) Init() error { + return client.Init() +} + +func (a Actionner) Information() models.Information { + return models.Information{ + Name: Name, + FullName: Category + ":" + Name, + Category: Category, + Description: Description, + Source: Source, + RequiredOutputFields: RequiredOutputFields, + Permissions: Permissions, + Example: Example, + Continue: Continue, + AllowOutput: AllowOutput, + RequireOutput: RequireOutput, + } +} + +func (a Actionner) Parameters() models.Parameters { + return Parameters{ + GCPFunctionName: "", + GCPFunctionLocation: "us-central1", // Default location + } +} + +func (a Actionner) Checks(_ *events.Event, action *rules.Action) error { + var parameters Parameters + err := utils.DecodeParams(action.GetParameters(), ¶meters) + if err != nil { + return err + } + + return checks.CheckFunctionExist{}.Run(parameters.GCPFunctionName, parameters.GCPFunctionLocation) +} + +func (a Actionner) Run(event *events.Event, action *rules.Action) (utils.LogLine, *models.Data, error) { + gcpClient, err := client.GetGCPClient() + if err != nil { + return utils.LogLine{ + Objects: nil, + Error: err.Error(), + Status: utils.FailureStr, + }, nil, err + } + return a.RunWithClient(gcpClient, event, action) +} + +func (a Actionner) CheckParameters(action *rules.Action) error { + var parameters Parameters + err := utils.DecodeParams(action.GetParameters(), ¶meters) + if err != nil { + return err + } + + err = utils.ValidateStruct(parameters) + if err != nil { + return err + } + return nil +} + +func (a Actionner) RunWithClient(c client.GCPClientAPI, event *events.Event, action *rules.Action) (utils.LogLine, *models.Data, error) { + var parameters Parameters + err := utils.DecodeParams(action.GetParameters(), ¶meters) + if err != nil { + return utils.LogLine{ + Objects: nil, + Error: err.Error(), + Status: utils.FailureStr, + }, nil, err + } + + objects := map[string]string{ + "name": parameters.GCPFunctionName, + "location": parameters.GCPFunctionLocation, + } + + functionName := fmt.Sprintf("projects/%s/locations/%s/functions/%s", c.ProjectID(), parameters.GCPFunctionLocation, parameters.GCPFunctionName) + + getFunctionReq := &functionspb.GetFunctionRequest{ + Name: functionName, + } + + gcpFunctionClient, err := c.GetGcpFunctionClient(context.Background()) + if err != nil { + return utils.LogLine{ + Objects: objects, + Error: err.Error(), + Status: utils.FailureStr, + }, nil, err + } + + ctx := context.Background() + + function, err := gcpFunctionClient.GetFunction(ctx, getFunctionReq) + if err != nil { + return utils.LogLine{ + Objects: objects, + Error: fmt.Sprintf("failed to get function: %v", err), + Status: utils.FailureStr, + }, nil, err + } + + if function.ServiceConfig.Uri == "" { + return utils.LogLine{ + Objects: objects, + Error: "function does not have a valid URL", + Status: utils.FailureStr, + }, nil, fmt.Errorf("function does not have a valid URL") + } + + functionURL := function.ServiceConfig.Uri + + payload, err := json.Marshal(event) + if err != nil { + return utils.LogLine{ + Objects: objects, + Error: err.Error(), + Status: utils.FailureStr, + }, nil, err + } + + tokenSource, err := idtoken.NewTokenSource(ctx, functionURL) + if err != nil { + return utils.LogLine{ + Objects: objects, + Error: fmt.Sprintf("failed to create ID token source: %v", err), + Status: utils.FailureStr, + }, nil, err + } + token, err := tokenSource.Token() + if err != nil { + return utils.LogLine{ + Objects: objects, + Error: fmt.Sprintf("failed to obtain ID token: %v", err), + Status: utils.FailureStr, + }, nil, err + } + + req, err := http.NewRequestWithContext(ctx, "POST", functionURL, bytes.NewReader(payload)) + if err != nil { + return utils.LogLine{ + Objects: objects, + Error: fmt.Sprintf("failed to create HTTP request: %v", err), + Status: utils.FailureStr, + }, nil, err + } + + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Authorization", "Bearer "+token.AccessToken) + + if parameters.GCPFunctionTimeout > 0 { + httpClient := http.Client{ + Timeout: time.Duration(parameters.GCPFunctionTimeout), + } + c.SetHTTPClient(&httpClient) + } + + resp, err := c.HTTPClient().Do(req) + if err != nil { + return utils.LogLine{ + Objects: objects, + Error: fmt.Sprintf("failed to invoke function: %v", err), + Status: utils.FailureStr, + }, nil, err + } + defer resp.Body.Close() + + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return utils.LogLine{ + Objects: objects, + Error: fmt.Sprintf("failed to read response body: %v", err), + Status: utils.FailureStr, + }, nil, err + } + + if resp.StatusCode != http.StatusOK { + return utils.LogLine{ + Objects: objects, + Error: fmt.Sprintf("function invocation failed with status %d: %s", resp.StatusCode, string(respBody)), + Status: utils.FailureStr, + }, nil, fmt.Errorf("function invocation failed with status %d: %s", resp.StatusCode, string(respBody)) + } + + objects["function_response"] = string(respBody) + objects["function_response_status"] = strconv.Itoa(resp.StatusCode) + + return utils.LogLine{ + Objects: objects, + Status: utils.SuccessStr, + }, nil, nil +} diff --git a/actionners/kubernetes/drain/drain.go b/actionners/kubernetes/drain/drain.go index 48b6e7ec..80ca00d4 100644 --- a/actionners/kubernetes/drain/drain.go +++ b/actionners/kubernetes/drain/drain.go @@ -220,13 +220,7 @@ func (a Actionner) RunWithClient(client k8s.DrainClient, event *events.Event, ac go func(pod corev1.Pod) { defer wg.Done() - ownerKind, err := k8s.GetOwnerKind(p) - if err != nil { - utils.PrintLog("warning", utils.LogLine{Message: fmt.Sprintf("error getting pod '%v' owner kind: %v", p.Name, err)}) - atomic.AddInt32(&otherErrorsCount, 1) - return - } - + ownerKind := k8s.PodKind(p) switch ownerKind { case utils.DaemonSetStr: if parameters.IgnoreDaemonsets { diff --git a/actionners/kubernetes/terminate/terminate.go b/actionners/kubernetes/terminate/terminate.go index 55d1c616..326497a1 100644 --- a/actionners/kubernetes/terminate/terminate.go +++ b/actionners/kubernetes/terminate/terminate.go @@ -50,6 +50,7 @@ rules: grace_period_seconds: 5 ignore_daemonsets: true ignore_statefulsets: true + ignore_standalone_pods: true min_healthy_replicas: 33% ` ) @@ -59,10 +60,11 @@ var ( ) type Parameters struct { - MinHealthyReplicas string `mapstructure:"min_healthy_replicas" validate:"omitempty,is_absolut_or_percent"` - IgnoreDaemonsets bool `mapstructure:"ignore_daemonsets" validate:"omitempty"` - IgnoreStatefulSets bool `mapstructure:"ignore_statefulsets" validate:"omitempty"` - GracePeriodSeconds int `mapstructure:"grace_period_seconds" validate:"omitempty"` + MinHealthyReplicas string `mapstructure:"min_healthy_replicas" validate:"omitempty,is_absolut_or_percent"` + IgnoreDaemonsets bool `mapstructure:"ignore_daemonsets" validate:"omitempty"` + IgnoreStatefulSets bool `mapstructure:"ignore_statefulsets" validate:"omitempty"` + IgnoreStandalonePods bool `mapstructure:"ignore_standalone_pods" validate:"omitempty"` + GracePeriodSeconds int `mapstructure:"grace_period_seconds" validate:"omitempty"` } type Actionner struct{} @@ -92,10 +94,11 @@ func (a Actionner) Information() models.Information { } func (a Actionner) Parameters() models.Parameters { return Parameters{ - MinHealthyReplicas: "", - IgnoreDaemonsets: false, - IgnoreStatefulSets: false, - GracePeriodSeconds: 0, + MinHealthyReplicas: "", + IgnoreDaemonsets: false, + IgnoreStatefulSets: false, + IgnoreStandalonePods: true, + GracePeriodSeconds: 0, } } @@ -137,16 +140,7 @@ func (a Actionner) Run(event *events.Event, action *rules.Action) (utils.LogLine err } - ownerKind, err := k8s.GetOwnerKind(*pod) - if err != nil { - return utils.LogLine{ - Objects: objects, - Error: err.Error(), - Status: utils.FailureStr, - }, - nil, - err - } + ownerKind := k8s.PodKind(*pod) switch ownerKind { case utils.DaemonSetStr: @@ -226,6 +220,14 @@ func (a Actionner) Run(event *events.Event, action *rules.Action) (utils.LogLine } } } + case utils.StandalonePodStr: + if parameters.IgnoreStandalonePods { + return utils.LogLine{ + Objects: objects, + Status: "ignored", + Result: fmt.Sprintf("the pod '%v' in the namespace '%v' is a standalone pod and will be ignored.", podName, namespace), + }, nil, nil + } } err = client.Clientset.CoreV1().Pods(namespace).Delete(context.Background(), podName, metav1.DeleteOptions{GracePeriodSeconds: gracePeriodSeconds}) diff --git a/configuration/configuration.go b/configuration/configuration.go index e0ec830c..bc5b381e 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -35,19 +35,20 @@ type Otel struct { } type Configuration struct { - Notifiers map[string]map[string]any `mapstructure:"notifiers"` - AwsConfig AwsConfig `mapstructure:"aws"` - LogFormat string `mapstructure:"log_format"` - KubeConfig string `mapstructure:"kubeconfig"` - ListenAddress string `mapstructure:"listen_address"` - MinioConfig MinioConfig `mapstructure:"minio"` - RulesFiles []string `mapstructure:"rules_files"` - DefaultNotifiers []string `mapstructure:"default_notifiers"` - Otel Otel `mapstructure:"otel"` - Deduplication deduplication `mapstructure:"deduplication"` - ListenPort int `mapstructure:"listen_port"` - WatchRules bool `mapstructure:"watch_rules"` - PrintAllEvents bool `mapstructure:"print_all_events"` + Notifiers map[string]map[string]interface{} `mapstructure:"notifiers"` + AwsConfig AwsConfig `mapstructure:"aws"` + GcpConfig GcpConfig `mapstructure:"gcp"` + LogFormat string `mapstructure:"log_format"` + KubeConfig string `mapstructure:"kubeconfig"` + ListenAddress string `mapstructure:"listen_address"` + MinioConfig MinioConfig `mapstructure:"minio"` + RulesFiles []string `mapstructure:"rules_files"` + DefaultNotifiers []string `mapstructure:"default_notifiers"` + Otel Otel `mapstructure:"otel"` + Deduplication deduplication `mapstructure:"deduplication"` + ListenPort int `mapstructure:"listen_port"` + WatchRules bool `mapstructure:"watch_rules"` + PrintAllEvents bool `mapstructure:"print_all_events"` } type deduplication struct { @@ -63,6 +64,11 @@ type AwsConfig struct { ExternalID string `mapstructure:"external_id"` } +type GcpConfig struct { + Region string `mapstructure:"region"` + CredentialsPath string `mapstructure:"credentials_path"` +} + type MinioConfig struct { Endpoint string `mapstructure:"endpoint"` AccessKey string `mapstructure:"access_key"` diff --git a/go.mod b/go.mod index 7a6cdf49..41d06fcb 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,8 @@ go 1.22.3 toolchain go1.23.1 require ( + cloud.google.com/go/functions v1.19.1 + cloud.google.com/go/storage v1.43.0 github.com/aws/aws-sdk-go-v2 v1.32.4 github.com/aws/aws-sdk-go-v2/config v1.28.3 github.com/aws/aws-sdk-go-v2/credentials v1.17.44 @@ -19,6 +21,7 @@ require ( github.com/go-playground/validator/v10 v10.22.1 github.com/go-viper/mapstructure/v2 v2.2.1 github.com/google/uuid v1.6.0 + github.com/googleapis/gax-go/v2 v2.13.0 github.com/jinzhu/copier v0.4.0 github.com/magefile/mage v1.15.0 github.com/minio/minio-go/v7 v7.0.80 @@ -38,7 +41,9 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 go.opentelemetry.io/otel/sdk/metric v1.32.0 go.opentelemetry.io/otel/trace v1.32.0 + golang.org/x/oauth2 v0.23.0 golang.org/x/text v0.20.0 + google.golang.org/api v0.196.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.31.2 @@ -49,6 +54,12 @@ require ( ) require ( + cloud.google.com/go v0.115.1 // indirect + cloud.google.com/go/auth v0.9.3 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect + cloud.google.com/go/compute/metadata v0.5.0 // indirect + cloud.google.com/go/iam v1.2.0 // indirect + cloud.google.com/go/longrunning v0.6.0 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23 // indirect @@ -98,6 +109,8 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/gopacket v1.1.19 // indirect + github.com/google/s2a-go v0.1.8 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.3 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -150,6 +163,8 @@ require ( github.com/vishvananda/netns v0.0.4 // indirect github.com/x448/float16 v0.8.4 // indirect go.mongodb.org/mongo-driver v1.17.1 // indirect + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/dig v1.18.0 // indirect @@ -158,12 +173,12 @@ require ( golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect golang.org/x/net v0.30.0 // indirect - golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.9.0 // indirect golang.org/x/sys v0.27.0 // indirect golang.org/x/term v0.25.0 // indirect golang.org/x/time v0.7.0 // indirect golang.org/x/tools v0.26.0 // indirect + google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/go.sum b/go.sum index 3a440c7b..de86d3dc 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,27 @@ cel.dev/expr v0.16.0 h1:yloc84fytn4zmJX2GU3TkXGsaieaV7dQ057Qs4sIG2Y= cel.dev/expr v0.16.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ= +cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc= +cloud.google.com/go/auth v0.9.3 h1:VOEUIAADkkLtyfr3BLa3R8Ed/j6w1jTBmARx+wb5w5U= +cloud.google.com/go/auth v0.9.3/go.mod h1:7z6VY+7h3KUdRov5F1i8NDP5ZzWKYmEPO842BgCsmTk= +cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= +cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= +cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= +cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= +cloud.google.com/go/functions v1.19.1 h1:eWjTZohtJX/9rckZYXaYVViGi06JkNJRKvm0aO+ce+g= +cloud.google.com/go/functions v1.19.1/go.mod h1:18RszySpwRg6aH5UTTVsRfdCwDooSf/5mvSnU7NAk4A= +cloud.google.com/go/iam v1.2.0 h1:kZKMKVNk/IsSSc/udOb83K0hL/Yh/Gcqpz+oAkoIFN8= +cloud.google.com/go/iam v1.2.0/go.mod h1:zITGuWgsLZxd8OwAlX+eMFgZDXzBm7icj1PVTYG766Q= +cloud.google.com/go/longrunning v0.6.0 h1:mM1ZmaNsQsnb+5n1DNPeL0KwQd9jQRqSqSDEkBZr+aI= +cloud.google.com/go/longrunning v0.6.0/go.mod h1:uHzSZqW89h7/pasCWNYdUpwGz3PcVWhrWupreVPYLts= +cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= +cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= dario.cat/mergo v0.3.16 h1:wrt7QIfeqlABnUvmf9WpFwB0mGBwtySAJKTgCpnsbOE= dario.cat/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= @@ -52,6 +70,7 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -64,6 +83,8 @@ github.com/cilium/hive v0.0.0-20241009102328-2ab688845f23 h1:RQSJdQVdxE9puF18G5R github.com/cilium/hive v0.0.0-20241009102328-2ab688845f23/go.mod h1:pI2GJ1n3SLKIQVFrKF7W6A6gb6BQkZ+3Hp4PAEo5SuI= github.com/cilium/proxy v0.0.0-20241010085001-a4572e06b46f h1:mMfhIzIhJeynX7f/HjMN78+wONcFS7CsZdMqLI/t8g8= github.com/cilium/proxy v0.0.0-20241010085001-a4572e06b46f/go.mod h1:IRkQcAu6rRYzMd7V1EXyiHP4Mvmatx4CHnpA5OR0o6U= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 h1:QVw89YDxXxEe+l8gU8ETbOasdwEV+avkR75ZzsVV9WI= github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= @@ -82,6 +103,10 @@ github.com/emersion/go-smtp v0.21.3 h1:7uVwagE8iPYE48WhNsng3RRpCUpFvNl39JGNSIyGV github.com/emersion/go-smtp v0.21.3/go.mod h1:qm27SGYgoIPRot6ubfQ/GpiPy/g3PaZAVRxiO/sDUgQ= github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -140,12 +165,30 @@ github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PU github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -154,10 +197,19 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= +github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= +github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.3.3 h1:QRje2j5GZimBzlbhGA2V2QlGNgL8G6e+wGo/+/2bWI0= +github.com/googleapis/enterprise-certificate-proxy v0.3.3/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= +github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= +github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 h1:ad0vkEBuk23VJzZR9nkLVG0YAoN9coASF1GusYX6AlU= @@ -268,6 +320,7 @@ github.com/projectcalico/api v0.0.0-20240708202104-e3f70b269c2c h1:eFyfeRDV94LA3 github.com/projectcalico/api v0.0.0-20240708202104-e3f70b269c2c/go.mod h1:9EPxrA4rUH306dCpvVsFb7IcEFt4ZSvqmfSowfb6c5U= github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= @@ -305,8 +358,13 @@ github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace/go.mod h1:McXfInJRrz github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= @@ -321,6 +379,10 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM= go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT6POBP+gh8RUH19EOTnQIor5QE0uSRPtzCpSw= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= @@ -356,25 +418,38 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -397,6 +472,10 @@ golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -407,12 +486,35 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.196.0 h1:k/RafYqebaIJBO3+SMnfEGtFVlvp5vSgqTUF54UN/zg= +google.golang.org/api v0.196.0/go.mod h1:g9IL21uGkYgvQ5BZg6BAtoGJQIm8r6EgaAbpNey5wBE= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 h1:BulPr26Jqjnd4eYDVe+YvyR7Yc2vJGkO5/0UxD0/jZU= +google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:hL97c3SYopEHblzpxRL4lSs523++l8DYxGM1FQiYmb4= google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 h1:M0KvPgPmDZHPlbRbaNU1APr28TvwvvdUPlSv7PUvy8g= google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:dguCy7UOdZhTvLzDyt15+rOrawrpM4q7DD9dQ1P11P4= google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -432,6 +534,8 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= diff --git a/internal/gcp/checks/checks.go b/internal/gcp/checks/checks.go new file mode 100644 index 00000000..bec69b12 --- /dev/null +++ b/internal/gcp/checks/checks.go @@ -0,0 +1,39 @@ +package checks + +import ( + "context" + + "cloud.google.com/go/functions/apiv2/functionspb" + + "github.com/falcosecurity/falco-talon/internal/gcp/client" +) + +type CheckFunctionExist struct{} + +func (c CheckFunctionExist) Name() string { + return "CheckFunctionExist" +} + +func (c CheckFunctionExist) Run(functionName, location string) error { + gcpClient, err := client.GetGCPClient() + if err != nil { + return err + } + + functionClient, err := gcpClient.GetGcpFunctionClient(context.Background()) + if err != nil { + return err + } + + // Create a request to get function information + req := &functionspb.GetFunctionRequest{ + Name: "projects/" + gcpClient.ProjectID() + "/locations/" + location + "/functions/" + functionName, + } + + _, err = functionClient.GetFunction(context.Background(), req) + if err != nil { + return err + } + + return nil +} diff --git a/internal/gcp/client/client.go b/internal/gcp/client/client.go new file mode 100644 index 00000000..49b1f434 --- /dev/null +++ b/internal/gcp/client/client.go @@ -0,0 +1,174 @@ +package client + +import ( + "context" + "fmt" + "net/http" + "sync" + + functionsv2 "cloud.google.com/go/functions/apiv2" + "cloud.google.com/go/functions/apiv2/functionspb" + "cloud.google.com/go/storage" + "github.com/googleapis/gax-go/v2" + "golang.org/x/oauth2/google" + "google.golang.org/api/option" + + "github.com/falcosecurity/falco-talon/configuration" + "github.com/falcosecurity/falco-talon/utils" +) + +const functionServiceScope = "https://www.googleapis.com/auth/cloud-platform" + +// nolint:govet +type GCPClient struct { + clientOpts []option.ClientOption + functionsClient *functionsv2.FunctionClient + storageClient *storage.Client + httpClient HTTPClient + projectID string + functionsClientOnce sync.Once + storageClientOnce sync.Once +} + +type GCPClientAPI interface { + GetGcpFunctionClient(context.Context) (*functionsv2.FunctionClient, error) + GetStorageClient(context.Context) (*storage.Client, error) + ProjectID() string + HTTPClient() HTTPClient + SetHTTPClient(httpClient HTTPClient) + Close() []error +} + +type HTTPClient interface { + Do(req *http.Request) (*http.Response, error) +} + +type GcpFunctionAPI interface { + GetFunction(ctx context.Context, req *functionspb.GetFunctionRequest, opts ...gax.CallOption) (*functionspb.Function, error) + Close() error +} + +type GcpGcsAPI interface { + Bucket(name string) *storage.BucketHandle + Close() error +} + +var ( + gcpClient *GCPClient + once sync.Once +) + +func Init() error { + if gcpClient != nil { + return nil + } + + var initErr error + once.Do(func() { + gcpConfig := configuration.GetConfiguration().GcpConfig + + var clientOptions []option.ClientOption + var creds *google.Credentials + var err error + + if gcpConfig.CredentialsPath != "" { + creds, err = google.CredentialsFromJSON(context.Background(), []byte(gcpConfig.CredentialsPath), functionServiceScope) + if err != nil { + initErr = fmt.Errorf("unable to load credentials from file: %v", err) + return + } + clientOptions = append(clientOptions, option.WithCredentials(creds)) + } else { + creds, err = google.FindDefaultCredentials(context.Background(), functionServiceScope) + if err != nil { + initErr = fmt.Errorf("unable to find default credentials: %v", err) + return + } + clientOptions = append(clientOptions, option.WithCredentials(creds)) + } + + projectID, err := getProjectID(creds) + if err != nil { + initErr = err + return + } + + gcpClient = &GCPClient{ + clientOpts: clientOptions, + projectID: projectID, + httpClient: &http.Client{}, + } + + utils.PrintLog("info", utils.LogLine{Message: "init", Category: "gcp", Status: utils.SuccessStr}) + }) + + return initErr +} + +func GetGCPClient() (*GCPClient, error) { + if gcpClient == nil { + err := Init() + if err != nil { + return nil, err + } + } + return gcpClient, nil +} + +func (c *GCPClient) GetGcpFunctionClient(ctx context.Context) (*functionsv2.FunctionClient, error) { + var err error + c.functionsClientOnce.Do(func() { + c.functionsClient, err = functionsv2.NewFunctionClient(ctx, c.clientOpts...) + }) + if err != nil { + return nil, err + } + return c.functionsClient, nil +} + +func (c *GCPClient) GetStorageClient(ctx context.Context) (*storage.Client, error) { + var err error + c.storageClientOnce.Do(func() { + c.storageClient, err = storage.NewClient(ctx, c.clientOpts...) + }) + if err != nil { + return nil, err + } + return c.storageClient, nil +} + +func (c *GCPClient) ProjectID() string { + return c.projectID +} + +func (c *GCPClient) HTTPClient() HTTPClient { + return c.httpClient +} + +// SetHTTPClient allows the user to set a custom HTTP client +// to be used by the GCP client +// this allows for better testing and control over the HTTP client +func (c *GCPClient) SetHTTPClient(httpClient HTTPClient) { + c.httpClient = httpClient +} + +// Close at the main client level is responsible +// for shutting down all the underlying service clients +func (c *GCPClient) Close() []error { + var errorList []error + + if c.functionsClient != nil { + errorList = append(errorList, c.functionsClient.Close()) + } + if c.storageClient != nil { + errorList = append(errorList, c.storageClient.Close()) + } + return errorList +} + +func getProjectID(creds *google.Credentials) (string, error) { + if creds.ProjectID == "" { + return "", fmt.Errorf("project ID not available in the credentials, please specify your project ID in the GCP configuration") + } + return creds.ProjectID, nil +} diff --git a/internal/kubernetes/client/client.go b/internal/kubernetes/client/client.go index 092464dd..47af5b50 100644 --- a/internal/kubernetes/client/client.go +++ b/internal/kubernetes/client/client.go @@ -541,11 +541,13 @@ func (client Client) EvictPod(pod corev1.Pod) error { return nil } -func GetOwnerKind(pod corev1.Pod) (string, error) { +// PodKind returns the type of the pod +// if no owner reference is found, the pod is considered as a standalone pod +func PodKind(pod corev1.Pod) string { if len(pod.OwnerReferences) == 0 { - return "", fmt.Errorf("no owner reference found") + return utils.StandalonePodStr } - return pod.OwnerReferences[0].Kind, nil + return pod.OwnerReferences[0].Kind } func GetOwnerName(pod corev1.Pod) (string, error) { diff --git a/notifiers/slack/slack.go b/notifiers/slack/slack.go index 2af9ec98..03e048e9 100644 --- a/notifiers/slack/slack.go +++ b/notifiers/slack/slack.go @@ -25,11 +25,11 @@ const ( ) const ( - Red string = "#e20b0b" - Green string = "#23ba47" - Grey string = "#a4a8b1" - - ignoredStr string = "ignored" + Red string = "#e20b0b" + Green string = "#23ba47" + Grey string = "#a4a8b1" + threeBackticks = "```" + ignoredStr string = "ignored" ) type Parameters struct { @@ -190,7 +190,7 @@ func newPayload(log utils.LogLine) Payload { } if log.Event != "" { field.Title = "Event" - field.Value = "```" + log.Event + "```" + field.Value = threeBackticks + log.Event + threeBackticks field.Short = false fields = append(fields, field) } diff --git a/outputs/gcs/gcs.go b/outputs/gcs/gcs.go new file mode 100644 index 00000000..863c74b0 --- /dev/null +++ b/outputs/gcs/gcs.go @@ -0,0 +1,174 @@ +package gcs + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/falcosecurity/falco-talon/internal/gcp/client" + "github.com/falcosecurity/falco-talon/internal/models" + "github.com/falcosecurity/falco-talon/internal/rules" + "github.com/falcosecurity/falco-talon/utils" +) + +const ( + Name string = "gcs" + Category string = "gcp" + Description string = "Store on GCP Cloud Storage" + Permissions string = `Required IAM permissions for GCS: +- storage.objects.create +- storage.objects.get +- storage.objects.list +- storage.objects.update` + Example string = `- action: Get logs of the pod + actionner: kubernetes:download + parameters: + tail_lines: 200 + output: + target: gcp:gcs + parameters: + bucket: falco-talon + prefix: files +` +) + +type Parameters struct { + Bucket string `mapstructure:"bucket" validate:"required"` + Prefix string `mapstructure:"prefix" validate:""` +} + +type Output struct{} + +func Register() *Output { + return new(Output) +} + +func (o Output) Init() error { + return client.Init() +} + +func (o Output) Information() models.Information { + return models.Information{ + Name: Name, + FullName: Category + ":" + Name, + Category: Category, + Description: Description, + Permissions: Permissions, + Example: Example, + } +} + +func (o Output) Parameters() models.Parameters { + return Parameters{ + Prefix: "", + Bucket: "", + } +} + +func (o Output) Checks(_ *rules.Output) error { return nil } + +func (o Output) Run(output *rules.Output, data *models.Data) (utils.LogLine, error) { + gcpClient, err := client.GetGCPClient() + if err != nil { + return utils.LogLine{ + Objects: nil, + Error: err.Error(), + Status: utils.FailureStr, + }, err + } + + storageClient, err := gcpClient.GetStorageClient(context.Background()) + if err != nil { + return utils.LogLine{ + Objects: nil, + Error: err.Error(), + Status: utils.FailureStr, + }, err + } + return o.RunWithClient(storageClient, output, data) +} + +func (o Output) CheckParameters(output *rules.Output) error { + var parameters Parameters + + err := utils.DecodeParams(output.GetParameters(), ¶meters) + if err != nil { + return err + } + + err = utils.ValidateStruct(parameters) + if err != nil { + return err + } + + return nil +} + +func (o Output) RunWithClient(client client.GcpGcsAPI, output *rules.Output, data *models.Data) (utils.LogLine, error) { + var parameters Parameters + err := utils.DecodeParams(output.GetParameters(), ¶meters) + if err != nil { + return utils.LogLine{ + Objects: nil, + Error: err.Error(), + Status: utils.FailureStr, + }, err + } + + parameters.Prefix = strings.TrimSuffix(parameters.Prefix, "/") + if parameters.Prefix != "" { + parameters.Prefix += "/" + } + + var key string + switch { + case data.Objects["namespace"] != "" && data.Objects["pod"] != "": + key = fmt.Sprintf("%v_%v_%v_%v", time.Now().Format("2006-01-02T15-04-05Z"), data.Objects["namespace"], data.Objects["pod"], strings.ReplaceAll(data.Name, "/", "_")) + case data.Objects["hostname"] != "": + key = fmt.Sprintf("%v_%v_%v", time.Now().Format("2006-01-02T15-04-05Z"), data.Objects["hostname"], strings.ReplaceAll(data.Name, "/", "_")) + default: + var s string + for i, j := range data.Objects { + if i != "file" { + s += j + "_" + } + } + key = fmt.Sprintf("%v_%v%v", time.Now().Format("2006-01-02T15-04-05Z"), s, strings.ReplaceAll(data.Name, "/", "_")) + } + + objects := map[string]string{ + "file": data.Name, + "bucket": parameters.Bucket, + "prefix": parameters.Prefix, + "key": key, + } + + ctx := context.Background() + + if err := putObject(ctx, client, parameters.Bucket, parameters.Prefix, key, *data); err != nil { + return utils.LogLine{ + Objects: objects, + Error: err.Error(), + Status: utils.FailureStr, + }, err + } + + return utils.LogLine{ + Objects: objects, + Output: fmt.Sprintf("The file '%v' has been uploaded as the key '%v' to the bucket '%v'", data.Name, parameters.Prefix+key, parameters.Bucket), + Status: utils.SuccessStr, + }, nil +} + +func putObject(ctx context.Context, storageClient client.GcpGcsAPI, bucketName, prefix, key string, data models.Data) error { + bucket := storageClient.Bucket(bucketName) + objectName := prefix + key + wc := bucket.Object(objectName).NewWriter(ctx) + defer wc.Close() + + if _, err := wc.Write(data.Bytes); err != nil { + return err + } + return nil +} diff --git a/outputs/outputs.go b/outputs/outputs.go index 5e548897..123ffb3b 100644 --- a/outputs/outputs.go +++ b/outputs/outputs.go @@ -4,6 +4,7 @@ import ( "github.com/falcosecurity/falco-talon/internal/rules" awss3 "github.com/falcosecurity/falco-talon/outputs/aws/s3" "github.com/falcosecurity/falco-talon/outputs/file" + "github.com/falcosecurity/falco-talon/outputs/gcs" minio "github.com/falcosecurity/falco-talon/outputs/minio" "github.com/falcosecurity/falco-talon/internal/models" @@ -36,6 +37,7 @@ func ListDefaultOutputs() *Outputs { file.Register(), minio.Register(), awss3.Register(), + gcs.Register(), ) } diff --git a/rules.yaml b/rules.yaml index 2df9d78b..12637290 100644 --- a/rules.yaml +++ b/rules.yaml @@ -1,5 +1,8 @@ - action: Terminate Pod actionner: kubernetes:terminate + parameters: + grace_period_seconds: 5 + ignore_standalone_pods: true - action: Disable outbound connections actionner: kubernetes:networkpolicy @@ -31,6 +34,14 @@ aws_lambda_alias_or_version: $LATEST aws_lambda_invocation_type: RequestResponse +- action: Invoke GCP function + actionner: gcp:function + additional_contexts: + - aws + parameters: + gcp_function_name: simple-http-function + gcp_function_location: us-central1 + - rule: Suspicious outbound connection description: "Label pods with suspicious outbound connections if not in the kube-system" match: @@ -50,7 +61,7 @@ output_fields: - k8s.ns.name!=kube-system, k8s.ns.name!=falco actions: - - action: Label Pod as Suspicious + - action: Terminate Pod - rule: Test invoke lambda match: @@ -59,6 +70,13 @@ actions: - action: Invoke Lambda function +- rule: Test invoke GCP function + match: + rules: + - Test invoke GCP function + actions: + - action: Invoke GCP function + - rule: Delete unknown namespace match: rules: diff --git a/utils/utils.go b/utils/utils.go index f792d051..184ff789 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -42,9 +42,10 @@ const ( ansiChars string = "[\u001B\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))" - DaemonSetStr = "DaemonSet" - StatefulSetStr = "StatefulSet" - ReplicaSetStr = "ReplicaSet" + DaemonSetStr = "DaemonSet" + StatefulSetStr = "StatefulSet" + ReplicaSetStr = "ReplicaSet" + StandalonePodStr = "StandalonePod" ) type LogLine struct {