{
  "title": "How to Automate Detection and Reporting for FAR 52.204-21 / CMMC 2.0 Level 1 - Control - SI.L1-B.1.XII: Tools, Scripts, and Configuration Examples",
  "date": "2026-04-03",
  "author": "Lakeridge Technologies",
  "featured_image": "/assets/images/blog/2026/4/how-to-automate-detection-and-reporting-for-far-52204-21-cmmc-20-level-1-control-sil1-b1xii-tools-scripts-and-configuration-examples.jpg",
  "content": {
    "full_html": "<p>This post provides a practical, implementation-focused guide for automating detection and reporting to satisfy FAR 52.204-21 and the CMMC 2.0 Level 1 control SI.L1-B.1.XII, with concrete tool recommendations, scripts, configuration examples, and small-business scenarios you can apply today.</p>\n\n<h2>Overview: What SI.L1-B.1.XII Requires (Practical Interpretation)</h2>\n<p>In the context of Compliance Framework, SI.L1-B.1.XII is implemented as a requirement to detect indicators of system and information integrity violations (malware, unauthorized changes, suspicious process execution, and anomalous network activity) and to report those findings in a repeatable, auditable way. For small businesses handling covered contractor information, this means centralizing logs, creating deterministic detection rules for common threats, and producing incident/alert reports that can be preserved as compliance evidence.</p>\n\n<h2>High-level Implementation Approach</h2>\n<p>Start with four practical pillars: (1) inventory endpoints and services; (2) enable and centralize logging; (3) apply lightweight detection rules and endpoint agents; and (4) automate reporting and ticketing for alerts. For small shops, this can be achieved with a mix of free/open-source tools (osquery, Auditd/Sysmon, Wazuh/OSSEC, ELK/Opensearch) or minimal cloud-native services (AWS CloudTrail + GuardDuty + CloudWatch, Azure Monitor + Sentinel). The goal is actionable alerts (not just logs) and retained evidence of detection and reporting activities.</p>\n\n<h2>Tools and Configurations — Practical Examples</h2>\n<h3>Endpoint visibility: osquery + Auditd/Sysmon</h3>\n<p>osquery is lightweight and lets you create SQL-style queries to detect file/timestamp changes, new local admin accounts, or suspicious binaries. For Linux servers, enable auditd rules to log execve and changes to /etc/passwd. For Windows, deploy Sysmon with rules that capture process creation and network connection events.</p>\n<pre><code># Example osquery scheduled query to detect newly installed SUID binaries on Linux\nselect name, path, uid, gid, mode, sha256 from file where path like '/usr/%' and (mode & 04000) != 0;\n# Save this in packs/linux/security/osquery.conf as a scheduled query\n</code></pre>\n<pre><code># auditd rule: log execve for all users (add to /etc/audit/rules.d/99-security.rules)\n-a always,exit -F arch=b64 -S execve -k exec_calls\n-a always,exit -F arch=b32 -S execve -k exec_calls\n</code></pre>\n\n<h3>Log collection and detection: Wazuh (or OSSEC) + ELK/Opensearch</h3>\n<p>Wazuh agents collect auditd/Sysmon/osquery logs, apply built-in rules, and forward alerts. Use Wazuh for small businesses because it bundles detection rules and alerting out of the box. Ship logs to ELK/Opensearch and create saved searches and Watcher alerts or use Wazuh active response for automated actions.</p>\n<pre><code># Example Wazuh decoders/rule snippet (rules/local_rules.xml)\n<group name=\"local,\">\n  <rule id=\"100100\" level=\"10\">\n    <if_sid>18107</if_sid> <!-- syscheck changes -->\n    <decoded_as>syscheck</decoded_as>\n    <description>Critical file integrity change detected</description>\n  </rule>\n</group>\n</code></pre>\n\n<h3>Cloud-native example: AWS CloudWatch + GuardDuty + Lambda</h3>\n<p>For workloads in AWS, enable CloudTrail and CloudWatch logs, turn on GuardDuty for threat detection, and add a CloudWatch metric filter + alarm to push important findings to an SNS topic. Use a Lambda subscribed to the SNS topic to transform the finding into a compliance report (JSON + human summary) and push to email, Slack, or a ticketing system.</p>\n<pre><code># Example Lambda (Python) skeleton to transform GuardDuty alert and post to Slack/email\ndef lambda_handler(event, context):\n    finding = event['Records'][0]['Sns']['Message']\n    # parse, create human-readable summary, attach original JSON\n    send_to_slack(summary, attachments=[finding])\n    save_to_s3('compliance-reports/' + timestamp + '.json', finding)\n</code></pre>\n\n<h2>Small-Business Scenarios and Real-World Examples</h2>\n<p>Scenario 1: A 20-seat contractor with one Linux server and several Windows workstations. Deploy Wazuh agents to all hosts, configure osquery on workstations to run daily integrity checks, and use a single small EC2 instance running ELK to aggregate logs. Create an alert rule for new local admin account creation and configure an automated Slack notification plus ticket creation in Jira. This meets SI.L1-B.1.XII’s intent by detecting common integrity events and preserving reporting artifacts (alert emails, Slack messages, Jira tickets).</p>\n<p>Scenario 2: A small SaaS provider in AWS. Turn on CloudTrail & GuardDuty, configure a CloudWatch alarm for console login anomalies and API calls creating \"admin\" roles, and attach a Lambda that stores the finding JSON in an S3 bucket (immutable storage) and sends an alert email to the security contact. Ensure retention and export of S3 objects as audit evidence.</p>\n\n<h2>Automation Scripts and Integration Examples</h2>\n<p>Automate reporting to create auditable artifacts: timestamped JSON alerts, stored to immutable storage, and linked to a ticket. Example: a simple bash script that ingests lines from syslog, matches rule patterns, writes JSON to a reports directory, and uses curl to post to a webhook.</p>\n<pre><code># simple-alert-shipper.sh\n#!/bin/bash\nwhile read -r line; do\n  if echo \"$line\" | grep -Ei \"authentication failure|sudo:|invalid user\"; then\n    timestamp=$(date --iso-8601=seconds)\n    json=$(jq -n --arg t \"$timestamp\" --arg l \"$line\" '{time:$t,log:$l}')\n    echo \"$json\" >> /var/log/compliance/alerts.log\n    curl -X POST -H \"Content-Type: application/json\" -d \"$json\" https://hooks.slack.com/services/T/XXXXXXXX/XXXXXXXX\n  fi\ndone < /var/log/auth.log\n</code></pre>\n\n<h2>Compliance Tips, Best Practices, and Evidence Collection</h2>\n<p>Document mapping between alerts and the control (e.g., \"SI.L1-B.1.XII — Alert rule ID 100100 logs file integrity changes and stores report to S3/Jira\"). Keep retained evidence including agent deployment records, alert bodies, timestamps, response actions (tickets, remediation notes), and configuration snapshots (osquery packs, auditd rules, Wazuh rules). Tune detection rules to reduce false positives; record tuning decisions as part of the compliance evidence. Schedule quarterly verification tests where you simulate a benign integrity change and show the alert flow and reporting artifacts.</p>\n\n<h2>Risk of Not Implementing</h2>\n<p>Without automated detection and reporting you face prolonged dwell time for threats, loss or exfiltration of covered contractor information, failure to meet contract obligations under FAR 52.204-21, potential contract penalties, and the practical risk of not being able to demonstrate compliance during assessments. For small businesses, an undetected compromise can mean losing contracts or expensive remediation costs.</p>\n\n<h2>Summary</h2>\n<p>Implementing SI.L1-B.1.XII for FAR 52.204-21 / CMMC 2.0 Level 1 does not require enterprise-grade spend—small businesses can achieve effective detection and repeatable reporting using osquery, auditd/Sysmon, Wazuh (or cloud equivalents), and lightweight automation (Lambda scripts, bash shippers, or simple webhooks). Key actions: inventory systems, centralize logs, deploy endpoint visibility tools, create deterministic detection rules, automate alert-to-ticket reporting, and retain all artifacts for audit. With tuned rules and documented processes you’ll both reduce risk and have demonstrable evidence to show assessors and contracting officers.</p>",
    "plain_text": "This post provides a practical, implementation-focused guide for automating detection and reporting to satisfy FAR 52.204-21 and the CMMC 2.0 Level 1 control SI.L1-B.1.XII, with concrete tool recommendations, scripts, configuration examples, and small-business scenarios you can apply today.\n\nOverview: What SI.L1-B.1.XII Requires (Practical Interpretation)\nIn the context of Compliance Framework, SI.L1-B.1.XII is implemented as a requirement to detect indicators of system and information integrity violations (malware, unauthorized changes, suspicious process execution, and anomalous network activity) and to report those findings in a repeatable, auditable way. For small businesses handling covered contractor information, this means centralizing logs, creating deterministic detection rules for common threats, and producing incident/alert reports that can be preserved as compliance evidence.\n\nHigh-level Implementation Approach\nStart with four practical pillars: (1) inventory endpoints and services; (2) enable and centralize logging; (3) apply lightweight detection rules and endpoint agents; and (4) automate reporting and ticketing for alerts. For small shops, this can be achieved with a mix of free/open-source tools (osquery, Auditd/Sysmon, Wazuh/OSSEC, ELK/Opensearch) or minimal cloud-native services (AWS CloudTrail + GuardDuty + CloudWatch, Azure Monitor + Sentinel). The goal is actionable alerts (not just logs) and retained evidence of detection and reporting activities.\n\nTools and Configurations — Practical Examples\nEndpoint visibility: osquery + Auditd/Sysmon\nosquery is lightweight and lets you create SQL-style queries to detect file/timestamp changes, new local admin accounts, or suspicious binaries. For Linux servers, enable auditd rules to log execve and changes to /etc/passwd. For Windows, deploy Sysmon with rules that capture process creation and network connection events.\n# Example osquery scheduled query to detect newly installed SUID binaries on Linux\nselect name, path, uid, gid, mode, sha256 from file where path like '/usr/%' and (mode & 04000) != 0;\n# Save this in packs/linux/security/osquery.conf as a scheduled query\n\n# auditd rule: log execve for all users (add to /etc/audit/rules.d/99-security.rules)\n-a always,exit -F arch=b64 -S execve -k exec_calls\n-a always,exit -F arch=b32 -S execve -k exec_calls\n\n\nLog collection and detection: Wazuh (or OSSEC) + ELK/Opensearch\nWazuh agents collect auditd/Sysmon/osquery logs, apply built-in rules, and forward alerts. Use Wazuh for small businesses because it bundles detection rules and alerting out of the box. Ship logs to ELK/Opensearch and create saved searches and Watcher alerts or use Wazuh active response for automated actions.\n# Example Wazuh decoders/rule snippet (rules/local_rules.xml)\n\n  \n    18107 \n    syscheck\n    Critical file integrity change detected\n  \n\n\n\nCloud-native example: AWS CloudWatch + GuardDuty + Lambda\nFor workloads in AWS, enable CloudTrail and CloudWatch logs, turn on GuardDuty for threat detection, and add a CloudWatch metric filter + alarm to push important findings to an SNS topic. Use a Lambda subscribed to the SNS topic to transform the finding into a compliance report (JSON + human summary) and push to email, Slack, or a ticketing system.\n# Example Lambda (Python) skeleton to transform GuardDuty alert and post to Slack/email\ndef lambda_handler(event, context):\n    finding = event['Records'][0]['Sns']['Message']\n    # parse, create human-readable summary, attach original JSON\n    send_to_slack(summary, attachments=[finding])\n    save_to_s3('compliance-reports/' + timestamp + '.json', finding)\n\n\nSmall-Business Scenarios and Real-World Examples\nScenario 1: A 20-seat contractor with one Linux server and several Windows workstations. Deploy Wazuh agents to all hosts, configure osquery on workstations to run daily integrity checks, and use a single small EC2 instance running ELK to aggregate logs. Create an alert rule for new local admin account creation and configure an automated Slack notification plus ticket creation in Jira. This meets SI.L1-B.1.XII’s intent by detecting common integrity events and preserving reporting artifacts (alert emails, Slack messages, Jira tickets).\nScenario 2: A small SaaS provider in AWS. Turn on CloudTrail & GuardDuty, configure a CloudWatch alarm for console login anomalies and API calls creating \"admin\" roles, and attach a Lambda that stores the finding JSON in an S3 bucket (immutable storage) and sends an alert email to the security contact. Ensure retention and export of S3 objects as audit evidence.\n\nAutomation Scripts and Integration Examples\nAutomate reporting to create auditable artifacts: timestamped JSON alerts, stored to immutable storage, and linked to a ticket. Example: a simple bash script that ingests lines from syslog, matches rule patterns, writes JSON to a reports directory, and uses curl to post to a webhook.\n# simple-alert-shipper.sh\n#!/bin/bash\nwhile read -r line; do\n  if echo \"$line\" | grep -Ei \"authentication failure|sudo:|invalid user\"; then\n    timestamp=$(date --iso-8601=seconds)\n    json=$(jq -n --arg t \"$timestamp\" --arg l \"$line\" '{time:$t,log:$l}')\n    echo \"$json\" >> /var/log/compliance/alerts.log\n    curl -X POST -H \"Content-Type: application/json\" -d \"$json\" https://hooks.slack.com/services/T/XXXXXXXX/XXXXXXXX\n  fi\ndone \n\nCompliance Tips, Best Practices, and Evidence Collection\nDocument mapping between alerts and the control (e.g., \"SI.L1-B.1.XII — Alert rule ID 100100 logs file integrity changes and stores report to S3/Jira\"). Keep retained evidence including agent deployment records, alert bodies, timestamps, response actions (tickets, remediation notes), and configuration snapshots (osquery packs, auditd rules, Wazuh rules). Tune detection rules to reduce false positives; record tuning decisions as part of the compliance evidence. Schedule quarterly verification tests where you simulate a benign integrity change and show the alert flow and reporting artifacts.\n\nRisk of Not Implementing\nWithout automated detection and reporting you face prolonged dwell time for threats, loss or exfiltration of covered contractor information, failure to meet contract obligations under FAR 52.204-21, potential contract penalties, and the practical risk of not being able to demonstrate compliance during assessments. For small businesses, an undetected compromise can mean losing contracts or expensive remediation costs.\n\nSummary\nImplementing SI.L1-B.1.XII for FAR 52.204-21 / CMMC 2.0 Level 1 does not require enterprise-grade spend—small businesses can achieve effective detection and repeatable reporting using osquery, auditd/Sysmon, Wazuh (or cloud equivalents), and lightweight automation (Lambda scripts, bash shippers, or simple webhooks). Key actions: inventory systems, centralize logs, deploy endpoint visibility tools, create deterministic detection rules, automate alert-to-ticket reporting, and retain all artifacts for audit. With tuned rules and documented processes you’ll both reduce risk and have demonstrable evidence to show assessors and contracting officers."
  },
  "metadata": {
    "description": "Practical, step-by-step guidance to automate detection and reporting to meet FAR 52.204-21 / CMMC 2.0 Level 1 SI.L1-B.1.XII using open-source and cloud-native tools, scripts, and configuration examples.",
    "permalink": "/how-to-automate-detection-and-reporting-for-far-52204-21-cmmc-20-level-1-control-sil1-b1xii-tools-scripts-and-configuration-examples.json",
    "categories": [],
    "tags": []
  }
}