<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Security on Sander Knape</title>
    <link>https://sanderknape.com/tags/security/</link>
    <description>Recent content in Security on Sander Knape</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 03 May 2021 21:03:01 +0200</lastBuildDate>
    <atom:link href="https://sanderknape.com/tags/security/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Shift left AWS tag enforcement with Terraform and tfsec</title>
      <link>https://sanderknape.com/2021/05/shift-left-aws-tag-enforcement-terraform-tfsec/</link>
      <pubDate>Mon, 03 May 2021 21:03:01 +0200</pubDate>
      <guid>https://sanderknape.com/2021/05/shift-left-aws-tag-enforcement-terraform-tfsec/</guid>
      <description>&lt;p&gt;There are many ways to improve the developer experience of deploying infrastructure into the Cloud. One such method is by shifting left: provide early feedback to shorten the feedback loop and speed up development.&lt;/p&gt;&#xA;&lt;p&gt;When deploying infrastructure into AWS with an infrastructure as code tool such as Terraform, you can validate that code as part of a CI/CD pipeline. A pull request can automatically receive feedback about the configuration of resources, thus enforcing the environment to stay compliant with the organization&amp;rsquo;s policies.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Amazon Cognito JWTs to authenticate with an Amazon HTTP API</title>
      <link>https://sanderknape.com/2020/08/amazon-cognito-jwts-authenticate-amazon-http-api/</link>
      <pubDate>Sun, 02 Aug 2020 16:29:33 +0200</pubDate>
      <guid>https://sanderknape.com/2020/08/amazon-cognito-jwts-authenticate-amazon-http-api/</guid>
      <description>&lt;p&gt;Last year AWS released a new iteration of their API Gateway product: &lt;a href=&#34;https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;HTTP APIs&lt;/a&gt;. This new version promises lower prices, improved performance and some new features. Some features that are available in the older REST API are not (yet) available for HTTP APIs, though. The official &lt;a href=&#34;https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;comparison page&lt;/a&gt; gives a good overview of which features are available in both products.&lt;/p&gt;&#xA;&lt;p&gt;My favorite new feature available for HTTPs APIs is &lt;a href=&#34;https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-jwt-authorizer.html&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;JWT Authorizers&lt;/a&gt;. It is now possible to have the HTTP API validate a JWT coming from an OIDC or OAuth 2.0 provider. While this was already possible using a Lambda Authorizer, now this can be achieved in a fully managed way with only a minimum amount of work required. It&amp;rsquo;s even easier now to build secure APIs with proper authentication.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Blocking account-wide creation of public S3 buckets through a CloudFormation custom resource</title>
      <link>https://sanderknape.com/2018/11/blocking-account-wide-creation-public-s3-buckets-cloudformation-custom-resource/</link>
      <pubDate>Fri, 16 Nov 2018 17:25:02 +0200</pubDate>
      <guid>https://sanderknape.com/2018/11/blocking-account-wide-creation-public-s3-buckets-cloudformation-custom-resource/</guid>
      <description>&lt;p&gt;Yesterday, AWS announced the release of an important and much-wanted new feature for S3: &lt;a href=&#34;https://aws.amazon.com/blogs/aws/amazon-s3-block-public-access-another-layer-of-protection-for-your-accounts-and-buckets/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;blocking the creation of public S3 buckets on an account-wide&lt;/a&gt;. Enough has been written already about open S3 buckets on the internet. Given that it is very simple to create a public S3 bucket, we regularly learn about new (big) companies that have exposed privacy-sensitive data to the world through such buckets.&lt;/p&gt;&#xA;&lt;p&gt;The confusion is mainly around opening up your bucket to &amp;ldquo;everyone&amp;rdquo;. Where people expect this to mean &amp;ldquo;everyone in the AWS account&amp;rdquo;, it actually means &amp;ldquo;&lt;em&gt;everyone in the world&lt;/em&gt;&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to easily test your AWS IAM credentials locally</title>
      <link>https://sanderknape.com/2018/09/easily-test-aws-iam-credentials-locally/</link>
      <pubDate>Sun, 02 Sep 2018 18:30:02 +0200</pubDate>
      <guid>https://sanderknape.com/2018/09/easily-test-aws-iam-credentials-locally/</guid>
      <description>&lt;p&gt;It is still very common to develop an application locally on a laptop/desktop before pushing it to a production-like environment. The local development environment is kept as close as possible to production using technology such as Docker or AWS SAM when working with AWS Lambda. However, when working with AWS resources through Identity and Access Management (IAM) policies, local IAM permissions are typically different from the permissions the application will have in AWS. This inconsistency can cause issues later in the development workflow: an application that fully worked locally can run into errors when ran in AWS if the IAM permission there are different.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to manage any kind of secret with AWS Secrets Manager</title>
      <link>https://sanderknape.com/2018/07/manage-custom-secrets-aws-secrets-manager/</link>
      <pubDate>Sat, 07 Jul 2018 20:04:02 +0200</pubDate>
      <guid>https://sanderknape.com/2018/07/manage-custom-secrets-aws-secrets-manager/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://aws.amazon.com/secrets-manager/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;AWS Secrets Manager&lt;/a&gt; is a service recently released designed to make the management of secrets easier. It provides built-in support for Amazon RDS, making it very easy to set and rotate secrets and use the CLI or an SDK to retrieve secrets from applications. Through the use of custom Lambda functions, essentially any database or an otherwise protected endpoint is supported.&lt;/p&gt;&#xA;&lt;p&gt;Setting up Secrets Manager for a non-RDS database is less trivial as you need to write your own functionality using AWS Lambda. In this blog post we&amp;rsquo;ll go through the process of creating a Lambda function for rotating a MongoDB user. First, let&amp;rsquo;s dive in a bit more into what Secrets Manager can do for us.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Secret management design decisions: theory plus an example</title>
      <link>https://sanderknape.com/2018/03/secret-management-design-decisions-theory-plus-an-example/</link>
      <pubDate>Thu, 08 Mar 2018 22:29:02 +0200</pubDate>
      <guid>https://sanderknape.com/2018/03/secret-management-design-decisions-theory-plus-an-example/</guid>
      <description>&lt;p&gt;Secret management is one of those security topics that is often an after-thought while designing systems. Passwords are set up manually, shared through non-secure methods such as e-mail or Slack, and password rotation is often neglected because it&amp;rsquo;s time-consuming and error-prone.&lt;/p&gt;&#xA;&lt;p&gt;This is a shame because with some effort, secret management can definitely be automated. If done properly, less manual work is required to build and maintain applications, and of course security is increased reducing risk.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using pre-signed URLs to upload a file to a private S3 bucket</title>
      <link>https://sanderknape.com/2017/08/using-pre-signed-urls-upload-file-private-s3-bucket/</link>
      <pubDate>Tue, 08 Aug 2017 18:12:02 +0200</pubDate>
      <guid>https://sanderknape.com/2017/08/using-pre-signed-urls-upload-file-private-s3-bucket/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve written about serverless architectures before (&lt;a href=&#34;https://sanderknape.com/2017/05/building-a-serverless-website-in-aws/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;a serverless website in S3&lt;/a&gt; and &lt;a href=&#34;https://sanderknape.com/2017/02/dynamic-image-generation-with-aws-api-gateway-and-lambda/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;dynamic image generation with Lambda&lt;/a&gt;). I strongly believe in this notion as it minimizes required maintenance and makes the initial setup much easier. Of course, there is no silver bullet for every problem but use cases definitely exist where a serverless architecture makes a lot of sense.&lt;/p&gt;&#xA;&lt;p&gt;One such use case for serverless is a small piece of functionality that you just need to run. &lt;em&gt;Somewhere&lt;/em&gt;. You want to care as little as possible about this &lt;em&gt;somewhere&lt;/em&gt; because the functionality is so small that pretty much any work you put into the &lt;em&gt;somewhere&lt;/em&gt; is more than the time you spend on the actual functionality.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Use Infrastructure as Code for automated security in the deployment pipeline</title>
      <link>https://sanderknape.com/2017/05/infrastructure-as-code-automated-security-deployment-pipeline/</link>
      <pubDate>Mon, 01 May 2017 19:25:02 +0200</pubDate>
      <guid>https://sanderknape.com/2017/05/infrastructure-as-code-automated-security-deployment-pipeline/</guid>
      <description>&lt;p&gt;Infrastructure as Code (IaC) is a very powerful concept. The idea is that you put all infrastructure resources - networks, subnets, load balancers, firewalls and so on - in code. You then deploy your infrastructure the same way application developers deploy their code: through a continuous integration / continuous deployment (CI/CD) pipeline. Other benefits already reaped by application developers that become available are code linting, automated testing and an audit trail of your changes if combined with a version control system. The most well known IaC tools are &lt;a href=&#34;https://www.terraform.io/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Terraform&lt;/a&gt; (supports many different services) and &lt;a href=&#34;https://aws.amazon.com/cloudformation&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;CloudFormation&lt;/a&gt; (specifically for the AWS cloud).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Getting started with AWS Cognito</title>
      <link>https://sanderknape.com/2017/02/getting-started-with-aws-cognito/</link>
      <pubDate>Sat, 04 Feb 2017 23:32:02 +0200</pubDate>
      <guid>https://sanderknape.com/2017/02/getting-started-with-aws-cognito/</guid>
      <description>&lt;p&gt;Did you ever write your own authentication service? In essence it&amp;rsquo;s quite trivial: allow a user to enter a username and a password. Next, look in a database for a row/document that matches the received data. If found, login. If not, be gone. It becomes harder when you start thinking more about proper security. And what about features such as password resets, login throttling or logins with Google/Facebook? Surely a managed service must exist that can make all this much easier for us.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Securing your server&#39;s SSH configuration</title>
      <link>https://sanderknape.com/2016/11/securing-your-server-ssh-configuration/</link>
      <pubDate>Sun, 06 Nov 2016 12:43:02 +0200</pubDate>
      <guid>https://sanderknape.com/2016/11/securing-your-server-ssh-configuration/</guid>
      <description>&lt;p&gt;Are your SSH log files flooding with failing login attempts? I&amp;rsquo;ve seen many questions on websites such as Stackoverflow and Stackexchange from worried people that someone is actively targeting their servers with brute-force password logins attempts. Let me get one thing straight first: &lt;em&gt;you are not special!&lt;/em&gt; It&amp;rsquo;s part of internet life: many botnets constantly attempt to login to servers. These can be random IP addresses or known ranges such as Amazon AWS EC2 instances or DigitalOcean droplets. There&amp;rsquo;s nothing much you can do about this except for making sure that your server is securely set up.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Let&#39;s Encrypt for free automated SSL certificates</title>
      <link>https://sanderknape.com/2016/09/lets-encrypt-automated-ssl-certificates/</link>
      <pubDate>Thu, 01 Sep 2016 13:07:02 +0200</pubDate>
      <guid>https://sanderknape.com/2016/09/lets-encrypt-automated-ssl-certificates/</guid>
      <description>&lt;p&gt;If you maintain your own server or servers with SSL certicates, you might know how annoying it can be to keep those certificates up to date. Especially when you have a multitude of servers, some possibly even serving the same certificates, this is a hassle to manage. Luckily, there is a solution, and its called Let&amp;rsquo;s Encrypt.&lt;/p&gt;&#xA;&lt;h1 id=&#34;introducing-lets-encrypt&#34; class=&#34;relative group&#34;&gt;Introducing Let&amp;rsquo;s Encrypt &lt;span class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100&#34;&gt;&lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34; style=&#34;text-decoration-line: none !important;&#34; href=&#34;#introducing-lets-encrypt&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;Let&amp;rsquo;s Encrypt is a Certificate Authority (CA) that provides an automated method for requesting and renewing free Domain Validated (DV) SSL certificates. It is not possible to request the other certificate types (Organization Validation (OV) and Extended Validation (EV)) through Let&amp;rsquo;s Encrypt. These certificate types require some manual work from the CA and can thus not be automated. If you have good reason to go for an OV or EV certificate, Let&amp;rsquo;s Encrypt is not an option for you. Remember though: each certificate type is equally secure for your website visitors.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Getting a Qualys SSL Labs A&#43; rating with Nginx</title>
      <link>https://sanderknape.com/2016/06/getting-ssl-labs-rating-nginx/</link>
      <pubDate>Sun, 19 Jun 2016 12:01:02 +0200</pubDate>
      <guid>https://sanderknape.com/2016/06/getting-ssl-labs-rating-nginx/</guid>
      <description>&lt;p&gt;Setting up SSL for your server may seem like a daunting task. In addition, why would you do it? What are the benefits? There are multiple, actually, with some of the most important ones being:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It’s better for SEO. Back in 2014, Google &lt;a href=&#34;https://webmasters.googleblog.com/2014/08/https-as-ranking-signal.html&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;announced&lt;/a&gt; they would start with giving HTTPS websites a little boost in the search results.&lt;/li&gt;&#xA;&lt;li&gt;It’s not slower than HTTP. In fact - it will even be faster with HTTP2 enabled. Check the “&lt;a href=&#34;https://istlsfastyet.com&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Is TLS Fast Yet?&lt;/a&gt;” website for details.&lt;/li&gt;&#xA;&lt;li&gt;It’s free. Ok, it’s not free if you want that spiffy, large green browser bar for your customer. If you are happy enough with a green lock (in Google Chrome at least), it’s free.&lt;/li&gt;&#xA;&lt;li&gt;You can automate it! Which is especially great when you manage multiple servers with multiple SSL certificates.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In this post we&amp;rsquo;ll setup an Nginx configuration in such a way that you will get an A+ rating on the &lt;a href=&#34;https://www.ssllabs.com/ssltest&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Qualys SSL Labs test&lt;/a&gt;. If you want to follow along with this blog, you’ll need the following things already set up:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
