Category Uncategorized

Extracting IP Addresses in Bash

One very handy function to have in your .bash_profile is a function to extract IP addresses. ipextract function I frequently use this function during investigations and though I should share it with everyone. ipextract () { # example ipextract <…

Export flow logs to an Amazon S3 Bucket

I found the instructions on Amazon’s website to be useless. This is what worked for me Define some variables bucket=my-bucket region=us-east-1 log-group-name=primary-nat prefix=my-prefix taskname=my-task start-epoch=1516255200000 end-epoch=1516860000000 Create the bucket aws s3 mb s3://$bucket –region $region Create the Policy cat <<‘EOF’…

IIS7 SNI Rewrite – Howto

Problem Windows XP Users with IE8 are unable to connect to your Server Name Indication (SNI) enabled Amazon CloudFront distribution. Solution Do not rewrite URLs to CloudFront if the user agent indicates a system that does not support SNI. Example…

iis7 insert rewrite rule web.config

To insert a rewrite rule in to a web.config for deployment purposes you need to modify Web.Release.Config Example <system.webServer> <rewrite xdt:Transform=”Insert”> <outboundRules> <rule name=”Add Cross Origin Access”> <match serverVariable=”RESPONSE_Access_Control_Allow_Origin” pattern=”.*” /> <conditions> <add input=”{REQUEST_URI}” pattern=”.*\.(ttf|otf|eot|woff|svg)\?*.*$” /> </conditions> <action type=”Rewrite” value=”*”/>…

Cloudfront IIS7 CORS Fix

Problem You keep getting Control Allow Origin errors on fonts that are pulling from your CloudFront CDN Solution You need to make changes at CloudFront and your IIS 7 Server CloudFront Changes Modify the origin behaviors: Navigate to the CloudFront…