Based on the DEA-C01 exam guideReport an error
Unintended PII (personally identifiable information) creeps into data lakes: a national ID number typed into a free-text field, a card number printed in a log. Amazon Macie is the service that finds it. The findings Macie produces fall into two categories.
| Category | What it reports | When it is generated | Example types |
|---|---|---|---|
| Policy finding | A change that weakened a bucket's security or access settings | Continuously watches for changes made after you turn Macie on | Block Public Access turned off, bucket made public, shared or replicated with an account outside the organization |
| Sensitive data finding | Sensitive data found inside an object | When you run a discovery job or when automated discovery analyzes it | Financial, Personal, Credentials, CustomIdentifier, Multiple |
| Item | Automated sensitive data discovery | Sensitive data discovery job |
|---|---|---|
| Scope | All general purpose buckets in the account or organization (exclusions possible) | The buckets and prefixes you specify |
| Method | Continuously evaluates the bucket inventory and picks sample objects to analyze | Analyzes the objects in scope, one time or on a schedule |
| Results | Per-bucket sensitivity scores and statistics, sensitive data findings | Sensitive data findings, per-object analysis records |
| Use | A broad map answering "which of the thousands of buckets are risky" | A precise investigation for "check this bucket thoroughly" |
| Configured by | The organization's Macie administrator account or a standalone account | Per account |
{
"name": "internal-employee-id",
"regex": "EMP-[0-9]{6}",
"keywords": ["employee", "employee ID"],
"ignoreWords": ["EMP-000000"],
"maximumMatchDistance": 50
}| Component | Role | Limit |
|---|---|---|
| Regular expression | The text pattern to find | Up to 512 characters. Some constructs such as backreferences and lookarounds are not supported |
| Keywords | Words that must appear near the pattern | Up to 50, each 3 to 90 characters, case-insensitive |
| Maximum match distance | Number of characters allowed between a keyword and the pattern | 1 to 300, default 50 |
| Ignore words | Values to exclude from results even if they match the pattern | Up to 10, each 4 to 90 characters, case-sensitive |
| Object encryption | Can Macie analyze it |
|---|---|
| SSE-S3 | Yes |
| SSE-KMS and DSSE-KMS (AWS managed key) | Yes |
| SSE-KMS and DSSE-KMS (customer managed key) | Only if the key policy allows kms:Decrypt for Macie's service-linked role |
| SSE-C | No. Reports metadata only |
| Client-side encryption | No. Reports metadata only |
💡 Related theory: Macie is a detection tool. Its results go as far as "what is where"; it does not mask, quarantine, or delete. On the exam, answer choices like "mask with Macie" or "delete with Macie" are wrong. Actions after detection are handled by other services chained on through EventBridge.
[Macie finding] → [EventBridge rule] → [Lambda]
→ restrict access with bucket policy / tag object / SNS notification / record in Security Hub{
"source": ["aws.macie"],
"detail-type": ["Macie Finding"],
"detail": { "type": [{ "prefix": "SensitiveData:S3Object/" }] }
}| Technique | Result | Reversible | Join/aggregate | Fits when |
|---|---|---|---|---|
| Full masking (redaction) | Replaced with a fixed string | No | No | Lookups that never need the value |
| Partial masking | Only part is shown (****-****-****-1234) | No | Limited | Support and verification screens |
| Hashing (deterministic) | Same input → same hash | No | Equality joins possible | Linking by identifier only, without the original |
| Tokenization | Replaced with a meaningless token, mapping kept in a vault | Yes (only by authorized systems) | Yes | Work that needs the original later (payments) |
| Encryption | Ciphertext | Yes (key holders) | Generally no | Protecting data at rest and in transit |
| Column exclusion | The value is not provided at all | Not applicable | No | Users with no reason to see it |
💡 Related theory: Tokenization can hide the original while preserving joins and analytics, so payment regulations such as PCI-DSS prefer it. The cost is that the vault holding the mapping between originals and tokens becomes a new asset to protect. The heart of the design is minimizing the systems that can access the vault.
| Location | Means | Characteristics |
|---|---|---|
| ETL stage (before writing) | Glue's Detect PII transform, Spark UDFs | The stored values themselves change. Once masked, it applies to every consumer |
| Catalog permissions (at read time) | Lake Formation data filters | Sensitive columns and rows are not returned |
| Warehouse query (at read time) | Redshift dynamic data masking | Stored values stay as they are, and a masked value is shown depending on the role |
-- Redshift dynamic data masking
CREATE MASKING POLICY mask_card_full
WITH (card_number VARCHAR(20))
USING ('****-****-****-****'::TEXT);
CREATE MASKING POLICY mask_card_last4
WITH (card_number VARCHAR(20))
USING ('****-****-****-' || RIGHT(card_number, 4));
-- All users get full masking, the analyst role gets the last 4 digits (the higher-priority policy applies)
ATTACH MASKING POLICY mask_card_full
ON payments(card_number) TO PUBLIC;
ATTACH MASKING POLICY mask_card_last4
ON payments(card_number) TO ROLE analyst_role PRIORITY 10;sys:secadmin role can create and attach policies.PUBLIC, give it a higher priority.-- 1) Logical delete
DELETE FROM lake_clean.payments WHERE customer_id = 'GDPR-REQ-2026-042';
-- 2) Merge the delete markers into the data files and rewrite
OPTIMIZE lake_clean.payments REWRITE DATA USING BIN_PACK;
-- 3) Expire old snapshots + remove files that belong to nothing
VACUUM lake_clean.payments;| Where it remains | Action |
|---|---|
| Pre-deletion snapshots and old data files | Shorten the snapshot retention period and run VACUUM |
| Previous versions in S3 versioning | A lifecycle rule to expire previous versions |
| Originals in the raw zone, quarantine buckets, backups | Apply the same request to each store separately |
| Downstream copies (Redshift, extract files) | Trace where copies are using lineage (tomorrow) |
| Requirement | Representative regulation | AWS means |
|---|---|---|
| Locate sensitive data | Common | Macie |
| Minimize access | Common | IAM, Lake Formation |
| Protect at rest and in transit | PCI-DSS, HIPAA | KMS, enforced TLS |
| Do not expose card data | PCI-DSS | Tokenization, masking |
| Deletion request (right to be forgotten) | GDPR | Iceberg/Hudi row-level DELETE + snapshot cleanup |
| Access records | Common | CloudTrail, Security Hub |
| Data residency (not allowed outside specific Regions) | Data sovereignty requirements | SCP Region restriction, bucket policy |
{
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"StringNotEquals": { "aws:RequestedRegion": ["ap-northeast-2"] }
}
}| Symptom | Cause | Action |
|---|---|---|
| Zero Macie findings | Macie is not in the customer managed key policy, or SSE-C or client-side encryption is used | Allow the service-linked role in the key policy |
| Employee ID detection floods with false positives | Only a regex, no keywords | Add keywords, maximum match distance, and ignore words (create the identifier anew) |
| Cannot find a finding from three months ago | Findings are retained for 90 days | Export to EventBridge, Security Hub, or S3 |
| An analyst sees the original instead of the masked value | A higher-priority policy is attached, or no policy is attached | Check priorities and attachment targets |
| Deleted customer data is visible in time travel queries | Snapshots remain | Expire snapshots + VACUUM |
| Joins between tables break after tokenization | Different token mappings per table | Use the same vault and the same mapping |
| Question clue | Answer |
|---|---|
| "We do not know which buckets contain card numbers or national ID numbers" | Amazon Macie |
| "Detect identifiers in an organization-specific format" | Custom data identifier |
| "Keep joins + hide the original + restore later" | Tokenization |
| "Same table, different visibility by role (Redshift)" | Dynamic data masking |
| "Do not return sensitive columns at all (data lake)" | Lake Formation data filter |
| "Find and mask PII during ETL" | Glue Detect PII transform |
| "Quarantine and notify immediately on detection" | Macie → EventBridge → Lambda + SNS |
| "Permanently delete only a specific customer's rows" | Iceberg/Hudi row-level DELETE (+ snapshot cleanup) |
| "Data must not leave a specific Region" | SCP or bucket policy Region restriction |
Tomorrow we cover governance: finding data (catalog), trusting it (lineage), sharing it, and tracking it (auditing).
Click a choice to reveal the answer and explanation.
Question 1
You do not know which of thousands of S3 buckets store credit card numbers and national ID numbers. Which service automatically discovers the location and type of sensitive data?
Question 2
For payment analytics, you must join transactions by card number, but the original card number must be hidden. A privileged system must also be able to restore the original later. Which technique is the best fit?
Question 3
In Redshift, two roles query the same table. You want analysts to see only the last 4 digits of the card number and administrators to see the full number. Which feature is most appropriate?
Question 4
Right after Macie detects sensitive data, you want to automatically quarantine that bucket and notify the security team. Which architecture is most appropriate?
Question 5
Under the GDPR "right to be forgotten," you must permanently delete a specific customer's data from the data lake at the row level. Which approach is most appropriate?