Guide · Amazon Macie · Findings
Macie Findings for MCP Servers — ListFindings, EventBridge Integration, and Suppression Rules
Amazon Macie findings are the actionable output of both continuous bucket monitoring (policy findings) and active classification jobs (sensitive data findings). For MCP server teams, findings answer two questions: "which S3 buckets powering our MCP tools have security misconfigurations?" and "which objects do we need to quarantine before an agent reads them?" This guide covers how to query findings via the API, how to wire EventBridge to react to new findings automatically, and how to use suppression rules to silence low-signal noise so critical findings remain visible.
TL;DR
Macie produces two finding categories: Policy:* (bucket misconfigurations — public access, encryption gaps, ACL changes) and SensitiveData:* (content found by classification jobs — PII, credentials, financial data). Query them with ListFindingsCommand + GetFindingsCommand. React in real time via EventBridge events (source: aws.macie, detail-type: Macie Finding). Suppress noisy policy findings with CreateFindingsFilterCommand using action: SUPPRESS.
Finding types and severity
Macie findings fall into two top-level categories, each with subtypes:
| Category | Finding type | Trigger |
|---|---|---|
| Policy | Policy:IAMUser/S3BucketPubliclyAccessible |
Bucket effective permission changed to PUBLIC |
Policy:IAMUser/S3BucketEncryptionDisabled |
Default encryption removed or changed to NONE |
|
Policy:IAMUser/S3BlockPublicAccessDisabled |
S3 Block Public Access settings weakened | |
Policy:IAMUser/S3BucketReplicationEnabledWithPublicAccess |
Replication destination is publicly accessible | |
| SensitiveData | SensitiveData:S3Object/Credentials |
Classification job found API keys, AWS credentials, private keys |
SensitiveData:S3Object/Financial |
Credit card numbers, IBAN, routing numbers | |
SensitiveData:S3Object/Personal |
SSNs, passport numbers, driver's licenses, PII | |
SensitiveData:S3Object/CustomIdentifier |
Match from one of your custom data identifiers |
Findings have three severity levels: LOW, MEDIUM, and HIGH. Policy findings are typically HIGH (a bucket going public is immediately critical). Sensitive data findings are severity-scored based on data type and occurrence count — a single IP address in a log file is LOW; multiple credit card numbers in a document are HIGH.
Listing findings with filters
import {
Macie2Client,
ListFindingsCommand,
GetFindingsCommand,
FindingCategory,
SeverityDescription,
} from "@aws-sdk/client-macie2";
const macie = new Macie2Client({ region: "us-east-1" });
// List all HIGH severity findings from the last 24 hours
const yesterday = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
const { findingIds } = await macie.send(new ListFindingsCommand({
findingCriteria: {
criterion: {
"severity.description": {
eq: [SeverityDescription.HIGH],
},
"updatedAt": {
gte: new Date(yesterday).getTime(), // milliseconds since epoch
},
},
},
sortCriteria: {
attributeName: "updatedAt",
orderBy: "DESC",
},
maxResults: 25,
}));
console.log("High severity findings in last 24h:", findingIds?.length ?? 0);
ListFindingsCommand returns an array of finding IDs. Fetch the full finding details in a separate GetFindingsCommand call (maximum 25 IDs per call):
if (findingIds && findingIds.length > 0) {
const { findings } = await macie.send(new GetFindingsCommand({
findingIds: findingIds.slice(0, 25),
sortCriteria: {
attributeName: "updatedAt",
orderBy: "DESC",
},
}));
for (const finding of findings ?? []) {
console.log(
finding.type, // e.g. "SensitiveData:S3Object/Credentials"
finding.severity?.description, // "HIGH" | "MEDIUM" | "LOW"
finding.resourcesAffected?.s3Bucket?.name,
finding.resourcesAffected?.s3Object?.key,
finding.count, // aggregated occurrence count
finding.isNew, // true if not seen before
);
// For sensitive data findings: which categories were found?
for (const detection of finding.classificationDetails?.result?.sensitiveData ?? []) {
console.log(" Category:", detection.category, "Occurrences:", detection.totalCount);
}
}
}
Filtering by finding category and bucket
For MCP server use cases, you typically care about findings on specific buckets. The findingCriteria.criterion map supports any finding field path as a dotted string:
// Get sensitive data findings on a specific bucket
const { findingIds: sensitiveFindingIds } = await macie.send(new ListFindingsCommand({
findingCriteria: {
criterion: {
"category": {
eq: [FindingCategory.SENSITIVE_DATA],
},
"resourcesAffected.s3Bucket.name": {
eq: ["mcp-document-store-prod"],
},
"archived": {
eq: ["false"], // Only active (non-suppressed) findings
},
},
},
}));
// Get policy findings across all buckets tagged with mcp-data-source
const { findingIds: policyFindingIds } = await macie.send(new ListFindingsCommand({
findingCriteria: {
criterion: {
"category": {
eq: [FindingCategory.POLICY],
},
"resourcesAffected.s3Bucket.tags.key": {
eq: ["mcp-data-source"],
},
},
},
}));
EventBridge integration — real-time finding notifications
Macie publishes every new finding to EventBridge automatically (no additional configuration required). The events appear in the default event bus with:
source:"aws.macie"detail-type:"Macie Finding"
The detail payload is the full finding object in Macie's JSON schema. Create an EventBridge rule to route findings to a Lambda function that handles the security response:
{
"source": ["aws.macie"],
"detail-type": ["Macie Finding"],
"detail": {
"severity": {
"description": ["High"]
},
"type": [
"SensitiveData:S3Object/Credentials",
"Policy:IAMUser/S3BucketPubliclyAccessible"
]
}
}
In the Lambda handler, extract the affected resource and trigger the response action:
import { S3Client, PutBucketTaggingCommand, GetBucketTaggingCommand } from "@aws-sdk/client-s3";
export const handler = async (event: any): Promise<void> => {
const finding = event.detail;
const bucketName = finding.resourcesAffected?.s3Bucket?.name;
const objectKey = finding.resourcesAffected?.s3Object?.key;
const findingType: string = finding.type;
if (!bucketName) return;
const s3 = new S3Client({ region: process.env.AWS_REGION });
if (findingType.startsWith("SensitiveData:")) {
// Quarantine: add tag that blocks MCP tool IAM access
const { TagSet } = await s3.send(new GetBucketTaggingCommand({ Bucket: bucketName })).catch(() => ({ TagSet: [] }));
await s3.send(new PutBucketTaggingCommand({
Bucket: bucketName,
Tagging: {
TagSet: [
...((TagSet ?? []).filter(t => t.Key !== "mcp-data-source")),
{ Key: "mcp-data-source", Value: "quarantine" },
{ Key: "macie-finding-id", Value: finding.id },
],
},
}));
console.log(`Quarantined bucket ${bucketName} due to ${findingType} finding on object ${objectKey}`);
}
if (findingType === "Policy:IAMUser/S3BucketPubliclyAccessible") {
// Alert security channel — bucket powering an MCP tool is now public
console.error(`CRITICAL: MCP data source bucket ${bucketName} is now publicly accessible`);
// TODO: post to Slack security channel via webhook
}
};
This Lambda pattern provides automatic quarantine without human intervention. The IAM condition that blocks MCP tool access:
{
"Effect": "Deny",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::mcp-document-store-prod/*",
"Condition": {
"StringEquals": {
"s3:ExistingObjectTag/mcp-data-source": "quarantine"
}
}
}
Suppression rules — reducing finding noise
Macie generates policy findings whenever it detects a configuration deviation — including intentionally configured exceptions. For example, a CloudFront origin bucket that is intentionally public (behind OAC) generates Policy:IAMUser/S3BucketPubliclyAccessible findings that are expected and not actionable. Suppression rules archive these findings automatically so they don't obscure real issues:
import {
CreateFindingsFilterCommand,
FindingsFilterAction,
} from "@aws-sdk/client-macie2";
// Suppress policy findings on the CloudFront static assets bucket
const { arn } = await macie.send(new CreateFindingsFilterCommand({
name: "suppress-cdn-public-bucket",
description: "CloudFront origin bucket is intentionally public — OAC handles auth",
action: FindingsFilterAction.SUPPRESS, // archives matching findings
findingCriteria: {
criterion: {
"type": {
eq: ["Policy:IAMUser/S3BucketPubliclyAccessible"],
},
"resourcesAffected.s3Bucket.name": {
eq: ["my-cdn-static-assets"],
},
},
},
position: 1, // lower number = higher priority; evaluated in order
tags: { project: "mcp-platform" },
}));
console.log("Suppression rule ARN:", arn);
Suppressed findings are archived, not deleted — they remain queryable with "archived": { "eq": ["true"] } in the finding criteria. Set FindingsFilterAction.ARCHIVE and FindingsFilterAction.SUPPRESS — they are equivalent for findings filters; the name SUPPRESS is used in the console UI but the API constant is what the SDK expects.
List existing suppression rules:
import { ListFindingsFiltersCommand } from "@aws-sdk/client-macie2";
const filters = await macie.send(new ListFindingsFiltersCommand({}));
for (const filter of filters.findingsFilterListItems ?? []) {
console.log(filter.id, filter.name, filter.action, filter.position);
}
Security Hub integration
Macie integrates natively with AWS Security Hub — when both are enabled in the same account and region, Macie automatically forwards all findings (except archived/suppressed ones) to Security Hub in ASFF (Amazon Security Finding Format). No additional configuration is needed beyond enabling both services.
To verify that Macie → Security Hub forwarding is active:
import { ListMembersCommand } from "@aws-sdk/client-macie2";
import { SecurityHubClient, GetEnabledStandardsCommand } from "@aws-sdk/client-securityhub";
// Check Security Hub is enabled
const hub = new SecurityHubClient({ region: "us-east-1" });
const standards = await hub.send(new GetEnabledStandardsCommand({}));
console.log("Security Hub standards enabled:", standards.StandardsSubscriptions?.length ?? 0);
// In Security Hub, Macie findings appear as ProductName: "Amazon Macie"
// Query them via Security Hub GetFindings with ProductName filter
Using Security Hub as the central aggregation point for Macie findings alongside GuardDuty, Inspector, and config rule findings gives MCP server security teams a unified view of their infrastructure posture. The Security Hub guide covers the full aggregation and automation pattern.
Finding retention
Macie retains findings for 90 days. After 90 days, findings are automatically deleted and cannot be recovered via the API. For compliance purposes, configure the sensitive data discovery result location (covered in the data identifiers guide) to persist full scan results to an S3 bucket with your own retention policy. Security Hub retains findings for 90 days as well, but exported findings to S3 (via Security Hub custom actions or EventBridge) can be retained indefinitely in your own storage.