Data Privacy and Governance: Macie, Redshift Sharing, Config, and Sovereignty
Data governance on AWS is the set of controls that answer four questions: where is our sensitive data, who may use it, where is it allowed to live, and what changed. Amazon Macie answers the first by scanning S3 to find PII, and AWS Lake Formation turns those findings into column-level restrictions. Controlled sharing answers the second — Amazon Redshift datashares grant live access to warehouse data without copying it, and Amazon SageMaker Catalog projects put a publish-subscribe-approve workflow around data assets. Service control policies and replication controls answer the third, keeping data out of disallowed AWS Regions to maintain sovereignty. AWS Config, alongside CloudTrail, answers the fourth by recording each resource's configuration history. The DEA-C01 exam tests each mechanism and, above all, whether you can match a governance requirement to the one control built for it — and spot the near-miss that looks right but leaves a gap. This lesson covers all four pillars plus the governance-framework vocabulary and data sharing patterns.
On this page8 sections
- Finding PII with Amazon Macie
- From discovery to enforcement: Macie with Lake Formation
- Sharing warehouse data with Amazon Redshift datashares
- Keeping data out of disallowed Regions
- Viewing configuration changes with AWS Config
- Maintaining data sovereignty
- SageMaker Catalog projects and governed self-service access
- Governance frameworks and data sharing patterns
- Implement PII identification with Amazon Macie, tune custom data identifiers, and choose between discovery jobs and automated discovery
- Turn Macie findings into Lake Formation LF-tag and column-level controls that Athena actually enforces
- Grant same-account and cross-account access to warehouse data with Amazon Redshift datashares, including prerequisites and who pays for compute
- Prevent backups and replication of data to disallowed AWS Regions using SCPs and controls on replication and copy actions
- View configuration history with AWS Config and CloudTrail event history, and auto-remediate drift with Config rules and Systems Manager runbooks
- Design for data sovereignty, distinguishing storage residency from key residency
- Manage data access through SageMaker Catalog projects and subscriptions, and name governance frameworks and in-place versus copy-based sharing patterns
Finding PII with Amazon Macie
Amazon Macie is the AWS service that discovers sensitive data in Amazon S3 — it does not protect, mask, move or block anything itself; it tells you where the risk is. Macie detects data with managed data identifiers, built-in detectors for common categories such as names, addresses, credit card and passport numbers, national ID numbers and credentials, and with custom data identifiers that you define for organization-specific values such as internal staff IDs or contract numbers. Macie inspects S3 objects only; it does not scan Amazon RDS, DynamoDB or other data stores directly.
Tuning custom data identifiers
A custom data identifier is a regular expression plus optional refinements, and each refinement solves a different false-positive problem:
| Setting | What it does | Use it when |
|---|---|---|
| Keywords + maximum match distance | Text counts only if it follows a keyword within the maximum match distance — the number of characters between the end of the keyword and the end of the matched text (1–300, default 50). In CSV and spreadsheets a keyword in the column name also qualifies. | Genuine values always appear near a label (for example a word like "badge" before a staff ID) and look-alike values do not. |
| Ignore words | Drops a match if the matched text itself contains the ignore word. | Unwanted values contain a known string inside the match; a word elsewhere in the file has no effect. |
| Allow lists | Lists of exact text or regex patterns, attached to jobs or automated discovery, that Macie ignores for managed and custom identifiers alike. | Specific known-safe values (a public support phone number, sample data) keep being reported. |
| Severity occurrence thresholds | Set Low/Medium/High severity by how many matches an object contains, and skip findings below the lowest threshold. | You want to rank findings by volume — it does not remove false matches inside an object. |
Custom data identifiers cannot be edited after creation (this keeps the history of findings immutable for audits), and a discovery job's settings cannot be changed once created either. To change detection criteria you create a new identifier — test it first with the console's Evaluate option or the TestCustomDataIdentifier API — and use it in new jobs, or copy an existing job and select the new identifier.
Discovery jobs versus automated discovery
Macie finds sensitive data in two ways, and the choice turns on coverage versus cost:
| Sensitive data discovery job | Automated sensitive data discovery | |
|---|---|---|
| Scope | Buckets and objects you select (by name or criteria) | All eligible buckets in the account or organization |
| Coverage | Every object in scope at the default 100% sampling depth; a lower depth inspects only that percentage of objects | Samples representative objects daily; never proves every object was inspected |
| Timing | One-time, or scheduled (daily/weekly/monthly); by default a scheduled job's first run covers existing objects (you can choose to skip them) and later runs only new or changed objects | Continuous, building a sensitivity score per bucket |
| Best for | Proof that a specific bucket was fully inspected; targeted audits | Low-cost, ongoing estate-wide visibility |
The two combine: keep automated discovery running for the estate and add a one-time job at 100% sampling depth when a regulator or merger needs evidence that every object in one bucket was checked. Separately from content scanning, Macie keeps an S3 bucket inventory and raises policy findings when a bucket's settings change to public access, to shared or replicated with accounts outside your Macie organization, or to default encryption reverted to SSE-S3 — these assess bucket configuration, never object contents.
Macie is organization-aware: a delegated administrator account manages it for all member accounts. Findings are published to Amazon EventBridge and AWS Security Hub CSPM, and EventBridge is the automation hook — a finding can trigger a Lambda function that tags data, moves an object to a quarantine bucket or opens a ticket. Any requirement to discover, classify or inventory PII in S3 resolves to Macie (not GuardDuty, which detects threats; Inspector, which finds software vulnerabilities; or Comprehend, which detects PII in text you send it and has no integration with Macie findings); requirements to restrict or mask the PII you found resolve to Lake Formation or masking features.
From discovery to enforcement: Macie with Lake Formation
Macie identifies the PII and AWS Lake Formation enforces who can read it — the exam guide names this pairing explicitly. The pattern is a pipeline: Macie finds sensitive data in data lake objects; an EventBridge rule on the finding runs automation that records it as governance metadata, typically a Lake Formation LF-tag such as a classification key with values like public and pii; and Lake Formation tag-based access control (LF-TBAC) grants query access by tag instead of table by table.
How LF-tags make this scale
- Inheritance: a tag assigned to a database is inherited by its tables, and a table's tags by its columns. A column can override the inherited value with a different value of the same key.
- Expressions match values, they cannot negate: in a grant expression, different keys are ANDed and multiple values of one key are ORed, but there is no "not pii". So you cannot grant on "everything except pii".
- The working pattern: tag each database classification=public so every new table and column inherits it, grant analysts SELECT on classification=public, and have the Macie-driven automation override only the sensitive columns to classification=pii. New tables are covered automatically, and an overridden column silently drops out of the analysts' results — no per-table grants or per-table data filters to maintain.
Lake Formation also supports direct column-level grants (SELECT on a table with named columns excluded) and data filters for row-level and cell-level security; these suit a handful of tables, while LF-tags suit a lake that grows weekly.
Conditions for the controls to actually apply
- Athena (and Redshift Spectrum, EMR) enforce Lake Formation column permissions only when the table's S3 location is registered with Lake Formation and the default IAMAllowedPrincipals grant has been removed, so access is no longer decided by IAM alone.
- An Athena view that omits columns is not a security boundary if the same role can still query the base table.
- IAM or S3 object-level denies are all-or-nothing per file: every file holds all of a row's columns, so they cannot hide individual columns.
A concrete loop: a healthcare platform lands files daily; automated discovery flags patient identifiers in a new table; EventBridge runs a Lambda that overrides those columns' tag to pii; from then on the general analytics role's Athena queries no longer return those columns, while a clinical-research role granted on pii keeps access — nothing was copied or manually re-permissioned. Detect, tag, enforce is the answer shape to look for.
Keeping data out of disallowed Regions
Preventing data from reaching disallowed AWS Regions is a preventive-control problem, and the strongest tool is a service control policy (SCP) in AWS Organizations. An SCP attached to the organization root (or the relevant OUs) that denies requests whose aws:RequestedRegion is outside an approved list applies to every principal in every member account — including account administrators — and to accounts added later. Exempt the global services that operate through a single Region endpoint (IAM, Organizations, Route 53, CloudFront, Support and similar) so identity management keeps working. AWS Control Tower packages the same guardrail as its Region deny control.
Know the scope limits:
- SCPs never restrict the organization's management account, so the guardrail covers member accounts only — keep workloads out of the management account.
- Alternatives are weaker: a permissions boundary must be attached role by role and administrators can change it; Config rules and EventBridge alerts on CloudTrail events detect after the fact rather than prevent.
Side doors a Region-deny SCP does not close
Several features copy data to another Region while every API call is made in an allowed Region. S3 Cross-Region Replication is the classic case: the replication rule is created by s3:PutReplicationConfiguration on the source bucket, in the allowed Region, so aws:RequestedRegion passes; and if the destination bucket belongs to an account outside your organization, nothing in your SCPs applies to it at all. Close it by denying s3:PutReplicationConfiguration (except for an approved platform role) in the SCP. The same reasoning covers DynamoDB global table replicas (deny the table-update actions that add replicas), Redshift cross-Region snapshot copy, AWS Backup cross-Region copy jobs, and AMI or EBS snapshot copies — each legitimate for disaster recovery and each a sovereignty leak if ungoverned. Blocking s3:CreateBucket in other Regions does not help when the destination bucket already exists in another account, and S3 Block Public Access solves a different problem (public exposure, not location).
Detection backs up prevention: AWS Config (next section) can reveal any resource that nonetheless exists in an unexpected Region — but only if Config records in every Region, because a Region where the recorder is off reports nothing. An organization aggregator then shows those resources centrally. Macie policy findings flag buckets shared or replicated with accounts outside the Macie organization (the accounts it manages together through AWS Organizations or invitation). The layers: SCP = preventive; Config = detective.
Viewing configuration changes with AWS Config
AWS Config answers "what did this resource look like, how did it change, and is it compliant": it records the configuration of supported resources as configuration items and keeps a resource timeline, so you can open an S3 bucket, security group or Redshift cluster and see its exact settings at any past point and the before-and-after values of each change. CloudTrail is the other half: it records who made the API call.
| Question | Where the answer lives |
|---|---|
| Who changed it, and when? | CloudTrail. Event history keeps the last 90 days of management events (for example PutBucketPolicy) in every account with no trail configured. A trail is needed for longer retention or data events, and a trail created today does not backfill earlier events. |
| What was the configuration before / after? | The AWS Config resource timeline (configuration items), for as long as Config was recording. |
| Is it compliant right now? | Config rule evaluations and IAM Access Analyzer findings — these show current status, not the earlier configuration. |
| What traffic flowed? | VPC Flow Logs — network records, not configuration. |
Rules and automatic remediation
Config rules evaluate resources on change or periodically. Managed rules cover common cases — for example a rule that checks S3 buckets use SSE-KMS default encryption (with an optional list of allowed KMS keys), public-access checks, encrypted volumes, required tags — and custom rules (Lambda or Guard) express anything else. Note that since January 2023 every S3 bucket has SSE-S3 default encryption, so the realistic drift is a bucket moved from SSE-KMS with your key back to SSE-S3, not an unencrypted bucket.
Remediation options differ in how much code you own:
- Config rule + automatic remediation with an AWS-owned Systems Manager Automation runbook — corrects drift within minutes, no custom code; you supply parameters such as the KMS key.
- EventBridge rule on the CloudTrail event + a Lambda function — works, but it is custom code to write and maintain.
- Config rule + SNS notification — detection only; a person still fixes it.
- An SCP denying the change — preventive, but it also blocks legitimate changes and does not correct existing drift.
Organization scale
Conformance packs bundle rules and remediation into a deployable baseline that changes what each account evaluates. An aggregator does not evaluate anything; it collects configuration and compliance data from many accounts and Regions (or the whole organization) into one view in a delegated administrator account. One consolidated view without changing per-account evaluation is an aggregator; pushing a standard set of rules is a conformance pack.
For a data platform, Config is how you prove the posture you claim: that data buckets have kept SSE-KMS and public access blocks, that no Redshift cluster was ever publicly accessible, that a widened security group was remediated within minutes. Trusted Advisor checks AWS best practices, not your own policies or history.
Maintaining data sovereignty
Data sovereignty means data stays subject to the laws of the jurisdiction where it is stored — and often must physically stay there. The foundational AWS property is that customer data in a Region does not leave it unless you move it: S3, Redshift, DynamoDB (without global tables) and EBS store data regionally. Sovereignty engineering is therefore mostly the discipline of not moving it — the Region-deny SCP and the replication controls above are the enforcement half.
Storage residency is not key residency. Keeping encryption keys in-country — single-Region KMS keys in an approved Region, or an external key store whose keys sit in an in-country HSM — controls who can decrypt, which is valuable, but it does not satisfy a mandate that the data itself be stored and processed in the country. Ciphertext stored in a foreign Region is still data stored abroad. Likewise, creating every KMS key in one Region does not stop anyone storing data elsewhere (it can be encrypted with another key or not use KMS at all). Multi-Region keys exist to make ciphertext portable across Regions, the opposite of what most sovereignty mandates want.
Other near-misses: Amazon CloudFront geo restriction controls which countries can receive content, not where data is stored; and a disaster-recovery replica in a foreign Region breaks a residency mandate however it is encrypted — recovery copies must go to another approved, in-jurisdiction Region. When users abroad need the data, the residency-safe answer is to serve their queries against the single in-country store (accepting the latency) rather than replicate it outward to be near them.
The full posture for "customer data must stay in country X": provision only in the approved Regions; deny every other Region with an organization SCP plus the cross-Region copy and replication actions; encrypt with customer managed keys in those Regions; record AWS Config in all Regions with an organization aggregator to surface anything outside them; and keep the evidence trail in CloudTrail and Config history, including CloudTrail's record of every KMS key use. That stacks a preventive control (SCP), a data-layer control (regional keys) and a detective control (Config) rather than relying on any single mechanism.
SageMaker Catalog projects and governed self-service access
Amazon SageMaker Catalog is the business data catalog inside Amazon SageMaker Unified Studio, and it manages data access through a publish-and-subscribe model built on projects. Producers publish data assets — Glue Data Catalog tables, Redshift tables — into the catalog with business metadata and glossary terms so consumers can find and understand them. Consumers work inside projects: governed workspaces that bundle team members, tools and the data the project has been granted. When a project needs a published asset, a project member requests a subscription; the publishing project (the data owner) approves or rejects it; and on approval the underlying grants (Lake Formation permissions for lake tables, Redshift access for warehouse tables) are fulfilled automatically to the subscribing project.
The governance value is the workflow itself: access is requested against a curated catalog, approved by the owner accountable for the data, scoped to a project rather than an individual, and recorded. The anti-patterns are the shortcuts — hand-written bucket policies for another team's roles, copying the data into the consumer's own storage, or adding consumers as members of the owner's project (which gives them the owner's whole workspace rather than one approved asset). Domains and domain units mirror the organization's structure, so approval authority sits with the business units that steward each data area.
Differentiate the catalogs: the AWS Glue Data Catalog is the technical metastore (schemas, partitions, locations) that query engines depend on; SageMaker Catalog is the business layer on top — discovery, semantics, ownership and the subscription workflow. Crawlers, partitions or Hive-compatible metadata mean Glue; publishing assets, approval workflows, projects or self-service requests mean SageMaker Catalog.
Governance frameworks and data sharing patterns
A data governance framework is the organizational system that keeps data trustworthy and compliant: policies defining classification levels and handling rules; named roles — data owners accountable for each domain and data stewards maintaining quality and metadata; cataloging so data is findable with its meaning and sensitivity attached; lineage so any dataset can be traced to its sources and transformations; quality controls; and auditability. The AWS services in this lesson are the mechanical enforcement of that framework — Macie implements classification, SageMaker Catalog implements cataloging and stewardship workflows, Lake Formation implements access policy, and Config and CloudTrail implement auditability.
Data sharing patterns describe how data moves between producers and consumers. The first question is whether consumers query the producer's data in place or receive a copy.
| Pattern | In place or copy? | AWS implementation | Trade-off |
|---|---|---|---|
| Centralized data lake | In place | Lake Formation cross-account grants on a central S3 lake, queried by consumers with Athena | Strong control; the central team can bottleneck |
| Data mesh | In place | Domain accounts own their data; Lake Formation cross-account grants plus a shared SageMaker Catalog for discovery and subscriptions | Scales ownership; needs mature stewardship |
| Warehouse live sharing | In place | Redshift datashares (same or cross account or Region) | Always current; consumers must be Redshift |
| Copy-based distribution | Copy | S3 replication, Redshift UNLOAD, shared Redshift snapshots (the consumer restores its own copy), zero-ETL integrations (for example Aurora to Redshift, which replicate data into the target warehouse) | Works anywhere and isolates consumers; data is duplicated and can lag |
| Commercial exchange | Either | AWS Data Exchange (files, APIs, Redshift datashares) | Managed licensing and billing; external subscribers |
Signal words: "one team governs all data" points at the centralized lake; "domains own and serve their data as products, discovered in one catalog under common standards" is the mesh; "zero-copy, always current, warehouse to warehouse" is a datashare; "license or monetize datasets to external organizations" is AWS Data Exchange. When a mandate forbids copies in consumer accounts, eliminate zero-ETL, snapshot sharing and replication even though they are convenient — they all create data in the consumer's account.
Tip. Expect scenario questions that hinge on a near-miss: Macie (not GuardDuty, Inspector or Comprehend) for PII in S3; custom data identifiers tuned with keywords and match distance and replaced rather than edited; automated discovery versus a 100% one-time job; LF-tag inheritance with column overrides and Athena enforcement conditions; Redshift datashares for zero-copy, consumer-billed access (RA3 or Serverless, encryption rules, authorize-then-associate, CREATE DATABASE FROM DATASHARE); Region-deny SCPs and the replication side doors they miss; CloudTrail event history versus the Config timeline, Config remediation without custom code, and aggregators versus conformance packs; storage versus key residency for sovereignty; SageMaker Catalog subscriptions; and naming in-place versus copy-based sharing patterns.
- Amazon Macie discovers sensitive data in S3 only (managed and custom identifiers, policy findings, EventBridge and Security Hub CSPM output) and never masks, blocks or moves data itself.
- Custom data identifiers are immutable: refine false matches with keywords and a maximum match distance (or ignore words inside the match), then create a replacement identifier and use it in new or copied jobs.
- Automated discovery samples the estate continuously at low cost but never proves full coverage; a one-time job at 100% sampling depth does; scheduled jobs inspect only new or changed objects after their first run (which by default includes existing objects).
- Detect-tag-enforce: Macie findings drive automation that overrides inherited LF-tags on sensitive columns; analysts are granted on the default public tag, because tag expressions cannot negate — and Athena enforces it only for registered locations with IAMAllowedPrincipals removed.
- Redshift datashares give live, zero-copy access on the consumer's own (and consumer-billed) compute; both sides need RA3 or Serverless; cross-account needs encryption on both sides, producer authorization and consumer association plus CREATE DATABASE FROM DATASHARE.
- A Region-deny SCP on aws:RequestedRegion is the preventive guardrail for member accounts (never the management account); separately deny replication and copy actions such as s3:PutReplicationConfiguration, which an allowed-Region call can aim abroad.
- CloudTrail event history shows who made a management call in the last 90 days without any trail; the AWS Config timeline shows what the configuration was before and after; Config rules with SSM Automation remediation fix drift without custom code, and an aggregator gives one organization-wide view.
- Sovereignty means the data itself stays in approved Regions — in-country keys, CloudFront geo restriction or a foreign DR replica do not satisfy it; stack SCPs, regional keys and Config recording in every Region.
- SageMaker Catalog access is a subscription request approved by the publishing owner; know the sharing patterns, and that zero-ETL, shared snapshots and replication are copy-based while Lake Formation grants and datashares are in place.
Frequently asked questions
What does Amazon Macie actually do, and what does it not do?
Amazon Macie discovers sensitive data such as PII and credentials in Amazon S3 objects, using managed data identifiers and your own custom data identifiers, through targeted discovery jobs or continuous automated discovery, and it raises policy findings when bucket settings become public, revert to SSE-S3 default encryption, or share or replicate data outside the Macie organization. It does not scan RDS or DynamoDB directly, and it does not mask, encrypt, block or quarantine anything by itself. Findings go to Amazon EventBridge and AWS Security Hub CSPM, where automation — commonly applying Lake Formation tags or moving objects — turns discovery into enforcement.
How do I reduce false positives from an Amazon Macie custom data identifier?
Add a keyword that genuine values always follow, with a short maximum match distance (the characters between the end of the keyword and the end of the matched text), or add ignore words that appear inside the unwanted matched text; use an allow list for specific known-safe values. Custom data identifiers cannot be edited after creation, so create and test a replacement identifier and use it in new or copied discovery jobs. Severity occurrence thresholds rank findings by match count but do not remove false matches.
When should I use a Macie discovery job instead of automated sensitive data discovery?
Use automated sensitive data discovery for low-cost, continuous visibility across all buckets; it samples objects and so never proves that every object was inspected. Use a one-time sensitive data discovery job at 100% sampling depth when you must show that every object in specific buckets was checked. The two run side by side. By default a scheduled job inspects all existing objects on its first run (this can be turned off) and only new or changed objects afterwards.
How does cross-account Amazon Redshift data sharing work?
The producer creates a datashare, adds schemas, tables or views, and runs GRANT USAGE ON DATASHARE to the consumer AWS account; a producer administrator authorizes the datashare; a consumer administrator associates it with the account or specific namespaces; and the consumer runs CREATE DATABASE FROM DATASHARE and grants its users access to that database. Both sides need RA3 nodes or Redshift Serverless and must be encrypted, though not with the same key and without KMS key-policy changes. Consumers query live data on their own compute, which is billed to the consumer.
How do I prevent data from being replicated or backed up to a disallowed AWS Region?
Attach an AWS Organizations SCP that denies requests whose aws:RequestedRegion is outside your approved list, exempting global services; it binds every member account, including administrators, but never the management account. Then deny the actions that move data across Regions from an allowed one — s3:PutReplicationConfiguration, adding DynamoDB global table replicas, and cross-Region snapshot, AMI or AWS Backup copies — because those calls are made in an allowed Region. Record AWS Config in all Regions with an aggregator to detect anything that slips through.
What is the difference between AWS Config and AWS CloudTrail for auditing a change?
CloudTrail records API calls — who did what and when; its event history keeps 90 days of management events even with no trail, and a trail created later does not backfill. AWS Config records the resulting resource configuration over time, so its resource timeline shows the exact settings before and after each change, and its rules evaluate compliance with optional automatic remediation through Systems Manager Automation runbooks. An investigation usually needs both.
What are SageMaker Catalog projects and how do they manage data access?
Projects are governed workspaces in Amazon SageMaker Unified Studio that bundle team members, tools and approved data. Producers publish assets to SageMaker Catalog with business metadata; a member of a consuming project requests a subscription to an asset; the publishing owner approves or rejects it; and on approval the platform fulfills the underlying Lake Formation or Redshift grants to the subscribing project. Access is requested through a catalog, approved by accountable owners, scoped to projects and auditable.
What is the difference between a centralized data lake and a data mesh?
In a centralized data lake one platform account owns storage, cataloging and permissions and grants consumers access inward — uniform control, but a possible bottleneck. In a data mesh, domain teams own and serve their data as products while federated governance sets shared standards; on AWS this maps to Lake Formation cross-account grants plus a shared SageMaker Catalog for discovery and subscriptions. Both let consumers query data in place, unlike copy-based patterns such as replication or zero-ETL integrations.
Source
This lesson covers the "Data Security and Governance" domain of the official DEA-C01 exam guide. Vendors revise their guides — check the source for the current version.
- AWS Certified Data Engineer – Associate (DEA-C01) exam guide — Amazon Web Services
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.