Skip to content

Instantly share code, notes, and snippets.

View fredleger's full-sized avatar
🏠
Working from home

Frederic Leger fredleger

🏠
Working from home
View GitHub Profile
@fredleger
fredleger / falco-snip.yaml
Created February 15, 2022 23:57
falco custom rule exemple
customRules:
my-rules.yaml: |-
- macro: greetings
condition: >
proc.name = cowsay
- rule: Try to say use cowsay in Container
desc: Detect use of greetings command in container
condition: >
spawned_process and
container and
#!/bin/bash
# infos:
# https://github.com/helm/helm/blob/3a3e3846ca9c929a6966583b461181e70f19bc13/internal/resolver/resolver.go#L215
# https://github.com/helm/helm/blob/983d5c26f805cc5cc29d3c27e8749e140f85b940/internal/resolver/resolver_test.go#L184
# req: '{Name: "alpine", Version: 0.1.0, Repository: "http://localhost:8879/charts"}'
# lock: '{Name: "alpine", Version: 0.1.0, Repository: "http://localhost:8879/charts"}'
# function: data, err := json.Marshal([2][]*chart.Dependency{req, lock})
#!/bin/bash
# Variables
NAMESPACE=$1 # The target namespace (passed as the first argument)
SECRET_NAME=$2 # The imagePullSecret to remove (passed as the second argument)
BACKUP_DIR="sa_backup" # Base directory to store backups
DRY_RUN=$3 # Enable dry-run mode (passed as the third argument: "dry-run")
# Function to check prerequisites
function check_prerequisites() {