Skip to content

Instantly share code, notes, and snippets.

View maxgio92's full-sized avatar

maxgio92 maxgio92

View GitHub Profile
@maxgio92
maxgio92 / Pod.yaml
Created January 31, 2020 15:39
PodNoServiceAccountTokenMount
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
serviceAccountName: build-robot
automountServiceAccountToken: false
@maxgio92
maxgio92 / pod.yaml
Last active February 14, 2020 10:20
Pod with RO root FS
apiVersion: v1
kind: Pod
metadata:
name: my-secure-pod
spec:
containers:
# ...
securityContext:
readOnlyRootFilesystem: true
# ...
@maxgio92
maxgio92 / psp.yaml
Created February 8, 2020 14:44
Pod Security Policy for RO root FS
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: my-psp-ro-rootfs
# ...
spec:
# ...
readOnlyRootFilesystem: false
# ...
@maxgio92
maxgio92 / psp2.yaml
Last active February 14, 2020 10:20
Pod Security Policy for allowed host paths
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: my-psp-hostpaths
# ...
spec:
# ...
allowedHostPaths:
- pathPrefix: "/example"
readOnly: true
@maxgio92
maxgio92 / gce-audit-policy.yaml
Created February 23, 2020 15:31
GCE Audit Policy
apiVersion: audit.k8s.io/v1
kind: Policy
rules:
# The following requests were manually identified as high-volume and low-risk,
# so drop them.
- level: None
users: ["system:kube-proxy"]
verbs: ["watch"]
resources:
- group: "" # core
@maxgio92
maxgio92 / falco-k8s-audit-webhook-backend-kubeconfig.yaml
Created February 23, 2020 17:15
Falco Kubernetes Audit webhook backend kubeconfig
apiVersion: v1
kind: Config
clusters:
- cluster:
server: http://<ip_of_falco>:8765/k8s_audit
name: falco
contexts:
- context:
cluster: falco
user: ""
apiVersion: apiserver.config.k8s.io/v1
kind: EncryptionConfiguration
resources:
- resources:
- secrets
providers:
- aescbc:
keys:
- name: key1
secret: <BASE 64 ENCODED SECRET>
#!/bin/sh
# Get Arch Linux rootfs
mkdir rootfs && \
docker export \
$(docker create archlinux:latest) \
> archlinux-rootfs.x86_64.tar
mv archlinux-rootfs.x86_64.tar /mount/c/Users/myuser/archlinux-rootfs.x86_64.tar
# Import Arch Linux rootfs on a new WSL instance (on Windows)

Keybase proof

I hereby claim:

  • I am maxgio92 on github.
  • I am maxgio (https://keybase.io/maxgio) on keybase.
  • I have a public key ASB2cXvOUeybccGKDoNQ0It1Bp2ZGLfiov-KPtojlOCxmQo

To claim this, I am signing this object: