Discovering Personal Data in S3 with Amazon Macie
This lesson explains how Amazon Macie discovers personal and sensitive data in Amazon S3 automatically, since personal data cannot be protected until it has been found.
Learning outcomes
After completing this lesson, you will be able to:
- Describe managed and custom data identifiers.
- Choose between automated discovery and discovery jobs.
- Automate protection from Macie findings.
- Identify how sensitive data is found outside S3.
What Macie does
Amazon Macie is a data security service that discovers personal and sensitive data in Amazon S3. It uses managed data identifiers, which recognise common types such as names, addresses, credit card numbers, national identification numbers and credentials, and custom data identifiers, defined with regular expressions and keywords for an organisation's own formats, such as customer or employee numbers.
Macie also evaluates the security of buckets, reporting those that are publicly accessible, unencrypted or shared with other accounts, because sensitive data in an exposed bucket is the most urgent risk. Its findings are sent to AWS Security Hub and Amazon EventBridge, so they can be reviewed centrally and trigger automated responses.
What Macie does
Discovery modes
Amazon Macie finds sensitive data, such as PII and credentials, in S3, and scans in two ways. Automated sensitive data discovery runs continuously and samples objects across all buckets in the account or organisation, giving broad, low-cost visibility of where sensitive data is. Sensitive data discovery jobs analyse every object in selected buckets, once or on a schedule, for a thorough scan of buckets already known to be high risk, or to confirm what automated discovery suggested. The following table summarises the modes.
| Mode | How it works | Use for |
|---|---|---|
| Automated sensitive data discovery | Continuously samples objects across all buckets | Broad, low-cost visibility of where sensitive data is |
| Sensitive data discovery jobs | Analyse selected buckets fully, once or on a schedule | Deep scans of known high-risk buckets |
From discovery to protection
Macie findings are useful only when they lead to protection, and in a large data lake that protection should be automatic. A typical response works as follows.
-
Receive the finding
An Amazon EventBridge rule receives each Macie finding.
-
Tag the data
Automation, usually a Lambda function, tags the affected Data Catalog tables and columns with Lake Formation LF-Tags, such as
classification=pii. -
Restrict access
Lake Formation tag-based permissions then restrict or mask those columns automatically for every user who is not allowed to see personal data, without anyone editing individual table permissions.
-
Confirm with the owner
The data owner is notified to review the finding and confirm the classification.
Because permissions follow tags, a newly discovered PII column is protected as soon as it is tagged, which closes the gap between finding sensitive data and restricting access to it.
The following diagram shows the response to an inherited data lake, from discovering personal data to protecting it.

From finding to protection
Beyond S3
Macie analyses data stored in Amazon S3 only, so other services protect sensitive data in other places. AWS Glue sensitive data detection finds personal data as it flows through ETL jobs and can mask or remove it before it is written. AWS Glue DataBrew detects personal data while data is being prepared. Amazon Redshift dynamic data masking hides sensitive values in query results according to the user's role, without changing the stored data. Amazon CloudWatch Logs data protection detects and masks personal data in application logs.
A complete design combines these: Macie finds sensitive data at rest in the lake, Glue removes it in pipelines where it is not needed, and masking in Redshift and CloudWatch Logs limits who can see it where it must remain.
PII beyond S3
Finding personal data in an inherited lake
After an acquisition, a company inherits a data lake of 400 buckets with no documentation of where personal data is stored. The response proceeds as follows.
- Macie automated sensitive data discovery is enabled across the organisation from a delegated administrator account.
- Within days, findings identify 23 buckets containing names, addresses and national identifiers.
- An EventBridge rule tags the affected Data Catalog tables and columns with
classification=pii. - Lake Formation tag-based permissions immediately restrict those columns to approved roles.
Full discovery jobs are then run on the 23 buckets for complete evidence, and Glue sensitive data detection is added to the pipelines that write to them.
What is the difference between Macie's automated discovery and discovery jobs?
Show answer
Automated discovery samples data continuously. Discovery jobs scan selected buckets fully.
Exam Tips
Remember for the exam
- To find PII across the data lake, use Amazon Macie.
- Automated discovery samples continuously; discovery jobs scan selected buckets fully.
- To restrict PII columns found by Macie, apply LF-Tags in Lake Formation.
- Route Macie findings through EventBridge for automation.
- Macie covers S3 only; use Glue sensitive data detection inside pipelines.