What to alert on in the cloud

Unit 3 of 5 in Cloud logging, detection and response.

You will be able to pick the first cloud events worth an alert, explain what a managed detection service adds, and write a cloud rule you can test.

Lesson

Start with the actions that change who can do what

You cannot alert on everything, so start with a short list that experts already agree on. AWS Security Hub publishes controls, mapped to the CIS AWS Foundations Benchmark, that ask for a log metric filter and alarm on specific events. The list includes use of the root user, unauthorized API calls, console sign-in without multi-factor authentication, console authentication failures, IAM policy changes, changes to the CloudTrail configuration, disabling or scheduled deletion of customer-managed encryption keys, storage bucket policy changes, AWS Config changes, security group changes, network access control list changes, network gateway changes, route table changes and VPC changes.

Group them to remember them. Identity and access: root use, sign-in without MFA, failed sign-ins and policy changes. Logging: changes to the trail and to AWS Config. Keys and data: key disable or deletion and bucket policy changes. Network: security groups, network access lists, gateways, route tables and VPCs. The documentation explains why root matters: the root user has unrestricted access to all services and resources in the account.

Then alert on odd use of valid accounts

The hardest cloud intrusions use real logins. MITRE ATT&CK describes this as Valid Accounts: Cloud Accounts. Its detection strategy lists analytics such as sign-ins from impossible geolocations or legacy protocols by high-privileged accounts, and cloud accounts making API calls beyond their normal scope, such as IAM changes or access to services never used before.

Notice the pattern: these are not matches on a known-bad value. They compare what happens with what is normal for that account. That is why you need a baseline, and why the labs in this unit build one from synthetic sign-in logs.

Managed detection: let the provider read the logs too

Amazon GuardDuty is a threat detection service that monitors AWS data sources and logs, using threat intelligence feeds such as lists of malicious IP addresses and domains, and machine learning models. When you enable it, it starts reading foundational data sources automatically: CloudTrail management events, VPC flow logs and DNS logs. Its documentation lists scenarios it can help with, including compromised and exfiltrated AWS credentials, unauthorized cryptomining and unusual database logins. Its Extended Threat Detection links events that look harmless alone into an attack sequence.

A GuardDuty finding represents a potential security issue, and has a severity level. You can generate sample findings, marked with a [SAMPLE] prefix, that contain fictitious details, so you can practice without a real attack. A managed service does not replace your own rules. It covers the common patterns well; your rules cover what is particular to you, such as 'this role should never be used from outside our network'.

Write the rule once, run it where the logs are

Sigma, the open rule format from the previous class, has standard log sources for the clouds. Its documentation lists AWS CloudTrail (product aws, service cloudtrail), Azure activity logs, audit logs and sign-in logs, and Google Cloud audit logs (product gcp, service gcp.audit). A rule that names the right log source can be converted into a query for your SIEM.

Each cloud also has a built-in way to alert straight from its logs. Google's log-based alerting policies notify you whenever a specific message appears in the logs you include. Azure lets you create an alert rule from the activity log, combining the resource, the monitoring data and a condition, and then choosing what happens through action groups. AWS uses CloudWatch metric filters and alarms, as in the Security Hub list. Built-in alerts are quick to set up. Sigma rules are portable and testable. Many teams use both.

Count the cost of every alert

Every alert on the list above also fires for legitimate work. This is our own reasoning from the list, not a statement in the documentation: a deployment pipeline that changes security groups and IAM policies will trigger the same events as an intruder. Before you page anyone, decide how a legitimate change looks: who makes it, from where, at what time, and under which change ticket.

Write that into the rule as a known false positive, then measure it. The next class in the Defense track builds the full method; the Detection Lab and the labs below let you practise the first round: catch every planted attack, then remove the planted false alarms without losing a catch.

Key points

Sources

Lecture

Logging and detection pipelines: A talk on the path from a log line to an alert, which the rules in this unit sit on top of.

Practice in the labs

Write cloud detections against logs, then use the Detection Lab to check them against incident evidence. Then enable managed detection with sample findings.

Also try, in the simulators

Knowledge check

  1. Why does the Security Hub list include 'use of the root user'? Answer: Because the root user has unrestricted access to all services and resources, so its use is rare and important. The documentation explains that the root user has unrestricted access to everything in the account and should be avoided for daily tasks, so any use is worth a human look; it does not say every use is an attack.
  2. A stolen password is used to sign in with no unusual malware on any of your systems. Which kind of detection helps most? Answer: Comparing the sign-in with the account's own normal pattern, such as location, device and time. ATT&CK's detection strategy for cloud account abuse centres on impossible locations and activity beyond the account's normal scope, because the login itself is valid.
  3. What does GuardDuty read automatically when you enable it? Answer: CloudTrail management events, VPC flow logs and DNS logs. GuardDuty's documentation lists CloudTrail management events, VPC flow logs and DNS logs as the foundational data sources it ingests as soon as it is enabled.
  4. Your new rule for 'security group changed' fires every night at 02:00. What should you do first? Answer: Find out whether a scheduled pipeline makes that change, then record it as a known false positive and tune. Legitimate automation produces the same events as an intruder. Identify the source, document it, and tune narrowly, then re-run the attack tests to prove the rule still catches what it should.

Back to the syllabus or see all classes.

Related