I delivered this talk at the AWS User Group UK on 15-Sep-2021. Watch the talk + Q&A 👇 or read the talk notes 👇👇

Abstract

Misconfigurations are the number one security concern in the cloud.

That’s not surprising given that you’re moving faster in the AWS Cloud building and deploying several times at day. On top of that, AWS releases new features and services at a furious pace.

This is what makes the cloud exciting to work with.

It’s also what creates the constant challenge of keeping up and keeping track of what’s actually going on. Is what you’ve deployed, what you intended?

Traditional security approaches are broken…both with respect to technology and culturally. You can’t built a strong perimeter when the perimeter no longer exists. You can’t force every deployment through a long review when you’re deploying ten times a day.

What’s come to the forefront in the past couple of years is the idea of guardrails. AWS talks about guardrails, the community talks about guardrails, but what exactly are they? How do you build them? How do they help you?

In this talk, we’ll walk through the process of prioritizing and building simple guardrails to help you and your team avoid misconfigurations and other common security pitfalls in the AWS Cloud.

We’ll use lightly filtered real world examples to show how we can use techniques you’re already familiar with to ensure that your builds in the cloud meet reasonable security standards with minimal effort.

Critically, we’ll do this without burdening your team or slowing down your builds…too much 😉.

The Talk

Image unavailable: Slide from presentation, described in the next grid item

What guardrails are for

Misconfigurations are mistakes: builders expect one behavior and see another in production. This talk focuses on helping people catch those mistakes and understand their consequences.

Image unavailable: Slide from presentation, described in the next grid item

The goal of cybersecurity is simple: make sure that systems work as intended—and only as intended.

Image unavailable: Slide from presentation, described in the next grid item

At a very high level, there are two types of security controls.

Detective

These controls find issue and raise their hand saying, "I found this."

Preventatives

These controls find an issue and then take action to prevent further problems. They say, "I stopped this."

Image unavailable: Slide from presentation, described in the next grid item

When a security control encounters something suspicious, it has to decide whether there is a problem. There are three possible answers: yes, maybe, and no.

Image unavailable: Slide from presentation, described in the next grid item

Most security controls—and people—think in that binary, yes/no space.

This is the foundational, allow/deny concept that's critical to security overall.

Image unavailable: Slide from presentation, described in the next grid item

Several key services in the AWS Cloud are security controls that provide this type of yes/no answer.

Image unavailable: Slide from presentation, described in the next grid item

...but what we want to focus on is that grey area.

The "maybe's"

Image unavailable: Slide from presentation, described in the next grid item

The example starts with a user logging in to an EC2 instance. The guardrail follows this sequence:

Image unavailable: Slide from presentation, described in the next grid item
  1. Run a CloudWatch Logs agent on the instance to forward login events from the local SSH logs.
  2. Match the event with a CloudWatch Event rule and trigger an AWS Lambda function.
  3. Have the function contact the user in Slack to confirm whether they logged in.
Image unavailable: Slide from presentation, described in the next grid item

If the user confirms the login, use the conversation to explain why routine access to production instances should be avoided. Changes and observations should happen through the application and infrastructure tooling where possible.

If the user says it was not them, start the incident-response process.

Image unavailable: Slide from presentation, described in the next grid item

Why this guardrail?

  • Data from instances should be exported to an analysis pipeline, not pulled by hand
  • Problems with instances, should be resolved in the application code or your infrastructure as code templates (IaC)
  • People make mistakes. Remote access could increase the overall risk to your system
Image unavailable: Slide from presentation, described in the next grid item

The next example starts when an IAM permission is granted to a user:

Image unavailable: Slide from presentation, described in the next grid item
  1. Capture the permission-change event and trigger a Lambda function.
  2. Use the CloudTrail search feature to examine the user’s activity and existing access.
  3. Identify groups or roles with similar access and suggest a narrower permission set, applying the principle of least privilege.
Image unavailable: Slide from presentation, described in the next grid item

...and of course, we're going to bubble those findings up via Slack.

Again, we take the opportunity to educate the user in context, highlighting the current risk and potential methods of reducing/mitigating those risks.

Image unavailable: Slide from presentation, described in the next grid item

Why this guardrail?

  • Permissions should usually be granted to groups, not users. It's a lot easier to manage that way
  • Permissions are never really removed after being granted...despite everyone knowing better
  • Roles are the best way to manage and think of the permissions required for a specific task
Image unavailable: Slide from presentation, described in the next grid item
  1. Capture the event and trigger a Lambda function.
  2. Use IAM Access Analyzer to assess who and what can access the secret.
  3. Share the findings with the user so they can review and narrow access where needed.
Image unavailable: Slide from presentation, described in the next grid item

We then use the opportunity to educate the user in context via Slack.

Where we send the messages isn't the key point here. This pattern is just as useful if your organization uses Microsoft Teams, Discord, Google Chat, email, or something else as it's main method of communication.

Image unavailable: Slide from presentation, described in the next grid item

Why this guardrail?

  • Scope creep is real! It will impact resource policies around secrets
  • Wiring up Secrets Manager can be complication and that complexity leads to more mistakes and possible issues
  • People make mistakes...it happens
Image unavailable: Slide from presentation, described in the next grid item

Remember, there are three possible answers to figuring out is something is a security problem: yes, maybe, or no.

Image unavailable: Slide from presentation, described in the next grid item

Guardrails tackle the maybe.

Guardrails are an opportunity to educate users in context. It's an opportunity to highlight risk and provide the information required to make an informed decision.

Image unavailable: Slide from presentation, described in the next grid item

Remember the biggest security challenge in the cloud are misconfigurations.

Strip away all of the phrasing and misconfigurations are simply mistakes.

People make mistakes.

It happens. It will always happen. Guardrails are a great tool to help you educate and inform in order to help reduce the possibility of mistakes happening and then to reduce the impact of the mistakes that do happen.

Image unavailable: Slide from presentation, described in the next grid item

Thank you!

If you'd like to discuss this more, please reach out on Twitter, where I'm @marknca.