cd /news/artificial-intelligence/building-an-automated-compliance-mon… · home › topics › artificial-intelligence › article
[ARTICLE · art-182295] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Building an Automated Compliance Monitoring Platform on AWS with AI

A developer designed an automated compliance monitoring platform on AWS that chains AWS Config, CloudTrail, Security Hub, EventBridge, Lambda and Amazon Bedrock to continuously detect configuration drift, investigate findings and generate AI-written investigation reports. The architecture keeps detection, investigation, decision-making and remediation separate, requiring human approval before any AI-recommended fix is applied through Systems Manager or Lambda and re-evaluated by Config.

recommendation

Gate AI-generated remediation behind explicit human approval and re-run AWS Config evaluation after applying fixes, so compliance drift is detected continuously without letting model output mutate production infrastructure.

more in playbook: Designing agent systems
by read7 min views1 publishedDec 5, 2026

AWS Config + CloudTrail + Security Hub + Amazon Bedrock

Imagine managing an AWS environment with multiple accounts, hundreds of resources, and applications deployed across different Regions.

A developer accidentally exposes an S3 bucket. Another team modifies a security group. An IAM policy becomes more permissive than expected.

These changes can happen in seconds, but discovering them may take hours or days.

Traditional compliance processes often depend on periodic audits, manual reviews, and spreadsheets. That approach becomes increasingly difficult as cloud infrastructure grows.

What if AWS could continuously detect configuration violations, correlate security events, investigate findings, and help engineers identify corrective actions?

In this article, we will explore how to build an Automated Compliance Monitoring Platform on AWS using native AWS security services and AI.

The goal is to create a centralized platform that continuously monitors AWS environments and helps security teams respond to compliance risks.

The solution combines:

The architecture can support multiple AWS accounts managed through AWS Organizations.

Here is the conceptual workflow:

                 AWS Organizations
                         |
          +--------------+--------------+
          |              |              |
       Account A      Account B      Account C
          |              |              |
      AWS Config     AWS Config     AWS Config
          |              |              |
      CloudTrail     CloudTrail     CloudTrail
          |              |              |
          +--------------+--------------+
                         |
                  Security Hub
                         |
                   EventBridge
                         |
                     AWS Lambda
                         |
                Amazon Bedrock
                         |
              AI Investigation Report
                         |
                 Security Team
                         |
                Human Approval
                         |
             Approved Remediation
                         |
             Systems Manager / Lambda
                         |
                Config Reevaluation

CloudTrail logs can also be delivered to a centralized Amazon S3 logging account for long-term audit and investigation purposes.

The architecture separates detection, investigation, decision-making, and remediation. This is important because AI-generated recommendations should not automatically become production infrastructure changes.

Configuration drift is one of the most common cloud security challenges.

A resource may be compliant when created but become non-compliant after a configuration change.

For example, an S3 bucket may initially block public access. Later, someone modifies its bucket policy and unintentionally exposes data.

AWS Config continuously records supported resource configurations and evaluates them against compliance rules.

Organizations can use AWS-managed rules, custom rules, and conformance packs.

The following CloudFormation resource creates an AWS Config managed rule:

Resources:
  S3PublicReadComplianceRule:
    Type: AWS::Config::ConfigRule
    Properties:
      ConfigRuleName: s3-public-read-prohibited
      Source:
        Owner: AWS
        SourceIdentifier: S3_BUCKET_PUBLIC_READ_PROHIBITED

This rule evaluates whether S3 buckets allow public read access.

For a production environment, make sure AWS Config recording is enabled for the relevant resource types and Regions.

You can extend the rule set to monitor encryption, security group exposure, IAM configurations, and other requirements.

Detecting a violation is only the first step.

Security teams also need to understand how it happened.

Consider an S3 bucket that suddenly becomes publicly accessible.

The investigation needs to answer:

AWS CloudTrail records AWS account activity and API events.

For multi-account environments, organizations can configure an organization trail and centralize logs in a dedicated S3 logging account.

A useful investigation workflow correlates an AWS Config finding with relevant CloudTrail events.

This helps security teams move from identifying a configuration violation to understanding its origin.

CloudTrail logs should be protected using appropriate access controls, encryption, retention policies, and integrity validation where required.

Managing security findings independently across multiple accounts can create operational complexity.

AWS Security Hub CSPM helps centralize security posture information and findings from integrated AWS services and supported security products.

It also supports security standards and controls, including AWS Foundational Security Best Practices.

Security Hub findings use the AWS Security Finding Format (ASFF), providing a standardized structure for processing findings.

For example, a high-severity finding can trigger an EventBridge workflow.

The following pattern is a starting point for routing active high- and critical-severity Security Hub findings:

{
  "source": ["aws.securityhub"],
  "detail-type": ["Security Hub Findings - Imported"],
  "detail": {
    "findings": {
      "Severity": {
        "Label": ["HIGH", "CRITICAL"]
      },
      "RecordState": ["ACTIVE"]
    }
  }
}

The EventBridge rule can invoke a Lambda function to begin an investigation.

