Lesson 2 of 3 Secrets and Sensitive Data

Discovering Sensitive Data in S3 with Amazon Macie

This lesson explains how Amazon Macie discovers sensitive data in Amazon S3 and reports data security risks, so you know where personal and confidential data lives and whether it is exposed.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish policy findings from sensitive data findings.
  • Choose between automated discovery and discovery jobs.
  • Describe how Macie results are acted on through Security Hub and EventBridge.

Finding types

Amazon Macie produces two types of finding. Policy findings report risks in a bucket's settings, whatever it contains. A bucket might become publicly accessible, be shared with an external account, lose default encryption or have Block Public Access disabled, and Macie reports the change. Sensitive data findings report individual objects that contain sensitive data, such as personal or financial information or credentials, with the type and location of what was found. Together they show where sensitive data is and whether it is exposed. The following table summarises the two types.

FindingReports
Policy findingsBucket-level risks: public, shared externally, unencrypted, Block Public Access disabled, and changes to these
Sensitive data findingsObjects containing sensitive data
Sort into groups

Policy or sensitive data finding?

Exam skills 1.1.4 · 5.3.4

Classify each Macie finding.

Log in to try this activity Interactive activities are free with an account.

Discovering sensitive data

Macie looks for sensitive data in two ways. Automated sensitive data discovery runs continuously, sampling objects across all your buckets at low cost, and builds a picture of where sensitive data is likely to be. Sensitive data discovery jobs scan the objects in buckets you choose fully, once or on a schedule, for a thorough analysis of buckets known or suspected to hold sensitive data. The following table summarises the methods.

MethodHow
Automated sensitive data discoveryContinuously samples objects across all buckets at low cost
Discovery jobsFull scans of chosen buckets, on demand or scheduled

The following list describes how Macie identifies sensitive data.

  • Managed data identifiers: PII (names, addresses, national IDs, passports), financial (card and bank numbers), credentials (AWS secret keys, private keys).
  • Custom data identifiers: regex and keywords, e.g. employee IDs.
  • Allow lists reduce false positives.

The following diagram follows the discovery of personal data across 80 accounts with Amazon Macie, from sampling to the data register.

Building a personal data register across 80 accounts with Amazon Macie. Automated sensitive data discovery samples every bucket; a targeted job scans the flagged buckets in full with a custom identifier for customer numbers; findings go to Security Hub and a results bucket, and a rule notifies owners of new locations.
The scenario is illustrative.
Scenario questions

How Macie looks for data

Exam skills 5.3.4

Choose the Macie discovery approach for each need.

Log in to try this activity Interactive activities are free with an account.

Acting on results

Macie findings should lead to action on the affected data. The following list describes how results are handled.

  • Findings go to Security Hub and EventBridge; detailed results to a KMS-encrypted S3 bucket.
  • Manage from a delegated administrator.
  • Classify data (tags, LF-Tags), then restrict access, encrypt, or delete data that should not be stored.
  • Macie scans S3 only, not databases or EBS.
True or false

Acting on Macie results

Exam skills 5.3.4 · 6.1.4

Check how Macie results are handled.

Log in to try this activity Interactive activities are free with an account.
Worked example

Finding where personal data really lives

A privacy officer must produce a register of every S3 location containing personal data across 80 accounts. Automated sensitive data discovery samples every bucket continuously; a targeted job then scans the buckets flagged as sensitive in full, including a custom identifier for customer numbers:

aws macie2 update-automated-discovery-configuration --status ENABLED

aws macie2 create-classification-job --name full-scan-flagged --job-type ONE_TIME \
  --custom-data-identifier-ids $CUSTOMER_NUMBER_IDENTIFIER \
  --s3-job-definition '{"bucketCriteria":{"includes":{"and":[{"simpleCriterion":{
      "comparator":"EQ","key":"S3_BUCKET_NAME","values":["crm-exports","marketing-lists","support-attachments"]}}]}}}'

Findings, with the object keys and the types and counts of sensitive data, go to Security Hub and to a results bucket. The register becomes a query over those results, and a rule on new findings keeps it current by notifying the owner whenever personal data appears somewhere new.

Check yourself

How can Macie detect identifiers specific to your company?

Show answer

With a custom data identifier.

Exam Tips

Remember for the exam

  • To find PII across all S3 buckets continuously, use Macie automated sensitive data discovery.
  • To detect identifiers specific to your company, create a Macie custom data identifier.
  • To alert when a bucket becomes public, combine a Macie policy finding with EventBridge.
  • Macie scans S3, not databases or EBS volumes.
  • To reduce false positives for known values, use allow lists.