

{"id":12083,"date":"2019-03-14T10:02:17","date_gmt":"2019-03-14T15:02:17","guid":{"rendered":"https:\/\/rud.is\/b\/?p=12083"},"modified":"2019-03-14T10:02:17","modified_gmt":"2019-03-14T15:02:17","slug":"collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/","title":{"rendered":"Collecting Content Security Policy Violation Reports in S3 (&#8216;Effortlessly&#8217;\/&#8217;Freely&#8217;)"},"content":{"rendered":"<p>In the <a href=\"https:\/\/rud.is\/b\/2019\/03\/10\/wrangling-content-security-policies-in-r\/\">previous post<\/a> I tried to explain what Content Security Policies (CSPs) are and how to work with them in R. In case you didn&#8217;t RTFPost the TLDR is that CSPs give <em>you<\/em> control over what can be loaded along with your web content and can optionally be configured to generate a violation report for any attempt to violate the policy you create. While you don&#8217;t <em>need<\/em> to specify a report URI you really should since at the very least you&#8217;ll know if you errantly missed a given host, wildcard, or path. You&#8217;ll also know when there&#8217;s been malicious or just plain skeezy activity going on with third-parties and your content (which is part of the whole point of CSPs).<\/p>\n<p>There&#8217;s an &#8220;R&#8221; category tag on this post (so it&#8217;s hitting R-bloggers, et al) since it&#8217;s part of an unnumbered series on working with CSPs in R and the <em>next<\/em> posts will show how to analyze the JSON-formatted reports that are generated. But, to analyze such reports you <em>kinda need a way to get them<\/em> first. So, we&#8217;re going to setup a &#8220;serverless&#8221; workflow in Amazon AWS to shove CSP reports into a well-organized structure in S3 from which we&#8217;ll be able to access, ingest, and analyze them.<\/p>\n<p>Sure, there are services out there who will (legit for free) let you forward violation reports to them but if you can do this for &#8220;free&#8221; on your own and not give data out to a third-party to make money or ostensibly do-gooder reputation from I can&#8217;t fathom an argument for just giving up control.<\/p>\n<p>Note that all you <em>need<\/em> is an an internet-accessible HTTPS endpoint that can take an HTTP POST request with a JSON payload and then store that somewhere, so if you want to, say, use the <code>plumber<\/code> package to handle these requests without resorting to AWS, then by all means do so! (And, blog about it!)<\/p>\n<h3>AWS &#8220;Serverless&#8221; CSP Report Workflow Prerequisites<\/h3>\n<p>You&#8217;re obviously going to need an Amazon AWS account and will also need the <a href=\"https:\/\/aws.amazon.com\/cli\/\">AWS Command Line Interface<\/a> tools installed plus an IAM user that has permissions to use <a href=\"https:\/\/aws.amazon.com\/cloudformation\/\">CloudFormation<\/a>. AWS has been around <em>a while<\/em> now so yet-another-howto on signing up for AWS, installing the CLI tools and <a href=\"https:\/\/docs.aws.amazon.com\/IAM\/latest\/UserGuide\/id_users_create.html\">generating an IAM user<\/a> would be, at-best, redundant. <a href=\"https:\/\/aws.amazon.com\/getting-started\/\">Amazon has decent intro resources<\/a> and, honestly, it&#8217;s 2019 and having some familiarity with how to work with at least one cloud provider is pretty much a necessary skillset at this point depending on what part of &#8220;tech&#8221; you&#8217;re in. If you&#8217;re new to AWS then follow the links in this paragraph, run through some basics and jump back to enter the <em>four<\/em> commands you&#8217;ll need to run to bootstrap your CSP collection setup.<\/p>\n<h3>Bootstrapping an S3 CSP Collector in AWS<\/h3>\n<p>We&#8217;re going to use <a href=\"https:\/\/github.com\/michaelbanfield\/serverless-csp-report-to\">this CloudFormation workflow<\/a> to bootstrap the CSP collection process and you should skim the <a href=\"https:\/\/github.com\/michaelbanfield\/serverless-csp-report-to\/blob\/master\/template.yaml\">yaml file<\/a> to see what&#8217;s going on. Said yaml is &#8220;infrastructure as code&#8221;, meaning it&#8217;s a series of configuration directives to generate AWS services for you (i.e. no pointing-and-clicking) and, perhaps more importantly, destroy them for you if you no longer want to keep this active.<\/p>\n<p>The <a href=\"https:\/\/github.com\/michaelbanfield\/serverless-csp-report-to\/blob\/master\/template.yaml#L4-L14\">CF Output directive<\/a> will be the URI you&#8217;re going to use in the <code>report-uri<\/code>\/<code>report-to<\/code> CSP directives and is something we&#8217;ll be querying for at the end of the setup process.<\/p>\n<p>The first <a href=\"https:\/\/github.com\/michaelbanfield\/serverless-csp-report-to\/blob\/master\/template.yaml#L4-L14\">set of resources<\/a> are <a href=\"https:\/\/aws.amazon.com\/glue\/\">AWS Glue<\/a> templates which would enable wiring up the CSP report results into <a href=\"https:\/\/aws.amazon.com\/athena\/\">AWS Athena<\/a>. Glue is a nice ETL framework but it&#8217;s kinda expensive if set in active mode (Amazon calls it &#8216;crawler&#8217; mode) so this CloudFormation recipe only created the Glue template but does not activate it. This section can (as the repo author notes) be deleted but it does no harm and costs nothing extra so leaving it in is fine as well.<\/p>\n<p>The <a href=\"https:\/\/github.com\/michaelbanfield\/serverless-csp-report-to\/blob\/master\/template.yaml#L64-L127\">next bit<\/a> sets up an <a href=\"https:\/\/aws.amazon.com\/kinesis\/data-firehose\/\">AWS Firehose<\/a> configuration which is a silly sounding name for setting up a workflow for where to store &#8220;streaming&#8221; data. This &#8220;firehose&#8221; config is just going to setup a path for an S3 bucket and then setup the necessary permissions associated with said bucket. <strong>This is where we&#8217;re going to pull data from in the next post.<\/strong><\/p>\n<p>The aforementioned &#8220;firehose&#8221; can take streaming data from all kinds of input sources and our data source is going to be a POSTed JSON HTTP interaction from a browser so we need to have something that listens for these POST requests and wire that up to the &#8220;firehose&#8221;. For that we need an <a href=\"https:\/\/aws.amazon.com\/api-gateway\/\">API gateway<\/a> and that&#8217;s what the <a href=\"https:\/\/github.com\/michaelbanfield\/serverless-csp-report-to\/blob\/master\/template.yaml#L128-L198\">penultimate section<\/a> sets up for us. It instructs AWS to setup an API endpoint to listen for POST requests, tells it the data type (JSON) it will be handling and then tells it what <a href=\"https:\/\/aws.amazon.com\/lambda\/\">AWS Lambda<\/a> to call, which is in <a href=\"https:\/\/github.com\/michaelbanfield\/serverless-csp-report-to\/blob\/master\/template.yaml#L199-L213\">the last section<\/a>.<\/p>\n<p>Said lambda code is in the repo&#8217;s <a href=\"https:\/\/github.com\/michaelbanfield\/serverless-csp-report-to\/blob\/master\/index.js\">index.js<\/a> and is a short Node.js script to post-process the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Security-Policy-Report-Only#Sample_violation_report\">CSP report JSON<\/a> into something slightly more usable in a data analysis context (the folks who made the violation report clearly did not have data science folks in mind when creating the structure given the liberal use if <code>-<\/code> in field names).<\/p>\n<p><strong>If the above sounds super-complex just go get CSP reports, you&#8217;re not-wrong.<\/strong> We trade off the cost and tedium of self-hosting and securing a standalone-yet-simple JSON POST handling server for a moderately complex workflow that involves multiple types of moving parts in AWS. The downside is having to gain a more than casual familiarity with AWS components. The plus side is that this is pretty much free unless your site is wildly popular and either constantly under XSS attack or your CSP policy is woefully misconfigured.<\/p>\n<p><em>&#8220;&#8216;Free&#8217;, you say?!&#8221;<\/em> Yep. Free. (OK, &#8220;mostly&#8221; free)<\/p>\n<ul>\n<li><strong>AWS API Gateway<\/strong>: 1,000,000 HTTP REST API calls (our POST reqs that call the lambda code) per month are free<\/li>\n<li><strong>AWS Lambda<\/strong> (the <code>index.js<\/code> runner which sends data to the &#8220;firehose&#8221;): 1,000,000 free requests per month and 400,000 seconds of compute time per month (the <code>index.js<\/code> takes ~1s to run)<\/li>\n<li><strong>AWS Firehose<\/strong> (the bit that shoves data into S3): first 500 TB\/month is $0.029 USD<\/li>\n<li><strong>AWS S3<\/strong>: First 50 TB \/ month is $0.023 per GB (the CSP JSON POSTs gzip&#8217;d are usually &lt;1K each) + some super-fractional (of a penny) costs for PUTting data into S3 and copying data from S3.<\/li>\n<\/ul>\n<p>A well-crafted CSP and a typical site should end up costing you way less than $1.00 USD\/month and you can monitor it all via the <a href=\"https:\/\/console.aws.amazon.com\/billing\/home?region=us-east-1#\/freetier\">console<\/a> or <a href=\"https:\/\/docs.aws.amazon.com\/awsaccountbilling\/latest\/aboutv2\/tracking-free-tier-usage.html\">with alerts<\/a> (change your region, if needed). Plus, you can destroy it at any time with one command (we haven&#8217;t built it yet so we&#8217;ll see this in a bit).<\/p>\n<h3>Launching the Bootstrap<\/h3>\n<p>As the repo says, do:<\/p>\n<pre><code class=\"language-bash\">$ git clone git@github.com:michaelbanfield\/serverless-csp-report-to.git # get the repo\n$ cd serverless-csp-report-to # go to the dir\n$ aws s3 mb s3:\/\/some-unique-and-decent-bucket-name-to-hold-the-lambda-code\/ # pick a good name that you'll recognize\n$ aws cloudformation package \\ # generate the build template\n    --template-file template.yaml \\\n    --s3-bucket &lt;bucket-you-just-created&gt; \\\n    --output-template-file packaged-template.yaml\n\n$ aws cloudformation deploy \\ # launch the build\n    --template-file \/path\/to\/packaged-template.yaml \\\n    --stack-name CSPReporter \\\n    --capabilities CAPABILITY_IAM\n<\/code><\/pre>\n<p>It&#8217;ll take a minute or two and when it is done just do:<\/p>\n<pre><code class=\"language-plain\">$ aws cloudformation describe-stacks \\ \n    --query \"Stacks[0].Outputs[0].OutputValue\" \\\n    --output text \\\n    --stack-name CSPReporter\n<\/code><\/pre>\n<p>To get the URL you&#8217;ll use in the reporting directives.<\/p>\n<p>To get rid of all these created resources you can <a href=\"https:\/\/docs.aws.amazon.com\/AWSCloudFormation\/latest\/UserGuide\/cfn-console-delete-stack.html\">go into the console and do it<\/a> <em>or<\/em> just do<\/p>\n<pre><code class=\"language-plain\">$ aws cloudformation --delete-stack --stack-name CSPReporter\n<\/code><\/pre>\n<p>To see the bucket that was created for the CSP reports just do:<\/p>\n<pre><code class=\"language-plain\">$ aws s3 ls | grep firehose\n<\/code><\/pre>\n<h3>FIN<\/h3>\n<p>If you&#8217;re experienced with AWS that was likely not a big deal. If you&#8217;re new or inexperienced with AWS this is not a bad way to get some experience with a &#8220;serverless&#8221; API setup since it&#8217;s cheap, easy to delete and touches on a number of key components within AWS.<\/p>\n<p>You can browse through the AWS console to see all of what was created and eventually tweak the CF yaml to bend it to your own will.<\/p>\n<p>Next time we&#8217;ll dive in to CSP violation report analysis with R.<\/p>\n<p><strong>REMINDER<\/strong> to &mdash; regardless of the source (whether it&#8217;s me, RStudio, spiffy R package authors, or big names like AWS\/Microsoft\/etc.) &mdash; <em>always<\/em> at least spot check the code you&#8217;re about to install or execute. Everyone needs to start developing and honing a zero-trust mindset when it comes to even installing apps from app stores on your phones\/tablets let alone allowing random R, C[++], Python, Go, Rust, Haskel, \u2026 code to execute on your laptops and servers. This is one reason I went through the sections in the YAML and deliberately linked to the <code>index.js<\/code>. Not knowing what the code does can lead to unfortunate situations down the line.<\/p>\n<p>NOTE: If you have an alternative <a href=\"https:\/\/www.terraform.io\/\">Terraform<\/a> configuration for this drop a note in the comments since TF is a bit more &#8220;modern&#8221; and less AWS-centric &#8220;infrastructure as code&#8221; framework. Also, if you&#8217;ve done this with Azure or other providers, also drop a note in the comments since it may be of use to folks who aren&#8217;t interested in using AWS. Finally, if you do make a <code>plumber<\/code> server for this, also drop a note to a post with how you did it and perhaps discuss the costs &amp; headaches involved.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous post I tried to explain what Content Security Policies (CSPs) are and how to work with them in R. In case you didn&#8217;t RTFPost the TLDR is that CSPs give you control over what can be loaded along with your web content and can optionally be configured to generate a violation report [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[681,91],"tags":[],"class_list":["post-12083","post","type-post","status-publish","format-standard","hentry","category-cybersecurity","category-r"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Collecting Content Security Policy Violation Reports in S3 (&#039;Effortlessly&#039;\/&#039;Freely&#039;) - rud.is<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Collecting Content Security Policy Violation Reports in S3 (&#039;Effortlessly&#039;\/&#039;Freely&#039;) - rud.is\" \/>\n<meta property=\"og:description\" content=\"In the previous post I tried to explain what Content Security Policies (CSPs) are and how to work with them in R. In case you didn&#8217;t RTFPost the TLDR is that CSPs give you control over what can be loaded along with your web content and can optionally be configured to generate a violation report [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-14T15:02:17+00:00\" \/>\n<meta name=\"author\" content=\"hrbrmstr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hrbrmstr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/03\\\/14\\\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/03\\\/14\\\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Collecting Content Security Policy Violation Reports in S3 (&#8216;Effortlessly&#8217;\\\/&#8217;Freely&#8217;)\",\"datePublished\":\"2019-03-14T15:02:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/03\\\/14\\\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\\\/\"},\"wordCount\":1510,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"articleSection\":[\"Cybersecurity\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/03\\\/14\\\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/03\\\/14\\\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/03\\\/14\\\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\\\/\",\"name\":\"Collecting Content Security Policy Violation Reports in S3 ('Effortlessly'\\\/'Freely') - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"datePublished\":\"2019-03-14T15:02:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/03\\\/14\\\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/03\\\/14\\\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/03\\\/14\\\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Collecting Content Security Policy Violation Reports in S3 (&#8216;Effortlessly&#8217;\\\/&#8217;Freely&#8217;)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/\",\"name\":\"rud.is\",\"description\":\"&quot;In God we trust. All others must bring data&quot;\",\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rud.is\\\/b\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\",\"name\":\"hrbrmstr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"width\":460,\"height\":460,\"caption\":\"hrbrmstr\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\"},\"description\":\"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7\",\"sameAs\":[\"http:\\\/\\\/rud.is\"],\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/author\\\/hrbrmstr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Collecting Content Security Policy Violation Reports in S3 ('Effortlessly'\/'Freely') - rud.is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/","og_locale":"en_US","og_type":"article","og_title":"Collecting Content Security Policy Violation Reports in S3 ('Effortlessly'\/'Freely') - rud.is","og_description":"In the previous post I tried to explain what Content Security Policies (CSPs) are and how to work with them in R. In case you didn&#8217;t RTFPost the TLDR is that CSPs give you control over what can be loaded along with your web content and can optionally be configured to generate a violation report [&hellip;]","og_url":"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/","og_site_name":"rud.is","article_published_time":"2019-03-14T15:02:17+00:00","author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Collecting Content Security Policy Violation Reports in S3 (&#8216;Effortlessly&#8217;\/&#8217;Freely&#8217;)","datePublished":"2019-03-14T15:02:17+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/"},"wordCount":1510,"commentCount":1,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"articleSection":["Cybersecurity","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/","url":"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/","name":"Collecting Content Security Policy Violation Reports in S3 ('Effortlessly'\/'Freely') - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"datePublished":"2019-03-14T15:02:17+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2019\/03\/14\/collecting-content-security-policy-violation-reports-in-s3-effortlessly-freely\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Collecting Content Security Policy Violation Reports in S3 (&#8216;Effortlessly&#8217;\/&#8217;Freely&#8217;)"}]},{"@type":"WebSite","@id":"https:\/\/rud.is\/b\/#website","url":"https:\/\/rud.is\/b\/","name":"rud.is","description":"&quot;In God we trust. All others must bring data&quot;","publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rud.is\/b\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886","name":"hrbrmstr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","width":460,"height":460,"caption":"hrbrmstr"},"logo":{"@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1"},"description":"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7","sameAs":["http:\/\/rud.is"],"url":"https:\/\/rud.is\/b\/author\/hrbrmstr\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p23idr-38T","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":6685,"url":"https:\/\/rud.is\/b\/2017\/10\/09\/enabling-concerned-visitors-ethical-security-researchers-with-security-txt-web-security-policies-plus-analyze-them-at-scale-with-r\/","url_meta":{"origin":12083,"position":0},"title":"Enabling Concerned Visitors &#038; Ethical Security Researchers with security.txt Web Security Policies (plus analyze them at-scale with R)","author":"hrbrmstr","date":"2017-10-09","format":false,"excerpt":"I've blogged a bit about robots.txt --- the rules file that documents a sites \"robots exclusion\" standard that instructs web crawlers what they can and cannot do (and how frequently they should do things when they are allowed to). This is a well-known and well-defined standard, but it's not mandatory\u2026","rel":"","context":"In &quot;Information Security&quot;","block_context":{"text":"Information Security","link":"https:\/\/rud.is\/b\/category\/information-security\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11648,"url":"https:\/\/rud.is\/b\/2018\/11\/14\/use-github-vulnerability-alerts-to-keep-users-of-your-r-packages-safe\/","url_meta":{"origin":12083,"position":1},"title":"Use GitHub Vulnerability Alerts to Keep Users of Your R Packages Safe","author":"hrbrmstr","date":"2018-11-14","format":false,"excerpt":"Despite their now inherent evil status, GitHub has some tools other repository aggregators do not. One such tool is the free vulnerability alert service which will scan repositories for outdated+vulnerable dependencies. Now, \"R\" is nowhere near a first-class citizen in the internet writ large, including software development tooling (e.g. the\u2026","rel":"","context":"In &quot;Cybersecurity&quot;","block_context":{"text":"Cybersecurity","link":"https:\/\/rud.is\/b\/category\/cybersecurity\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/11\/Screen-Shot-2018-11-14-at-08.43.14.png?fit=1200%2C424&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/11\/Screen-Shot-2018-11-14-at-08.43.14.png?fit=1200%2C424&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/11\/Screen-Shot-2018-11-14-at-08.43.14.png?fit=1200%2C424&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/11\/Screen-Shot-2018-11-14-at-08.43.14.png?fit=1200%2C424&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/11\/Screen-Shot-2018-11-14-at-08.43.14.png?fit=1200%2C424&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":4674,"url":"https:\/\/rud.is\/b\/2016\/11\/22\/the-devil-is-in-the-details\/","url_meta":{"origin":12083,"position":2},"title":"The Devil is in the Details","author":"hrbrmstr","date":"2016-11-22","format":false,"excerpt":"The [first public informational video](https:\/\/www.greatagain.gov\/news\/message-president-elect-donald-j-trump.html) from the PEOTUS didn't add a full transcript of the video to the web site and did not provide (at least as of 0700 EST on 2016-11-22) their own text annotations\/captions to the video. Google's (YouTube's) auto-captioning (for the most part) worked and it's most\u2026","rel":"","context":"In &quot;Commentary&quot;","block_context":{"text":"Commentary","link":"https:\/\/rud.is\/b\/category\/commentary\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4225,"url":"https:\/\/rud.is\/b\/2016\/03\/30\/introducing-a-weekly-r-python-js-etc-vis-challenge\/","url_meta":{"origin":12083,"position":3},"title":"Introducing a Weekly R \/ Python \/ JS \/ etc Vis Challenge!","author":"hrbrmstr","date":"2016-03-30","format":false,"excerpt":">UPDATE: Deadline is now 2016-04-05 23:59 EDT; next vis challenge is 2016-04-06! Per a suggestion, I'm going to try to find a neat data set (prbly one from @jsvine) to feature each week and toss up some sample code (99% of the time prbly in R) and offer up a\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz024.png?fit=1200%2C605&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz024.png?fit=1200%2C605&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz024.png?fit=1200%2C605&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz024.png?fit=1200%2C605&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz024.png?fit=1200%2C605&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":4209,"url":"https:\/\/rud.is\/b\/2016\/03\/27\/nuclear-animations-in-d3\/","url_meta":{"origin":12083,"position":4},"title":"Nuclear Animations in D3","author":"hrbrmstr","date":"2016-03-27","format":false,"excerpt":"As I said, I'm kinda obsessed with the \"nuclear\" data set. So much so that I made a D3 version that's similar to the R version I made the other day. I tried not to code much today (too much Easter fun going on), so I left off the size\u2026","rel":"","context":"In &quot;cartography&quot;","block_context":{"text":"cartography","link":"https:\/\/rud.is\/b\/category\/cartography\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/ogimg.png?fit=1200%2C946&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/ogimg.png?fit=1200%2C946&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/ogimg.png?fit=1200%2C946&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/ogimg.png?fit=1200%2C946&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/ogimg.png?fit=1200%2C946&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":6193,"url":"https:\/\/rud.is\/b\/2017\/08\/29\/rpad-domain-repurposed-to-deliver-creepy-and-potentially-malicious-content\/","url_meta":{"origin":12083,"position":5},"title":"Rpad Domain Repurposed To Deliver Creepy (and potentially malicious) Content","author":"hrbrmstr","date":"2017-08-29","format":false,"excerpt":"I was about to embark on setting up a background task to sift through R package PDFs for traces of functions that \"omit NA values\" as a surprise present for Colin Fay and Sir Tierney: [Please RT]#RStats folks, @nj_tierney & I need your help for {naniar}!When does R silently drop\/omit\u2026","rel":"","context":"In &quot;Cybersecurity&quot;","block_context":{"text":"Cybersecurity","link":"https:\/\/rud.is\/b\/category\/cybersecurity\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/08\/Plot_Zoom.png?fit=868%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/08\/Plot_Zoom.png?fit=868%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/08\/Plot_Zoom.png?fit=868%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/08\/Plot_Zoom.png?fit=868%2C1200&ssl=1&resize=700%2C400 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/comments?post=12083"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12083\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=12083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=12083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=12083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}