Skip to content

Commit

Permalink
update deps + fix all linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Labarussias <[email protected]>
  • Loading branch information
Issif committed Mar 27, 2024
1 parent 6daae13 commit 3caadd2
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 108 deletions.
2 changes: 1 addition & 1 deletion actionners/actionners.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package actionners
import (
"encoding/json"
"fmt"

lambdaInvoke "github.com/Falco-Talon/falco-talon/actionners/aws/lambda"

calicoNetworkpolicy "github.com/Falco-Talon/falco-talon/actionners/calico/networkpolicy"
Expand Down Expand Up @@ -173,7 +174,6 @@ func Init() error {
for _, j := range i.Actions {
categories[j.GetActionnerCategory()] = true
}

}

for category := range categories {
Expand Down
12 changes: 6 additions & 6 deletions actionners/aws/lambda/lambda.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ import (
"encoding/json"
"net/http"

"github.com/aws/aws-sdk-go-v2/service/lambda"
"github.com/aws/aws-sdk-go-v2/service/lambda/types"

"github.com/Falco-Talon/falco-talon/internal/aws/client"
"github.com/Falco-Talon/falco-talon/internal/events"
"github.com/Falco-Talon/falco-talon/internal/rules"
"github.com/Falco-Talon/falco-talon/utils"
"github.com/aws/aws-sdk-go-v2/service/lambda"
"github.com/aws/aws-sdk-go-v2/service/lambda/types"
)

type LambdaConfig struct {
type Config struct {
AWSLambdaName string `mapstructure:"aws_lambda_name" validate:"required"`
AWSLambdaAliasOrVersion string `mapstructure:"aws_lambda_alias_or_version" validate:"omitempty"`
AWSLambdaInvocationType string `mapstructure:"aws_lambda_invocation_type" validate:"omitempty,oneof=RequestResponse Event DryRun"`
}

func Action(action *rules.Action, event *events.Event) (utils.LogLine, error) {

lambdaClient := client.GetAWSClient().GetLambdaClient()
parameters := action.GetParameters()

var lambdaConfig LambdaConfig
var lambdaConfig Config
err := utils.DecodeParams(parameters, &lambdaConfig)
if err != nil {
return utils.LogLine{
Expand Down Expand Up @@ -83,7 +83,7 @@ func Action(action *rules.Action, event *events.Event) (utils.LogLine, error) {
func CheckParameters(action *rules.Action) error {
parameters := action.GetParameters()

var config LambdaConfig
var config Config
err := utils.DecodeParams(parameters, &config)
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ const (

type Configuration struct {
Notifiers map[string]map[string]interface{} `mapstructure:"notifiers"`
AwsConfig AwsConfig `mapstructure:"aws"`
LogFormat string `mapstructure:"log_format"`
KubeConfig string `mapstructure:"kubeconfig"`
ListenAddress string `mapstructure:"listen_address"`
RulesFiles []string `mapstructure:"rules_files"`
DefaultNotifiers []string `mapstructure:"default_notifiers"`
ListenPort int `mapstructure:"listen_port"`
DeduplicationTimeWindowSeconds int `mapstructure:"deduplication_time_window_seconds"`
WatchRules bool `mapstructure:"watch_rules"`
PrintAllEvents bool `mapstructure:"print_all_events"`
DeduplicationLeaderLease bool `mapstructure:"deduplication_leader_lease"`
DeduplicationTimeWindowSeconds int `mapstructure:"deduplication_time_window_seconds"`
AwsConfig AwsConfig `mapstructure:"aws"`
}

var config *Configuration
Expand Down Expand Up @@ -90,5 +90,5 @@ type AwsConfig struct {
AccessKey string `mapstructure:"access_key"`
SecretKey string `mapstructure:"secret_key"`
RoleArn string `mapstructure:"role_arn"`
ExternalId string `mapstructure:"external_id"`
ExternalID string `mapstructure:"external_id"`
}
48 changes: 24 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ go 1.21.3
toolchain go1.22.0

require (
github.com/aws/aws-sdk-go-v2 v1.25.2
github.com/aws/aws-sdk-go-v2/config v1.27.6
github.com/aws/aws-sdk-go-v2/service/lambda v1.53.1
github.com/aws/aws-sdk-go-v2 v1.26.0
github.com/aws/aws-sdk-go-v2/config v1.27.9
github.com/aws/aws-sdk-go-v2/credentials v1.17.9
github.com/aws/aws-sdk-go-v2/service/lambda v1.53.3
github.com/aws/aws-sdk-go-v2/service/sts v1.28.5
github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43
github.com/emersion/go-smtp v0.20.2
github.com/fsnotify/fsnotify v1.7.0
github.com/go-playground/validator/v10 v10.19.0
github.com/google/uuid v1.6.0
github.com/jinzhu/copier v0.4.0
github.com/magefile/mage v1.15.0
Expand Down Expand Up @@ -38,30 +41,27 @@ require (

require (
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.6 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.28.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.20.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3 // indirect
github.com/aws/smithy-go v1.20.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.3 // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.9 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.19.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
Expand Down Expand Up @@ -89,10 +89,10 @@ require (
github.com/nats-io/jwt/v2 v2.5.5 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.49.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/common v0.51.1 // indirect
github.com/prometheus/procfs v0.13.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
Expand All @@ -103,9 +103,9 @@ require (
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
Expand All @@ -114,8 +114,8 @@ require (
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 // indirect
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down
Loading

0 comments on commit 3caadd2

Please sign in to comment.