Skip to the page
Tecyfy

AWS interview question · hard

How do you ensure data security and compliance in your data lake?

The short answerSecure a data lake in layers: control who can reach which data (IAM and Lake Formation), encrypt it, keep it private on the network, find and protect sensitive fields, and record and review every access.

The full answer

Secure a data lake in layers: control who can reach which data (IAM and Lake Formation), encrypt it, keep it private on the network, find and protect sensitive fields, and record and review every access.

1. Access control

  • AWS Lake Formation grants permissions on databases, tables and columns, with row and cell filters, and enforces them in Athena, Redshift Spectrum, EMR and Glue. It also shares tables with other accounts without copying data.
  • IAM roles for people (through IAM Identity Center) and for services, with least privilege. Avoid long-lived access keys.
  • S3: keep Block Public Access on, leave ACLs disabled (the default for new buckets), and use bucket policies, for example to allow access only through specific roles or VPC endpoints.
  • Use tag-based access control in Lake Formation so new tables tagged confidential are protected automatically.

2. Encryption

  • At rest: S3 encrypts every new object by default (SSE-S3); use SSE-KMS with customer managed keys for sensitive data, so key policies add a second permission check and key use is logged. S3 Bucket Keys reduce KMS request costs.
  • In transit: require TLS with a bucket policy that denies requests where aws:SecureTransport is false.

3. Network

  • Reach S3 and other services through VPC endpoints (gateway endpoints for S3, PrivateLink interface endpoints for others), and restrict buckets to those endpoints.

4. Sensitive data

  • Amazon Macie scans S3 for personal and financial data and reports where it is.
  • Glue sensitive data detection finds and masks personal data inside ETL jobs.
  • Mask, tokenise or remove sensitive columns in curated layers, and use Lake Formation column permissions to hide them from most users.

5. Auditing and monitoring

  • CloudTrail, including S3 data events and Lake Formation access logs, records who read what.
  • AWS Config rules flag drift, such as an unencrypted bucket.
  • GuardDuty detects suspicious access patterns.
  • Security Hub gathers findings in one place.

6. Retention and protection

  • Versioning and Object Lock protect against accidental or malicious deletion, and lifecycle rules delete data when retention periods end, which matters for regulations such as GDPR.
  • Audit Manager collects evidence for compliance frameworks.

A strong answer ties each control to a risk: Lake Formation for over-broad access, KMS for storage-level exposure, VPC endpoints for exfiltration, Macie for unknown personal data, and CloudTrail for proving who did what.

Last updated 16 October 2026