Sub topic 15
Cost and operational best practices
This chapter assumes you have enabled GuardDuty and Security Hub, can read a finding, and know how EventBridge routes events. It covers what a detection pipeline costs, how to estimate and control that cost, and which operational habits keep the pipeline useful over time.
What drives cost
A detection pipeline bills in several places. Each one scales with a different quantity, so you need to know which one dominates in your environment.
| Component | What you pay for | What makes it grow |
|---|---|---|
| GuardDuty foundational data sources | Volume of CloudTrail management events analyzed, plus VPC Flow Log and DNS log volume, per account per Region | Busy accounts, chatty workloads, many Regions |
| GuardDuty protection plans | Each plan has its own meter (S3 data events, EKS audit logs, GB scanned for malware, RDS login events, Lambda network activity, Runtime Monitoring vCPU hours) | Which plans you enable and how much activity they see |
| Security Hub | Security checks run against controls, plus finding ingestion beyond the free allowance | Number of enabled standards and number of in-scope resources |
| EventBridge | Custom events and rules matched | Usually negligible for findings volume |
| Lambda, SNS, and similar targets | Invocations and duration | Number of findings that match your rules |
| Amazon Detective | Data ingested per GB | Log volume in the accounts you add |
Prices vary by Region and change over time. Treat any figure in this chapter as a placeholder and read the current pricing pages before you commit to a budget.
Estimate before you enable
GuardDuty has a free trial period for each account and Region when you first enable it. During the trial, the console and API report estimated usage and cost per data source. Use that estimate rather than guessing.
You can read the same numbers from the CLI. The get-usage-statistics call returns usage broken down by account, data source, or feature.
DETECTOR_ID=$(aws guardduty list-detectors --query 'DetectorIds[0]' --output text)
aws guardduty get-usage-statistics \
--detector-id "$DETECTOR_ID" \
--usage-statistic-type SUM_BY_DATA_SOURCE \
--usage-criteria '{"DataSources":["FLOW_LOGS","CLOUD_TRAIL","DNS_LOGS","S3_LOGS"]}'Run it after the trial has covered a representative period, such as a normal business week with a deploy and a batch job. Then multiply by the number of accounts and Regions you plan to cover.
Two points make the estimate more reliable:
- Usage is proportional to activity, not to the number of resources. A large idle account costs less than a small account with heavy network traffic.
- Protection plans are separate meters. Estimate each one on its own, because a plan such as Runtime Monitoring depends on how many vCPUs your instances and containers use, which has no relation to CloudTrail volume.
Enable in stages
Turning on everything everywhere on day one makes the first bill hard to interpret. A staged rollout keeps cost visible and lets you tune as you go.
- Enable the foundational data sources in all accounts and all Regions you use. This is the baseline, and it also covers Regions you do not use, where activity should be near zero and any finding is suspicious.
- Add protection plans one at a time, starting with the ones that match your workloads. An account with no EKS clusters gains nothing from EKS protection.
- Check usage statistics after each addition, and compare them with the estimate.
- Add Security Hub standards last, selecting only the ones you are required to meet or will act on.
Replace that placeholder with the diagram below.
Controlling cost without losing coverage
Cost control means removing waste, not removing detection. These are the levers, ordered from safest to most invasive.
Disable what has no target
Security Hub runs checks per standard and per resource. A standard that no one reviews still bills. If your team only acts on the AWS Foundational Security Best Practices standard, disable the others. You can also disable individual controls that do not apply, such as a control for a service you do not use.
aws securityhub get-enabled-standards \
--query 'StandardsSubscriptions[].StandardsArn'Use that list to confirm what is on before you change it.
Use organization-level enablement
Enable GuardDuty protection plans through the delegated administrator so that new accounts inherit the same configuration. Without this, a new account often gets either nothing or a different set of plans, and you end up with both coverage gaps and unexpected spend.
Handle noise at the source
Suppression rules do not reduce GuardDuty's analysis cost, because the data is still analyzed. They reduce downstream cost: fewer findings reach Security Hub, EventBridge targets, ticketing, and human attention. Tune suppression rules to cut downstream work, and do not count on them to lower the GuardDuty bill.
Scope protection plans
For plans that can be scoped, such as malware scanning on specific resources, or Runtime Monitoring through agent management, enable them where the risk is. Production accounts holding sensitive data justify more coverage than a short-lived sandbox.
Watch retention
GuardDuty keeps findings for a limited time. If you need longer retention for audits or investigations, export findings to an S3 bucket encrypted with a KMS key. Storage in S3 is cheap compared with detection, but the bucket and key policies must allow the GuardDuty service to write.
Operational best practices
Own the findings
A finding without an owner is noise. Decide in advance who receives each severity band, and write that down.
| Severity | Typical handling |
|---|---|
| 7.0 and above (high) | Page the on-call responder, run automated containment if it is safe |
| 4.0 to 6.9 (medium) | Create a ticket for review within a defined time |
| Below 4.0 (low) | Review in aggregate, tune if repetitive |
These bands match GuardDuty's own classification, so your EventBridge patterns and your policy use the same numbers.
Keep automation safe
Automated response is where operational mistakes cost the most. A rule that isolates an instance on a false positive can take down production.
- Start in notify-only mode. Send findings to a topic and have people confirm the quality of the rule for a few weeks.
- Make actions reversible. Replacing a security group can be undone, while terminating an instance cannot.
- Restrict the Lambda function's role to the exact actions it needs, on the resources it acts on.
- Guard against loops. If your remediation creates events that your rule matches, you can trigger it repeatedly.
- Handle duplicates. GuardDuty updates a finding's count and timestamps as activity continues, and EventBridge is at-least-once delivery, so a function can see the same finding more than once. Make the handler idempotent.
The handler below is a safe starting point. It records the finding and takes no action, so you can run it in notify-only mode first.
import json
def handler(event, context):
detail = event["detail"]
finding_id = detail["id"]
finding_type = detail["type"]
severity = detail["severity"]
instance_id = (
detail.get("resource", {})
.get("instanceDetails", {})
.get("instanceId")
)
count = detail.get("service", {}).get("count", 1)
print(json.dumps({
"findingId": finding_id,
"type": finding_type,
"severity": severity,
"instanceId": instance_id,
"count": count,
"mode": "notify-only",
}))
return {"findingId": finding_id, "action": "none"}Monitor the pipeline itself
A detection pipeline can fail silently. Check these regularly:
- A detector exists and is enabled in every account and Region. The delegated administrator view shows accounts that are not members or not enabled.
- The EventBridge rule has a dead-letter queue, and the Lambda function has alarms on errors and throttles.
- Security Hub shows a finding count from GuardDuty that is not zero. A sudden drop to zero often means an integration broke, not that you became safer.
- Service-linked roles and S3 export permissions still work after IAM or bucket policy changes.
Review on a schedule
Set a monthly review with three questions. Which finding types are most frequent, and should any be suppressed or fixed at the source? Which protection plans or standards produced no actionable result? Did spend per account match the estimate? Record the answers, because the same noisy finding often returns after a team reorganizes.
Use tags and cost allocation
GuardDuty bills per account, so a multi-account organization already gets natural allocation by account. For Lambda, SNS, and Detective components in a shared security account, tag resources by owner and function. That way the security account's bill can be split among teams.
Putting it together
A sustainable pipeline has these properties:
- Cost is estimated from real usage statistics, not guessed.
- Protection plans and standards are enabled because someone acts on their output.
- Every severity band has an owner and a defined response.
- Automation starts in notify-only mode, is idempotent, and is reversible.
- The pipeline is monitored for silent failure, and reviewed monthly.
Exercise
Your GuardDuty bill is higher than the free-trial estimate suggested. You created a suppression rule for a noisy finding type last week, but the GuardDuty line item did not drop. Why, and what should you check next?
Show answer
Suppression rules archive findings after GuardDuty has already analyzed the data, so they do not reduce GuardDuty analysis charges. They only reduce downstream work such as Security Hub ingestion, EventBridge targets, and human review. To find the real driver, run get-usage-statistics grouped by data source (or by account) and look for the meter that grew, for example a protection plan such as Runtime Monitoring or S3 protection enabled in a busy account, then decide whether to scope or disable it.
Exercise
Why should an automated remediation Lambda function be idempotent, and what is one other safeguard to apply before you let it isolate instances automatically?
Show answer
GuardDuty updates existing findings as activity continues, and EventBridge delivers events at least once, so the same finding can invoke the function more than once. An idempotent handler produces the same result on repeats. Another safeguard is to run in notify-only mode first so people can confirm the rule has few false positives, or to make the action reversible, such as swapping a security group rather than terminating the instance.