Validate the event structure and filtering against the events emitted by your Security Hub environment before deploying the rule.

Security tools can identify risks, but engineers still need to understand findings and decide what to do next.

This is where Amazon Bedrock becomes useful.

An AI-assisted investigation workflow can transform technical security findings into understandable summaries.

For example, when a public S3 bucket finding is detected, the system can ask an approved foundation model to explain:

The following example uses the Bedrock Runtime Converse API:

import boto3

bedrock = boto3.client("bedrock-runtime")

response = bedrock.converse(
    modelId="YOUR_APPROVED_MODEL_ID",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "text": """
                    Analyze this AWS security finding.

                    Finding:
                    An S3 bucket may allow public read access.

                    Explain:
                    1. Potential security impact.
                    2. Evidence that should be reviewed.
                    3. Recommended investigation steps.
                    4. Possible remediation options.

                    Do not assume the finding is confirmed.
                    Do not perform remediation.
                    """
                }
            ]
        }
    ],
    inferenceConfig={
        "maxTokens": 600,
        "temperature": 0.2
    }
)

result = response["output"]["message"]["content"][0]["text"]

print(result)

Replace YOUR_APPROVED_MODEL_ID with a model identifier available to your account and Region.

This example demonstrates the model invocation only. A production implementation should pass the actual finding details, relevant evidence, and carefully scoped context.

It should also handle throttling, access errors, timeouts, and model output validation.

Important: AI should assist investigation, not act as the final compliance authority. Model-generated recommendations must be checked against actual resource configurations and organizational policies.

Detecting and investigating findings is valuable, but organizations also need a way to resolve them.

However, automatically changing production infrastructure based on AI recommendations can introduce additional risk.

A safer approach is to combine predefined remediation actions with human approval.

For example:

Risk category Recommended workflow
Low risk Execute an approved, tested automation
Medium risk Require engineer approval
High impact Require explicit security or change-management approval

AWS Systems Manager Automation and AWS Lambda can execute approved remediation workflows.

A typical process looks like this:

Security Finding
       |
       v
EventBridge
       |
       v
Investigation Lambda
       |
       v
Amazon Bedrock
       |
       v
Investigation Report
       |
       v
Human Review
       |
       v
Approval
       |
       v
Systems Manager Automation
       |
       v
AWS Config Reevaluation
       |
       v
Updated Compliance Status

Every remediation action should be logged and associated with an authorized identity.

The system should verify the resource configuration again after remediation rather than assuming that a successful automation execution means the issue is resolved.

Security teams need more than individual alerts.

They need to understand trends across accounts, Regions, and workloads.

A reporting architecture can use:

Amazon S3: Store historical findings and audit evidence.

AWS Glue: Catalog supported datasets.

Amazon Athena: Query compliance and security information.

Amazon QuickSight: Build dashboards for security and management teams.

A dashboard could display:

This creates better visibility for security operations and audit preparation.

The platform can help monitor technical controls that support frameworks such as:

For example, infrastructure checks can help evaluate encryption settings, storage access restrictions, identity permissions, logging coverage, and network exposure.

However, technical monitoring alone does not establish full compliance or certification.

Organizations must also address governance, operational procedures, evidence requirements, risk management, and other framework-specific obligations.

Treat this platform as a continuous technical control monitoring capability that supports a broader compliance program.

A compliance platform must itself follow strong security practices.

Use least-privilege IAM roles for Lambda, EventBridge, and other services.

Protect centralized CloudTrail logs and compliance evidence against unauthorized modification and deletion.

Encrypt data at rest and in transit.

Avoid including unnecessary sensitive information in AI prompts.

Validate AI responses before using them in operational workflows.

Use approved remediation runbooks instead of giving an AI model unrestricted infrastructure permissions.

Monitor failed executions and consider retry mechanisms and dead-letter queues for asynchronous workflows.

Most importantly, maintain a complete audit trail of investigation decisions and remediation actions.

The biggest benefit is the shift from periodic compliance reviews to continuous monitoring.

AWS Config identifies configuration drift.

CloudTrail helps explain the changes that caused it.

Security Hub provides centralized security visibility.

EventBridge and Lambda connect detection to investigation workflows.

Amazon Bedrock helps engineers interpret findings and understand possible remediation options.

S3, Athena, Glue, and QuickSight provide a foundation for historical reporting.

Together, these services help reduce manual investigation effort and improve visibility across a growing AWS environment.

Cloud compliance should not be something organizations check only before an audit.

It should be part of everyday cloud operations.

By combining AWS Config, CloudTrail, Security Hub, EventBridge, Lambda, and Amazon Bedrock, organizations can build a platform that continuously monitors infrastructure, investigates security findings, and supports controlled remediation.

The goal is not to replace security engineers or compliance teams.

It is to give them better evidence, faster investigations, consistent workflows, and greater visibility.

Detect continuously. Investigate intelligently. Remediate responsibly.

That is the foundation of an AI-assisted compliance monitoring platform on AWS.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @aws 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/building-an-automate…] indexed:0 read:7min 2026-12-05 · —