NIST SP 800-171 Rev. 2 practice MP.L2-3.8.4 requires media containing CUI to display applicable CUI markings and distribution limitations; for S3 objects, this means identifying CUI-bearing files and applying consistent metadata that users and automated workflows can recognize. Using Amazon Macie to find and tag CUI files in S3 can support this requirement when Macie classification findings trigger an AWS automation workflow that applies S3 object tags for the CUI banner, category, owner, and approved dissemination limitation.
Amazon Macie does not write markings into a document or directly add S3 object tags by itself. The practical AWS design is Macie for discovery, Amazon EventBridge for finding events, and AWS Lambda for applying governed S3 object tags based on the finding and the data owner’s approved CUI designation.
What configuration is required for using Amazon Macie to find and tag CUI files in S3?
-
Enable Amazon Macie in every in-scope AWS Region. Sign in to the AWS Management Console using the account designated as the Macie administrator. Open
Amazon Macie, select the appropriate Region, and chooseGet startedorEnable Macie. For a multi-account environment, openAmazon Macie > Settings > Accountsand configure the AWS Organizations delegated administrator before enabling member accounts.Do not assume that enabling Macie in one Region covers S3 buckets in all Regions. Macie discovery and findings are Regional, so maintain a documented list of CUI-capable S3 buckets and their Regions.
-
Turn on automated sensitive data discovery for broad coverage. In the Macie console, go to
Settings > Automated sensitive data discovery, chooseEnable, and confirm the feature is enabled. This provides ongoing discovery for eligible S3 buckets, but it should not replace a targeted classification job for known CUI repositories. -
Create a custom data identifier for visible CUI markings. Go to
Settings > Custom data identifiers > Create. Create an identifier namedCUI_Banner_Markingwith a description such asDetects CUI banners and common CUI category markings in files stored in S3.Use the following regular expression as a starting point:
(?i)(CONTROLLED UNCLASSIFIED INFORMATION|CUI(?:\/\/[A-Z0-9 -]+){0,3})Add the keywords
CUI,CONTROLLED, andUNCLASSIFIED. SetMaximum match distanceto50. This helps Macie identify documents that already contain a CUI banner, such asCUI//SP-CTI, while reducing matches from unrelated uses of the word “controlled.” -
Create identifiers for organization-specific contract indicators. In the same
Custom data identifiersarea, create separate identifiers for contract numbers, supplier data labels, drawing release codes, or other markers that indicate likely CUI. Avoid using a single generic identifier as the sole basis for automatic tagging. A matching phrase can indicate that a file needs review; it does not always establish the correct CUI category or dissemination control. -
Create a targeted sensitive-data discovery job. Navigate to
Amazon Macie > Jobs > Create job. SelectOne-time jobfor an initial inventory orScheduled jobfor recurring review. UnderChoose S3 buckets, select only the approved CUI repositories. UnderManaged data identifiers, select the identifiers relevant to your environment, and underCustom data identifiers, selectCUI_Banner_Markingand the approved contract-specific identifiers.For the first baseline scan, set
Sampling depthto100%for priority repositories. Name the job descriptively, such asCUI-S3-Engineering-Weekly-Classification. A weekly schedule is often appropriate for active document repositories, while upload-triggered review may be needed for faster-moving workflows. -
Define the S3 object-tagging taxonomy before automating it. Use standardized tag keys that can be evaluated by IAM policies, S3 inventory reports, and compliance evidence reviews. A practical tag set is shown below.
Tag key Example value Purpose CUIYesFlags the object as containing or suspected of containing CUI. CUI_BannerCUI//SP-CTIRecords the approved CUI category marking. CUI_DistributionNOFORNRecords an approved limited dissemination control, when applicable. CUI_OwnerEngineering-Data-OwnerSupports ownership identification associated with MP.L2-3.8.8. CUI_StatusPending-Owner-ReviewPrevents a detection result from being treated as a final legal determination. -
Create an EventBridge rule for Macie sensitive-data findings. Open
Amazon EventBridge > Rules > Create rule. Select thedefaultevent bus, chooseEvent pattern, selectAWS events or EventBridge partner events, and use the following event pattern:{ "source": ["aws.macie"], "detail-type": ["Macie Finding"], "detail": { "type": ["SensitiveData:S3Object/Multiple"] } }Set the target to an AWS Lambda function such as
macie-cui-object-tagger. If your findings use additional sensitive-data finding types, include those types in the event pattern after validating them in the MacieFindingspage. -
Configure the Lambda function to preserve existing tags and apply CUI tags. The function should call the Macie
GetFindingsAPI using the finding ID from EventBridge, identify the affected bucket, object key, and version ID, retrieve current object tags withs3:GetObjectTagging, and then apply the approved tag set withs3:PutObjectTagging. Grant the Lambda execution role only the required permissions:macie2:GetFindings,s3:GetObjectTagging,s3:PutObjectTagging, and CloudWatch Logs permissions.Make the function apply
CUI_Status=Pending-Owner-Reviewby default. Only apply a final banner value such asCUI//SP-CTIor a restriction such asNOFORNwhen the finding matches a pre-approved rule and the data owner has authorized that mapping.
For example, a 275-person precision machining and metal fabrication firm may store customer-controlled CAD exports, inspection reports, and technical data packages in an S3 bucket used by its engineering document portal. Macie can detect a visible CUI//SP-CTI banner in a technical drawing package, while the Lambda workflow adds CUI=Yes, CUI_Banner=CUI//SP-CTI, CUI_Owner=Engineering-Data-Owner, and CUI_Status=Pending-Owner-Review. The engineering data owner then confirms whether a dissemination limitation applies before the status is changed to Approved.
How do you verify that Macie discovery and S3 tagging worked?
-
Open
Amazon Macie > Findingsand filter by the classification job name, affected S3 bucket, or custom data identifier name. Confirm that the finding identifies the expected bucket and object path. -
Select the finding and review
Resources affectedandSensitive data. Confirm that the custom data identifier or managed identifier matched the expected content rather than a false positive. -
Open
Amazon S3 > Buckets > [bucket name] > Objects, select the identified object, and open thePropertiestab. UnderTags, verify the required values, includingCUI,CUI_Banner,CUI_Distributionwhen applicable, andCUI_Owner. -
Open
Amazon CloudWatch > Log groupsand review the Lambda log group for the tagging event. The log should record the Macie finding ID, bucket, object key, tag action, timestamp, and any review status without writing sensitive file contents to logs.
What evidence should be retained for a CMMC assessor?
| Evidence item | What it demonstrates |
|---|---|
| Macie settings screenshot | Macie is enabled in the applicable Region and automated sensitive data discovery is active. |
| Custom data identifier configuration export or screenshot | The organization can detect CUI banners and approved internal or contract-specific indicators. |
| Classification job configuration | In-scope S3 buckets, scan schedule, selected identifiers, and sampling depth are documented. |
| Macie finding detail | A real object was identified as containing CUI-related information or markings. |
| S3 object Properties > Tags screenshot | The affected digital media object carries CUI, owner, banner, and distribution metadata. |
| EventBridge rule and Lambda configuration | Tagging is automated, repeatable, and not dependent on an individual administrator remembering a manual process. |
| CloudTrail data events and Lambda logs | Tagging actions can be traced to the automation role, object, time, and account. |
For a stronger evidence package, configure Amazon Macie > Settings > Findings export configuration to export findings to a protected S3 evidence bucket encrypted with an approved AWS KMS key. Retain the associated review record showing who approved the final CUI category and any limited dissemination control.
Where does Amazon Macie fall short of MP.L2-3.8.4?
Using Amazon Macie to find and tag CUI files in S3 does not itself place a visible CUI banner in a PDF, CAD file, spreadsheet, printed drawing, removable drive label, or downloaded report. S3 object tags are metadata; they are useful for governance and automated access decisions, but a user may not see them when opening a file outside the AWS Console.
Macie also cannot determine the correct CUI category or distribution limitation solely from content detection. The CUI category, marking syntax, and limited dissemination controls must come from the contract, data owner, legal counsel, export-control process, and applicable NARA CUI guidance. A finding should therefore initiate a controlled review workflow, not automatically assign restrictive labels based on a keyword alone.
Fill these gaps with a documented CUI marking procedure that requires document owners to apply visible headers, footers, cover sheets, drawing title-block markings, and physical-media labels where required. For OT/ICS-related engineering data, include the export path from the manufacturing engineering system, historian, or quality platform into S3, because the file may lose its original visual marking during conversion or report generation.
Next, assign an engineering or operations data owner to approve the CUI tag taxonomy and run a controlled Macie classification job against one in-scope S3 bucket before expanding the workflow across your environment.