implementing-aws-macie-for-data-classification
Enable and configure Amazon Macie via AWS CLI/Terraform to discover, classify, and protect sensitive data (PII, financial data, credentials) in S3 using ML and pattern matching, including discovery jobs, custom data identifiers, allow lists, and EventBridge-based remediation. Use when setting up S3
v1.03 instalaciones+3 en 7 días36,3 mil EstrellasApache-2.0sincronizado hace 12 horas
Instalar
¿Aún no tienes la CLI de NotHoly? Instálala primero.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install mukul975/implementing-aws-macie-for-data-classificationEscribe en ~/.notholy/skills después de comprobar la firma y el SHA-256.
FirmaFirmado, ed25519
Paquete1b1ae583…fe8f2993
1b1ae583df0f…da93fe8f29938 archivos · 11.7 KBEscaneoMedio3 hallazgos
- Script ejecutable incluido con la skillscripts/agent.py
- Script ejecutable incluido con la skillscripts/process.py
- Enlaces a dominios externos
Fuentegithub.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/implementing-aws-macie-for-data-classification@54a7988
Esta entrada todavía no está escrita en tu idioma, así que aparece en English.
En esta página
Overview
Amazon Macie is a fully managed data security and privacy service that uses machine learning and pattern matching to discover and protect sensitive data in Amazon S3. Macie automatically evaluates your S3 bucket inventory on a daily basis and identifies objects containing PII, financial information, credentials, and other sensitive data types. It provides two discovery approaches: automated sensitive data discovery for broad visibility and targeted discovery jobs for deep analysis.
When to Use
- When deploying or configuring implementing aws macie for data classification capabilities in your environment
- When establishing security controls aligned to compliance requirements
- When building or improving security architecture for this domain
- When conducting security assessments that require this implementation
Prerequisites
- AWS account with S3 buckets containing data to classify
- IAM permissions for Macie service configuration
- AWS Organizations setup (for multi-account deployment)
- S3 buckets in supported regions
Enable Macie
Via AWS CLI
# Enable Macie in the current account/region
aws macie2 enable-macie
# Verify Macie is enabled
aws macie2 get-macie-session
# Enable automated sensitive data discovery
aws macie2 update-automated-discovery-configuration \
--status ENABLEDVia Terraform
resource "aws_macie2_account" "main" {}
resource "aws_macie2_classification_export_configuration" "main" {
depends_on = [aws_macie2_account.main]
s3_destination {
bucket_name = aws_s3_bucket.macie_results.id
key_prefix = "macie-findings/"
kms_key_arn = aws_kms_key.macie.arn
}
}Configure Discovery Jobs
Create a classification job for specific buckets
aws macie2 create-classification-job \
--job-type ONE_TIME \
--name "pii-scan-production-buckets" \
--s3-job-definition '{
"bucketDefinitions": [{
"accountId": "123456789012",
"buckets": [
"production-data-bucket",
"customer-records-bucket"
]
}]
}' \
--managed-data-identifier-selector ALLCreate a scheduled recurring job
aws macie2 create-classification-job \
--job-type SCHEDULED \
--name "weekly-sensitive-data-scan" \
--schedule-frequency-details '{
"weekly": {
"dayOfWeek": "MONDAY"
}
}' \
--s3-job-definition '{
"bucketDefinitions": [{
"accountId": "123456789012",
"buckets": ["all-data-bucket"]
}],
"scoping": {
"includes": {
"and": [{
"simpleScopeTerm": {
"comparator": "STARTS_WITH",
"key": "OBJECT_KEY",
"values": ["uploads/", "documents/"]
}
}]
}
}
}'Custom Data Identifiers
Create a custom identifier for internal IDs
aws macie2 create-custom-data-identifier \
--name "internal-employee-id" \
--description "Matches internal employee ID format EMP-XXXXXX" \
--regex "EMP-[0-9]{6}" \
--severity-levels '[
{"occurrencesThreshold": 1, "severity": "LOW"},
{"occurrencesThreshold": 10, "severity": "MEDIUM"},
{"occurrencesThreshold": 50, "severity": "HIGH"}
]'Create identifier for project codes
aws macie2 create-custom-data-identifier \
--name "project-code-identifier" \
--description "Matches project codes in format PRJ-XXXX-XX" \
--regex "PRJ-[A-Z]{4}-[0-9]{2}" \
--keywords '["project", "code", "initiative"]' \
--maximum-match-distance 50Allow Lists
Create an allow list to suppress false positives
aws macie2 create-allow-list \
--name "test-data-exclusions" \
--description "Exclude known test data patterns" \
--criteria '{
"regex": "TEST-[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}"
}'Managed Data Identifiers
Macie provides 300+ managed data identifiers covering:
| Category | Examples |
|---|---|
| PII | SSN, passport numbers, driver's license, date of birth, names, addresses |
| Financial | Credit card numbers, bank account numbers, SWIFT codes |
| Credentials | AWS secret keys, API keys, SSH private keys, OAuth tokens |
| Health | HIPAA identifiers, health insurance claim numbers |
| Legal | Tax identification numbers, national ID numbers |
Findings Management
List findings
# Get sensitive data findings
aws macie2 list-findings \
--finding-criteria '{
"criterion": {
"severity.description": {
"eq": ["High"]
},
"category": {
"eq": ["CLASSIFICATION"]
}
}
}' \
--sort-criteria '{"attributeName": "updatedAt", "orderBy": "DESC"}' \
--max-results 25Get finding details
aws macie2 get-findings \
--finding-ids '["finding-id-1", "finding-id-2"]'Export findings to Security Hub
# Macie automatically publishes findings to Security Hub
# Verify integration:
aws macie2 get-macie-session --query 'findingPublishingFrequency'EventBridge Integration for Automated Response
{
"source": ["aws.macie"],
"detail-type": ["Macie Finding"],
"detail": {
"severity": {
"description": ["High", "Critical"]
}
}
}Lambda function for automated remediation
import boto3
import json
s3 = boto3.client('s3')
sns = boto3.client('sns')
def lambda_handler(event, context):
finding = event['detail']
severity = finding['severity']['description']
bucket = finding['resourcesAffected']['s3Bucket']['name']
key = finding['resourcesAffected']['s3Object']['key']
sensitive_types = [d['type'] for d in finding.get('classificationDetails', {}).get('result', {}).get('sensitiveData', [])]
if severity in ['High', 'Critical']:
# Tag the object for review
s3.put_object_tagging(
Bucket=bucket,
Key=key,
Tagging={
'TagSet': [
{'Key': 'macie-finding', 'Value': severity},
{'Key': 'sensitive-data', 'Value': ','.join(sensitive_types)},
{'Key': 'requires-review', 'Value': 'true'}
]
}
)
# Notify security team
sns.publish(
TopicArn='arn:aws:sns:us-east-1:123456789012:security-alerts',
Subject=f'Macie {severity} Finding: {bucket}/{key}',
Message=json.dumps({
'bucket': bucket,
'key': key,
'severity': severity,
'sensitive_data_types': sensitive_types,
'finding_id': finding['id']
}, indent=2)
)
return {'statusCode': 200}Multi-Account Deployment
Designate Macie administrator account
# From the management account
aws macie2 enable-organization-admin-account \
--admin-account-id 111111111111Add member accounts
# From the administrator account
aws macie2 create-member \
--account '{"accountId": "222222222222", "email": "[email protected]"}'Monitoring Macie Operations
Usage statistics
aws macie2 get-usage-statistics \
--filter-by '[{"comparator": "GT", "key": "accountId", "values": []}]' \
--sort-by '{"key": "accountId", "orderBy": "ASC"}'Classification job status
aws macie2 list-classification-jobs \
--filter-criteria '{"includes": [{"comparator": "EQ", "key": "jobStatus", "values": ["RUNNING"]}]}'References
- AWS Macie Documentation: https://docs.aws.amazon.com/macie/
- AWS Macie Pricing
- Supported File Types for Macie Analysis
- GDPR and CCPA Compliance with Macie
Archivos de esta versión
assets/1775 B
- template.md775 B
references/33.4 KB
- api-reference.md2.0 KB
- standards.md625 B
- workflows.md823 B
scripts/211.5 KB
- agent.py6.0 KB
- process.py5.5 KB
- LICENSE11.0 KB
- SKILL.md8.3 KB
Permisos
| Permiso | Declarado | Hallado en el escaneo |
|---|---|---|
| Lee archivos | No | No |
| Escribe archivos | Sí | Sí |
| Ejecuta comandos de shell | Sí | Sí |
| Usa la red | Sí | Sí |
| Usa conectores | No | No |
| Controla un navegador | No | No |
Hallazgos del escaneo
Revisado el 13 nov 2026
- MediaArchivo · Script ejecutable incluido con la skillscripts/agent.py
- MediaArchivo · Script ejecutable incluido con la skillscripts/process.py
- InfoEnlace · Enlaces a dominios externos
Un escaneo limpio baja el riesgo, pero no prueba que el paquete sea seguro. Lee lo que instalas.
| Versión | Publicada | Commit | SHA-256 | Firma | Cambio de permisos |
|---|---|---|---|---|---|
| v1.0 | 13 nov 2026 | 54a7988 | 1b1ae583 | Firmada | – |
Más de mukul975
Todo de este publicador- testing-for-xml-injection-vulnerabilitiesmukul975/testing-for-xml-injection-vulnerabilities5
- testing-for-sensitive-data-exposuremukul975/testing-for-sensitive-data-exposure5
- performing-jwt-none-algorithm-attackmukul975/performing-jwt-none-algorithm-attack5
- detecting-aws-credential-exposure-with-trufflehogmukul975/detecting-aws-credential-exposure-with-trufflehog5
Más en Linux, cloud y contenedores
Ver la categoría- cloud-gcpnoorqureshi/cloud-gcp4
- container-image-hardeningsecurityskills/container-image-hardening3
- performing-cloud-incident-containment-proceduresmukul975/performing-cloud-incident-containment-procedures3
- implementing-taxii-server-with-opentaxiimukul975/implementing-taxii-server-with-opentaxii3
- detecting-cryptomining-in-cloudmukul975/detecting-cryptomining-in-cloud3
- detecting-azure-service-principal-abusemukul975/detecting-azure-service-principal-abuse3
Pregunta todo lo que tu alcance permite.
Crea la cuenta, añade créditos y haz la primera pregunta en el chat o en la terminal.
- 1/3
Crea la cuenta
Individual o empresa. Puedes pasar a empresa después sin perder saldo ni claves.
IndividualEmpresa - 2/3
Añade créditos
Con tarjeta. Pagas por token, sin suscripción.
$5.00recarga mínima - 3/3
Pregunta
En el chat, o instala el CLI y ejecuta notholy login en tu terminal.
$ notholy login