Skip to content

Instantly share code, notes, and snippets.

View oreoshake's full-sized avatar
:octocat:
I used to make it easier to develop this site securely

Neil Matatall oreoshake

:octocat:
I used to make it easier to develop this site securely
View GitHub Profile
@oreoshake
oreoshake / gist:f27e3678ddca4d4a8fa9
Last active November 10, 2021 22:15
Splunk query for mixed content in CSP reports
A csp report looks like
{
"csp-report": {
"document-uri": "http://example.org/page.html",
"referrer": "http://evil.example.com/haxor.html",
"blocked-uri": "http://evil.example.com/image.png",
"violated-directive": "default-src 'self'",
"original-policy": "default-src 'self'; report-uri http://example.org/csp-report.cgi"
}
@oreoshake
oreoshake / firefox spec
Created November 12, 2013 16:47
This was meant to be a CSP parser/validator with the ability to explain a policy and a violation report. It has support for the old school firefox headers and the standard header.
policy
= directive (" "? ";" " "? directive?)*
directive
= report_uri_directive / declaritive_directive
report_uri_directive
= "report-uri " host_source? [a-zA-Z/_\-.]*
declaritive_directive
= name:directive_name " " sources:source_list {
var winston = require("winston");
// inline/eval values are only valid in style/script/default blocks
@oreoshake
oreoshake / gist:5298160
Created April 3, 2013 03:12
Invalid CSP headers in the veracode report
chrome
"default-src *;script-src https://*.facebook.com http://*.facebook.com https://*.fbcdn.net http://*.fbcdn.net *.facebook.net *.google-analytics.com *.virtualearth.net *.google.com 127.0.0.1:* *.spotilocal.com:* chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl 'unsafe-inline' 'unsafe-eval' https://*.akamaihd.net http://*.akamaihd.net;style-src * 'unsafe-inline';connect-src https://*.facebook.com http://*.facebook.com https://*.fbcdn.net http://*.fbcdn.net *.facebook.net *.spotilocal.com:* https://*.akamaihd.net ws://*.facebook.com:* http://*.akamaihd.net;",
"default-src 'self' *.evocdn.co.uk *.rackcdn.com *.evocdn.evo.com *.google-analytics.com 'unsafe-eval' 'unsafe-inline'; style-src 'self' *.evocdn.co.uk *.rackcdn.com *.google-analytics.com 'unsafe-eval' 'unsafe-inline'; img-src 'self' *.evocdn.co.uk *.rackcdn.com *.evocdn.evo.com data: *.google-analytics.com https://c906980.ssl.cf3.rackcdn.com 'unsafe-eval' 'unsafe-inline'; frame-src 'self' 'unsafe-eval' 'unsafe-inline'; script-src 'self' eval-sc
@oreoshake
oreoshake / gist:5281050
Last active December 15, 2015 15:19
Woke up, saw a javascript parser generator, wrote this
w3:
policy
= directive (" "? ";" " "? directive?)*
directive
= report_uri_directive / declaritive_directive
report_uri_directive
= "report-uri " host_source? [a-zA-Z/_-]*
declaritive_directive
= name:directive_name " " sources:source_list {
@oreoshake
oreoshake / gist:5138970
Last active December 14, 2015 19:48
hash of arrays, never again
1.9.3-p327 :002 > a = {:b => [3,4,5]}
=> {:b=>[3, 4, 5]}
1.9.3-p327 :003 > b = a.dup
=> {:b=>[3, 4, 5]}
1.9.3-p327 :004 > b[:b] << 'asdf'
=> [3, 4, 5, "asdf"]
1.9.3-p327 :005 > a
=> {:b=>[3, 4, 5, "asdf"]}
1.9.3-p327 :006 > b
=> {:b=>[3, 4, 5, "asdf"]}
@oreoshake
oreoshake / pull_31.rb
Last active December 13, 2015 18:28
pull_31.rb
require 'rubygems'
require 'ruby-debug'
class A
def self.read
if @thing
@thing
elsif superclass.respond_to?(:read)
superclass.thing
else
@oreoshake
oreoshake / gist:1629462
Created January 17, 2012 22:36
what does it all mean!
$ git clone [email protected]:privaterepo/app.git
Cloning into app...
remote: Counting objects: 86868, done.
remote: Compressing objects: 100% (20049/20049), done.
fatal: write error: Result too large), 23.94 MiB | 41 KiB/s
fatal: write error: Broken pipe
fatal: index-pack failed
@oreoshake
oreoshake / gist:1604252
Created January 13, 2012 02:11
guard-brakeman usage
# Gemfile
gem 'guard-brakeman'
# Guardfile:
guard 'brakeman' do
watch(%r{^app/.+\.(erb|haml|rhtml|rb)$})
watch(%r{^config/.+\.rb$})
watch(%r{^lib/.+\.rb$})
watch('Gemfile')
end
require 'rubygems'
require 'parallel'
require 'benchmark'
# require 'jruby-prof'
############ TEH SETUPZ #############
threads = Parallel.processor_count
n = ARGV[0].to_i
s = (0...10).map{ ('a'..'z').to_a[rand(26)] }.join * n
Indian
it says there is no text currenlty
1:36
curryhousebot
i am able to get to the docs
1:36
Indian
the first link