Lesson 3 of 5 Security Posture Improvement

Detecting, Prioritising and Responding to Vulnerabilities

This lesson explains how organisations detect vulnerable software and active threats quickly, prioritise them by real risk rather than raw count, and respond with automated, repeatable actions.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how Inspector, GuardDuty and Security Hub combine for detection.
  • Prioritise findings by exploitability and exposure.
  • Explain automated responses to findings.
  • Explain how vulnerable deployments are prevented.

Detecting

Three services work together to detect and prioritise problems. Amazon Inspector finds software vulnerabilities. It scans EC2 instances, through the SSM Agent or agentlessly from EBS snapshots, as well as ECR container images, Lambda functions and code repositories. Its risk score adjusts the standard CVSS score for whether the vulnerability is actually exploitable and reachable from the network, so teams fix the dangerous ones first. GuardDuty detects active threats, such as cryptocurrency mining, credential exfiltration and malware. Security Hub aggregates findings from both and other sources, applies automation rules and drives the response workflow. The following table summarises the roles.

ServiceRole
Amazon InspectorScans EC2 (agent through SSM, or agentless from EBS snapshots), ECR images, Lambda functions and code repositories; the Inspector risk score adjusts CVSS for exploitability and network reachability
GuardDutyDetects active threats, such as cryptocurrency mining, credential exfiltration and malware
Security HubAggregates findings, applies automation rules and drives workflows

Prioritising

An organisation can have thousands of open vulnerability findings, and fixing them in order of raw CVSS score wastes effort on vulnerabilities that cannot be exploited in practice. The Inspector risk score adjusts the base score for whether a known exploit exists and whether the affected resource is reachable from the network, which puts the genuinely dangerous findings at the top.

Security Hub automation rules then add business context, for example raising the severity of findings on production and internet-facing resources. Accepted risks are suppressed with documented reasons, so the remaining queue reflects real work rather than noise that teams learn to ignore.

Responding automatically

Findings arrive in EventBridge, and rules invoke Lambda, Step Functions or Systems Manager Automation to respond. For an active threat, the response contains it: a compromised instance is isolated by swapping in a quarantine security group and its volumes are snapshotted for forensics, compromised credentials are revoked by deactivating access keys or revoking role sessions, and malicious IP addresses are blocked in AWS WAF or Network Firewall.

For a vulnerability, the response starts the fix: a ticket for the owning team, or the patching or image rebuild process, after which Inspector rescans the resource and closes the finding automatically.

Preventing vulnerable deployments

The cheapest vulnerability to fix is one that is never deployed. Inspector scans container images in ECR when they are pushed and continuously afterwards, and its CI/CD integration scans images in the pipeline. Pipelines can fail builds with critical findings, and admission controls can stop images with known critical vulnerabilities reaching production.

Worked example

Prioritising findings at organisation scale

Security Hub receives tens of thousands of Inspector findings a week, and teams ignore the noise. The architect uses automation rules in the delegated administrator account to make severity meaningful: findings in sandbox accounts are lowered, and critical findings on internet-facing production resources are routed to on-call:

aws securityhub create-automation-rule --rule-name sandbox-to-low --rule-order 1 \
  --criteria '{"AwsAccountId":[{"Value":"555555555555","Comparison":"EQUALS"}]}' \
  --actions '[{"Type":"FINDING_FIELDS_UPDATE","FindingFieldsUpdate":{"Severity":{"Label":"LOW"},
              "Note":{"Text":"Sandbox account","UpdatedBy":"automation"}}}]'

An EventBridge rule on findings with label CRITICAL and the Inspector network reachability flag then opens an incident and starts Patch Manager for EC2, or a pipeline rebuild for container images. Prioritising by real exposure, not raw CVSS, is what the Inspector risk score and these rules provide.

Check yourself

How can vulnerable container images be stopped before they are deployed?

Show answer

Scan them in the pipeline with Amazon Inspector or ECR enhanced scanning, and fail the build on findings above a chosen severity.

Exam Tips

Remember for the exam

  • To prioritise vulnerabilities by exploitability and reachability, use the Inspector risk score.
  • Inspector scans EC2, ECR images and Lambda functions; GuardDuty detects active threats.
  • To isolate a compromised instance automatically, use EventBridge with a security group swap.
  • Scan images in the pipeline and fail builds with critical findings.
  • Use Security Hub automation rules to raise severity for critical resources.