Skip to content

Instantly share code, notes, and snippets.

@skuenzli
skuenzli / book-list.md
Last active February 21, 2023 23:57
Stephen's startup book list

This is a list of books that helped me the most in the early stages of k9 Security (which is still in early stages).

It's the list I wish I had when starting out.

Background

I'm a technical founder with 20+ years experience as an engineer, architect, and independent consultant. I've also written 2 technical books and +125 blog posts.

Building solutions is easy.

But building a company that solves problems people are willing to pay for is hard.

@skuenzli
skuenzli / k9diff
Last active April 20, 2021 20:33
Prototype - k9 AWS IAM access summary diff tool
#!/opt/local/bin/bash
#set -x
set -e
report_name=$1
acct=$2
date_1=$3
date_2=$4
# find summaries with a command like
@skuenzli
skuenzli / example.simulate-bucket-policy.json
Last active June 26, 2021 18:21
Bucket Policy for IAM Policy Simulator Tutorial
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyInsecureCommunications",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::<bucket-name>",
@skuenzli
skuenzli / example-DenyUnencryptedStorage-statement.json
Last active September 21, 2023 04:28
Secure S3 Bucket Resource Policy Examples
{
"Sid": "DenyUnencryptedStorage",
"Effect": "Deny",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::sensitive-app-data/*",
"Principal": {
"AWS": "*"
},
"Condition": {
"Null": {
@skuenzli
skuenzli / default-cmk.key-policy.json
Last active September 30, 2020 17:15
KMS Resource Policy Examples
{
"Version": "2012-10-17",
"Id": "DefaultKeyPolicy",
"Statement": [
{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::12345678910:root"
},
@skuenzli
skuenzli / create-least-priv-bucket-policy.tf
Last active May 22, 2020 16:34
Potential Terraform module interface for declaring a least privilege S3 bucket policy
# Engineers write this
locals {
administrator_arns = [
"arn:aws:iam::12345678910:user/ci"
, "arn:aws:iam::12345678910:user/person1"
]
read_data_arns = [
"arn:aws:iam::12345678910:user/person1",
"arn:aws:iam::12345678910:role/appA",
@skuenzli
skuenzli / create-and-use-echo-service.sh
Last active February 5, 2019 23:06
Simple Echo Service on Docker Swram
# Create an 'echo' service on a Swarm that replies back whatever you send it
docker service create --name echo --publish '8000:8' busybox:1.29 nc -v -lk -p 8 -e /bin/cat
# talk to the service, assuming you're on a Swarm node; change localhost to a Swarm node hostname if remote
echo "hello netcat my old friend..." | nc localhost -w 3 8000
echo "i've come to test connection behavior again." | nc localhost -w 3 8000
variable "name" {
type = "string"
}
variable "vpc_id" {
type = "string"
default = "vpc-58a29221"
}
variable "region" {
@skuenzli
skuenzli / crashy.md
Last active January 4, 2018 15:37
Generate core files for crashed processes in containers

Overview

This is a simple demonstration of generating core files for crashing processes that happen to be containerized to a known location on CentOS 7.

Terminal 1 - Configure System and Run Process

Configure Linux kernel with a core pattern that puts files at a well-known location.

The location will be interpreted from the crashing process' perspective of file paths [1]

@skuenzli
skuenzli / peek-inside-one-modern-infra-dev-env.md
Last active August 10, 2017 15:18
Talk: Peek inside (one) modern infra development environment

Developing infrastructure code is challenging: quickly-changing tools, ever-higher quality expectations, and fluid teams.

What would life be like if your team had a containerized infra development environment supporting the development process by standardizing the tooling to build, test, and deploy infra code through the stages of the development lifecycle?

We will demonstrate and explore a simple open source project providing a portable infra development environment using Terraform, kitchen-terraform, and rspec. Patterns will be universal.

This talk will dive deeper into the 'Packaged Environment' pattern described at: https://www.qualimente.com/2017/01/17/simple-ways-to-start-using-docker/#Pattern_Packaged_Environment