Skip to content

Instantly share code, notes, and snippets.

View developer-guy's full-sized avatar
🐾
Every artifact can be verifiably traced to Source Code and Hardware

Batuhan Apaydın developer-guy

🐾
Every artifact can be verifiably traced to Source Code and Hardware
View GitHub Profile
version: "3.7"
services:
envoy:
build: ./compose/envoy
ports:
- "8080:80"
volumes:
- ./envoy.yaml:/config/envoy.yaml
environment:
- DEBUG_LEVEL=info
@developer-guy
developer-guy / test-dockerfile-with-conftest.sh
Created November 25, 2020 09:05
test Dockerfile with conftest
#!/usr/bin/env bash
set -e
cat << EOF > Dockerfile
FROM kalilinux/kali-linux-docker:latest
ENTRYPOINT ["echo"]
EOF
cat <<< EOF > test.rego
@developer-guy
developer-guy / cross-compile-go-app-with-buildx.sh
Last active November 25, 2020 10:22
cross-compile-go-app-with-buildx
#!/usr/bin/env bash
set -e
WORKDIR=$(mktemp -d)
cd $WORKDIR
cat << EOF > $WORKDIR/main.go
package main
@developer-guy
developer-guy / noprivilegedconstrainttemplate.yaml
Last active November 25, 2020 17:03
OPA Gatekeeper Restrict Privileged Containers within Deployment
apiVersion: templates.gatekeeper.sh/v1beta1
kind: ConstraintTemplate
metadata:
name: noprivileged
spec:
crd:
spec:
names:
kind: NoPrivileged
listKind: NoPrivilegedList
@developer-guy
developer-guy / test-falco.sh
Last active November 26, 2020 11:37
Falco - Container Runtime Security Hands On
#!/usr/bin/env bash
set -e
# install helm if executable is not found on host
if ! command -v helm &> /dev/null
then
wget https://get.helm.sh/helm-v3.3.4-linux-amd64.tar.gz
tar -xvf helm-v3.3.4-linux-amd64.tar.gz
chmod +x linux-amd64/helm
mv linux-amd64/helm /usr/local/bin/
@developer-guy
developer-guy / opa-gatekeeper-allowed-repos.yaml
Created November 26, 2020 08:44
OPA Gatekeeper Allowed Repos
apiVersion: templates.gatekeeper.sh/v1beta1
kind: ConstraintTemplate
metadata:
name: k8sallowedrepos
spec:
crd:
spec:
names:
kind: K8sAllowedRepos
validation:
@developer-guy
developer-guy / 01-hello-world.yml
Created November 27, 2020 07:44 — forked from weibeld/01-hello-world.yml
GitHub Actions example workflow 1 — Hello World!
name: hello-world
on: push
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: my-step
run: echo "Hello World!"
@developer-guy
developer-guy / 02-issue-greeter.yml
Created November 27, 2020 07:50 — forked from weibeld/02-issue-greeter.yml
GitHub Actions example workflow 2 — Issue Greeter
name: issue-greeter
on:
issues:
types: [opened]
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: my-step
env:
@developer-guy
developer-guy / capture-sensivite-information.go
Last active November 30, 2020 12:47
Capturing Sensitive Information from input by editor
package main
import (
"io/ioutil"
"os"
"os/exec"
"fmt"
)
// DefaultEditor is vim because we're adults ;)
@developer-guy
developer-guy / getPassword.go
Created November 30, 2020 12:53 — forked from jlinoff/getPassword.go
Go code to prompt for password using only standard packages by utilizing syscall.ForkExec() and syscall.Wait4(), recovers from ^C gracefully.
// License: MIT Open Source
// Copyright (c) Joe Linoff 2016
// Go code to prompt for password using only standard packages by utilizing syscall.ForkExec() and syscall.Wait4().
// Correctly resets terminal echo after ^C interrupts.
package main
import (
"bufio"
"fmt"
"os"