Skip to content

Instantly share code, notes, and snippets.

View rhenning's full-sized avatar
👻

Richard Henning rhenning

👻
View GitHub Profile
@rhenning
rhenning / ee_notes.md
Last active September 22, 2017 22:32
EE notes
@rhenning
rhenning / equifax2017.md
Created September 14, 2017 12:29
Equifax 2017 Security Compromise Notes

Equifax Credit Reporting Agency Compromise of 2017

Overview

Credit histories of 143 million Americans were stolen from Equifax by hackers in May 2017 due to compromise of an unpatched Apache Struts software vulnerability (CVE-2017-5638). Equifax disclosed the breach in early September 2017.

@rhenning
rhenning / phoenix_project_notes.md
Last active January 10, 2022 14:17
Notes from The Phoenix Project

The Phoenix Project

Chapters 1-5

  • Bill goes out of his way during his conversation with Dick to understand the real business impact of the payroll outage.
  • IT Operations is frequently viewed as a business cost/liability rather than a valued asset, as evidenced by language used to discuss infrastructure. Steve says "IT ... should be like the toilet ... I don't ever
@rhenning
rhenning / djb2.rb
Created December 1, 2016 02:26
djb2 string to integer hash algorithm
i = 5381
k = 33
out = ARGF.read.each_char.inject(i) do |h, c|
h * k + c.ord
end
puts out
@rhenning
rhenning / phillydevops20161129.md
Last active November 30, 2016 15:01
Philly DevOps Notes 2016-11-29
@rhenning
rhenning / maxcdn_cidr_ck.rb
Created July 20, 2016 19:15
Check for an address in MaxCDN's address space
require 'netaddr'
require 'open-uri'
MAXCDN_IPS =
open('https://www.maxcdn.com/one/assets/ips.txt').map(&:chomp).map do |range|
NetAddr::CIDR.create(range).enumerate
end.flatten
puts MAXCDN_IPS.include?(ARGV.first)
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKS2e39w/BrCkcxlpnTpiKY7jmHxMIpxHUp9LJByfznPmdd9Nm/LGsFqE0QvECACNE55N4hFDmm/xU9TofjPbT6D8swh20o1WijNf6qNdxfC2zLyKUaUzECzgba4pm1T7uzCUADI/+aiEEo52Hdz1gVV68dn3XIB8+Jycq4mAXcHAWr9ca2JrcUBAO/mQee54Y/a83kragbEz1HLfCepomZPqoBflqdKep3IaV2ayel3KP7uN0QquAejbiaM0Ry45PGbLw7DRva4yiZqGvlsAPokCfFkrHM52rkVteiouer85HTFcH6DIkNQsBCI5/OqNkrTuVJ8u8bbqdHk5RlgYn rhenning2
@rhenning
rhenning / csr2crt.rb
Created April 13, 2016 20:23
Ruby CSR2CRT test CA signer with CN/SAN rewriting (ala some CAs)
require 'r509'
csr = R509::CSR.new(csr: File.read(ARGV[0]))
ca_csr = R509::CSR.new(
subject: {
CN: 'www.weblinc.com',
O: 'WebLinc Corp',
C: 'US',
ST: 'Pennsylvania',
@rhenning
rhenning / AWS-ReInvent2015-SEC307-NOTES.md
Last active April 8, 2016 00:53
re:Invent 2015 SEC307 AWS IAM Federation notes

https://www.youtube.com/watch?v=-XARG9W2bGc

  • SAML federation at scale
    • Automate onboarding
      • Allow a cross-account trust to create SAML providers w/ MFA from master/payer acct (15:47)
        • This allows bootstrapping new accounts by a small group of admins w/ real IAM accts or root acct
      • automate integrating each subaccount's SAML ID provider
      • automate deployment of subaccount IAM role & policies
      • automate deployment of central directory groups/structure
  • keep role definitions consistent across subaccounts
@rhenning
rhenning / flathash.rb
Created April 6, 2016 01:23
naive nested ruby hash flattener
class FlatHash
def self.flatten_hval(pre, val)
out = {}
val.each do |k, v|
out["#{pre}_#{k}"] = v
end
flatten(out)
end
def self.flatten_aval(pre, val)