Discovering Sensitive Data at Scale with Amazon Macie
Organisations often do not know where their sensitive data is: personal information in a forgotten bucket, credentials in a log export, financial data in a data science sandbox. Amazon Macie discovers sensitive data in Amazon S3 automatically and evaluates bucket security. This lesson explains automated sensitive data discovery, discovery jobs, data identifiers, bucket posture monitoring, findings and their automated handling across an organisation.
Learning outcomes
After completing this lesson, you will be able to:
- Describe Macie's bucket inventory and security posture monitoring.
- Distinguish between automated sensitive data discovery and sensitive data discovery jobs.
- Explain managed and custom data identifiers and allow lists.
- Explain how Macie findings are routed and remediated across an organisation.
- Distinguish between Macie, AWS Config rules, IAM Access Analyzer and GuardDuty S3 Protection for S3 requirements.
Bucket Inventory and Posture
When enabled, Amazon Macie builds an inventory of the S3 general purpose buckets in the account and evaluates their security and access controls daily: whether a bucket is publicly accessible, unencrypted, shared with other accounts or replicated outside the organisation. Changes that weaken security, such as a bucket becoming public, produce policy findings, such as Policy:IAMUser/S3BlockPublicAccessDisabled or Policy:IAMUser/S3BucketPublic.
Automated Discovery and Discovery Jobs
Macie finds sensitive data in two ways.
Automated sensitive data discovery
Macie continuously selects and analyses representative samples of objects across all buckets, building a sensitivity score and a map of where sensitive data is likely to be, at a cost far below scanning everything. It is the recommended starting point for organisation-wide visibility and runs without configuration once enabled.
Sensitive data discovery jobs
A job analyses specific buckets fully or by sampling, once or on a daily, weekly or monthly schedule, with criteria such as object prefixes, tags, sizes and last-modified dates, and incremental scanning of only new objects. Jobs suit thorough checks of known high-risk buckets or compliance requirements to scan everything in scope.
Run Macie
Data Identifiers and Allow Lists
Macie recognises sensitive data with managed data identifiers for many types, including credentials such as AWS secret keys and private keys, financial data such as credit card and bank account numbers, and personal information such as names, addresses, passport and national identification numbers for many countries, and health data. Custom data identifiers define organisation-specific patterns with a regular expression, optional keywords near the match and a maximum match distance, for example internal customer account numbers. Allow lists exclude known non-sensitive text or patterns, such as test card numbers or the company's public address, which reduces false positives.
Findings, Results and Automation
Sensitive data findings, such as SensitiveData:S3Object/Personal or SensitiveData:S3Object/Credentials, identify the object, the types and counts of sensitive data and their locations in the file. Findings are published to EventBridge and Security Hub. Detailed sensitive data discovery results for every analysed object are written to an S3 bucket that the administrator configures, encrypted with a KMS key, which provides an audit record of what was scanned.
Macie is enabled for an organisation from a delegated administrator, with automatic enablement for new accounts, and the administrator sees findings and bucket inventory for all member accounts. Responses are automated with EventBridge rules: notifying the data owner identified by bucket tags, tagging objects for review, moving objects to a quarantine bucket with restricted access, or blocking public access on the bucket. Remediation of credentials found in objects includes rotating the exposed credentials.
The EventBridge rule below matches high-severity sensitive data findings for credentials and personal information. Its target, such as a Step Functions state machine, can look up the bucket's owner tag, move the object to quarantine and open an OpsItem.
{
"source": ["aws.macie"],
"detail-type": ["Macie Finding"],
"detail": {
"type": ["SensitiveData:S3Object/Credentials", "SensitiveData:S3Object/Personal"],
"severity": {"description": ["High"]}
}
}Macie Compared with Related S3 Controls
Several services report on S3, and scenarios often place them side by side as answer options. The decisive question is whether the requirement concerns the content of objects, the configuration of buckets, who can access them or suspicious activity against them. Only Macie inspects object content.
Macie inspects objects in Amazon S3 only. Sensitive data in databases, file systems or logs needs other controls, for example CloudWatch Logs data protection policies, which detect and mask sensitive data in log events as they are ingested.
Which S3 control?
Finding Personal Data Before an Audit
Before a data protection audit, a company with 3,000 buckets in 40 accounts must know which buckets contain personal data, make sure none are public, and be alerted if personal data appears in non-production accounts in future.
-
Enable
Enable Macie through a delegated administrator with automatic enablement and automated sensitive data discovery for all accounts.
-
Thorough scans
Run weekly discovery jobs on buckets with high sensitivity scores, with a custom data identifier for internal customer numbers and an allow list for test data.
-
Posture
Review policy findings and Security Hub controls for public buckets, and apply an RCP that restricts S3 access to the organisation.
-
Automate
An EventBridge rule on personal data findings in non-production OUs notifies the data protection team and tags the objects for review.
A company wants continuous, low-cost visibility into which of its thousands of buckets probably contain sensitive data, without defining jobs for each. Which Macie feature fits?
Show answer
Automated sensitive data discovery, which samples objects across all buckets continuously and maintains sensitivity scores.
Exam Tips
Remember for the exam
- Macie inventories S3 buckets and reports policy findings such as public or unencrypted buckets.
- Automated sensitive data discovery samples all buckets continuously; discovery jobs scan defined scopes once or on a schedule.
- Managed data identifiers cover credentials, financial and personal data; custom identifiers use regular expressions and keywords; allow lists reduce false positives.
- Enable Macie through a delegated administrator; findings go to EventBridge and Security Hub; discovery results are stored in a KMS-encrypted S3 bucket.
- Only Macie inspects object content; Config checks bucket settings, Access Analyzer checks external access and GuardDuty detects suspicious activity.