Skip to content

Hands on example on using AWS Macie service for enhanced data privacy

License

Notifications You must be signed in to change notification settings

maxpoe/aws-macie-demo

Repository files navigation

Enhancing Data Privacy in AWS with Amazon Macie: Hands-On Demonstration

In today’s cloud-driven world, data privacy is paramount. Sensitive information—ranging from Personally Identifiable Information (PII) to financial records and intellectual property—demands rigorous protection. AWS Macie, a fully managed data security and data privacy service, offers a robust solution for identifying, classifying, and protecting such data. This hands-on guide demonstrates how to use AWS Macie to secure sensitive data within Amazon S3.

Table of contents

Introduction

1. What is AWS Macie?

AWS Macie is a data security service that uses machine learning and pattern matching to automatically detect, classify, and protect sensitive data in S3 buckets. Key benefits include:

  • Sensitive Data Discovery: Macie identifies and classifies sensitive data, including PII and intellectual property.
  • Risk Assessment: It evaluates data security and privacy risks, offering actionable insights for mitigation.
  • Compliance Support: Helps with regulatory compliance, supporting standards like GDPR, HIPAA, and CCPA.

2. Key Features of AWS Macie

AWS Macie provides the following core capabilities:

  • Automated Data Classification: Scans S3 to locate and classify sensitive data.
  • Risk and Compliance Insights: Offers insights to assess and enhance data security posture.
  • Integration with AWS Security Hub: Allows for centralized monitoring and incident response.

3. Best Practices for Maximizing AWS Macie’s Effectiveness

To make the most of AWS Macie, consider these best practices:

  • Regular Scans: Configure regular Macie scans to monitor changes in data security continuously.
  • Custom Identifiers: Leverage custom identifiers to detect organization-specific sensitive data.
  • Centralized Monitoring: Use Security Hub for a unified security overview, enabling proactive risk management.
  • Proactive Alerts: Configure EventBridge or CloudWatch alarms for immediate notification on high-risk findings.

Implementing AWS Macie

We’ll set up AWS Macie and integrate it with other AWS services. This guide walks through configuring Macie, automated with Terraform, and setting up monitoring pipelines, demonstrating Macie’s functionality with a structured example.

Demo Architecture

The terraform script provisions a couple of cloud ressources while enabling Macie on all buckets in the account.

Acrhitecture of demonstration

Requirements

  • Installation of Terraform CLI
  • Installation of AWS CLI
  • Installation of Git CLI

Step-by-Step Guide

  1. Clone repo to your machine.
  2. Export AWS_ACCESS_KEY and AWS_SECRET_KEY to environment variables.
  3. Duplicate the variables.tfvars.example file, rename it to variables.tfvars and adjust the values for "email"and "owner".
  4. Run terraform init.
  5. Run terraform apply to provision ressources.
  6. Go to AWS Console and explore AWS Macie. All resources deployed via this demo will have the same unique id associated. This ID will be with the outputs of the terraform provisioning.
  7. You will recieve an email to the chosen address. Click confirm to be able to recieve notifications from AWS Macie.
  8. Begin by exploring the provisioned infrastructure on the AWS Console. Get familiar with the AWS Macie dashboard, where data insights and security findings are displayed. The dashboard provides a high-level overview of active jobs, classification results, and data risk assessments.
  9. Configure up a dedicated S3 bucket for storing Macie findings. This bucket is already created by the terraform script. Configure to store to this bucket in the AWS Macie console.
  10. There is already a recurring macie job created with the infrastructure. Go ahead and explore the job.
  11. Go ahead and create a new macie one time job to learn how to setup such a job.
  12. You already provisioned a findings processor pipeline with the terraform script. Go ahaed and explore this pipeline in AWS Evenbridge, AWS Lambda and AWS SNS. Refer to the terraform script to see what you've created.

Conclusion

AWS Macie offers powerful capabilities to enhance data privacy within your AWS environment. Through this hands-on guide, you can deploy Macie efficiently using Terraform, integrating it with AWS services to automate data classification, processing, and compliance. By following the outlined steps and best practices, organizations can secure their sensitive data and ensure adherence to regulatory standards, safeguarding their cloud environment effectively.

Requirements

Name Version
aws ~> 5.0

Providers

Name Version
aws 5.68.0
null 3.2.3
random 3.6.3

Resources

Name Type
aws_cloudwatch_event_rule.macie-findings_rule resource
aws_cloudwatch_event_target.macie-findings-target resource
aws_iam_role.lambda_role-macie resource
aws_kms_alias.macie_demo-kms-key-alias resource
aws_kms_key.macie_demo-kms-key resource
aws_kms_key_policy.macie_demo-kms-policy resource
aws_lambda_function.macie_findings_function resource
aws_lambda_permission.allow_eventbridge resource
aws_macie2_account.macie resource
aws_macie2_classification_job.demo-job resource
aws_macie2_custom_data_identifier.macie_custom_data_identifier resource
aws_s3_bucket.macie_demo-bucket-sensitive resource
aws_s3_bucket.macie_demo-results-bucket resource
aws_s3_bucket_policy.allow_Macie_access_to_bucket resource
aws_s3_bucket_server_side_encryption_configuration.macie_demo-bucket_encryption resource
aws_s3_bucket_server_side_encryption_configuration.macie_demo-results-bucket_encryption resource
aws_s3_object.provision_sample-data resource
aws_sns_topic.macie_findings_topic resource
aws_sns_topic_subscription.email_subscription resource
null_resource.macie_sample_content resource
random_id.demo_unique-id resource
aws_caller_identity.current data source

Outputs

Name Description
resource_owner Name of the person who provisioned the resources for reference
sns_email Email Address for SNS topic subscription
unique_session_id_for_resources Unique ID of this demonstration for easy allocation

About

Hands on example on using AWS Macie service for enhanced data privacy

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks