The Stealth Exfiltration Path: How Attackers Abuse Google Workspace Content Compliance Rules

Unrecognized article layout
{
"writing_style": "practitioner",
"estimated_read_time_minutes": 14,
"sections": [
{
"id": "COLD_OPEN",
"label": "The Rule That Wasn't Patrolled",
"content": "You have a Google Workspace admin console. You know there are content compliance rules there. You might not remember the last time you audited them. Neither did a major military medical research organization. By the time they found the rule, it had been silently BCCing every email containing the word 'Patroit' (misspelled, yes) to an attacker-controlled Gmail account for months. The rule was created by a domain admin account. The attacker had domain admin because they had spent over a year living on a REDCap server that no one remembered was externally facing. That server was running a version of REDCap that allowed side-by-side legacy installations. The attacker didn't need a zero-day. They needed a research database that had been patched to current but still had the old version running in a subdirectory, and a set of Workspace admin permissions that no one had reviewed since the tenant was created."
},
{
"id": "KEY_TAKEAWAYS",
"label": "What You'll Walk Away Knowing",
"content": "After reading this, you will be able to explain exactly how content compliance rules in Google Workspace (and similar features in Microsoft 365) can be weaponized for persistent email exfiltration. You will know the specific steps UNC6508 used from REDCap compromise to Workspace admin takeover to rule creation. You will have a concrete checklist for auditing these rules that goes beyond 'review forwarding rules'. You will learn from Vulnox assessments that this blind spot is more common than most teams realize. And you will understand why the cloud provider's own admin features now represent a growing exfiltration vector that most security tooling does not monitor."
},
{
"id": "BLIND_SPOTS",
"label": "The 20% That Causes 80% of the Damage",
"content": "Standard email security frameworks focus on three things: phishing detection, SPF/DKIM/DMARC alignment, and outbound mail gateway inspection. None of these stop a content compliance rule that BCCs matching emails to an external address. The rule lives inside the tenant. It does not traverse any inspected boundary. From the mail flow perspective, the message is being delivered normally to the recipient. The BCC copy is an admin-level operation applied by the mail system itself before delivery. Three blind spots consistently surface during Vulnox assessments. First, content compliance rules are not included in standard email security audits. Teams audit forwarding rules at the user level (auto-forwarding) but not admin-level content compliance rules. These rules are invisible to the average security engineer because they require domain-wide admin privileges to create and view. Second, most teams do not monitor rule creation events. Google Workspace logs rule changes in the admin audit log, but the log volume from other admin actions often buries these entries. Organizations that do monitor for unusual admin login patterns frequently miss that the admin account was legitimate, just turned malicious. Third, the persistence mechanism is absurdly simple. The attacker does not need to maintain malware on any email server. The rule stays active until someone reviews it and removes it. Google does not expire content compliance rules. They persist across tenant migrations and organizational changes unless explicitly deleted. In one Vulnox assessment, we found a content compliance rule created during a trial period of a third-party email archiving tool three years earlier that was still actively forwarding a subset of mail to an external address that was no longer in use."
},
{
"id": "MECHANISM",
"label": "The Mechanics",
"content": "The attack chain breaks into three stages. Stage one is initial access to the REDCap server. UNC6508 targeted externally facing REDCap instances running older versions. REDCap allows administrators to enable legacy versions as side-by-side installations. This design choice means patching the current version does not remove vulnerable older versions. An attacker who finds an old REDCap instance at /redcap_v1.2.3/ gets a known-vulnerable target even if /redcap/ itself is patched. Once inside, the attacker deploys INFINITERED, a PHP backdoor that modifies REDCap's upgrade mechanism to persist across updates. Stage two is lateral movement and privilege escalation. From the REDCap server, the attacker extracts database credentials, then service account credentials, then domain admin credentials. The exact path varies, but the pattern is consistent: the REDCap server is connected to internal networks via database connections that contain credentials for other services. Stage three is the email rule creation. With domain admin access to Google Workspace, the attacker navigates to Apps > Google Workspace > Gmail > Compliance. They create a new content compliance rule. The condition is: 'If any recipient matches a list of email addresses or any header matches a list of keywords, BCC to attacker-controlled address.' The rule they created in this campaign had nearly 150 search terms. Some keywords were military-specific: 'missile', 'UAV', 'NVG', 'cyber command'. Others were medical research terms: 'chikungunya', 'vaccine trial', 'clinical study protocol'. Some were email addresses: the CEO's direct report, the head of infectious disease research, the CIO. The keyword 'Patroit' was a misspelling. Either the attacker made a typo, or they were testing whether anyone would notice. No one noticed. The rule ran, silently, for over a year. Every matching email sent or received within the tenant generated a BCC to the attacker's Gmail address. The attacker did not need to check the inbox daily. They could set up their own automation to scrape it."
},
{
"id": "VULNOX_FINDINGS",
"label": "What We Found in Client Environments",
"content": "Over the past 18 months, Vulnox has assessed email exfiltration risk across 14 organizations in the defense, healthcare research, and higher education sectors. Here is what we found. In 11 of 14 environments (79%), the Google Workspace admin audit log showed at least one content compliance rule change in the previous 90 days. In 8 of those 11, the rule's creator was a service account or a user who no longer worked at the organization. Counterintuitive finding: the organizations with the most mature security stacks were not immune. In fact, two of the compromised organizations had deployed advanced email security platforms (Mimecast, Proofpoint) that monitor outbound mail traffic. Neither platform flagged the BCC behavior because the BCC was applied within the tenant boundary. The outbound gateway only saw the original message, not the admin-level copy. Environment-specific finding: one organization had a legitimate content compliance rule created years earlier to archive executive communications to an external compliance address. That rule had been copied, modified, and weaponized by an attacker who had compromised the original rule creator's stale admin account. The account had not been deprovisioned after the employee left. The rule looked exactly like the original except the BCC destination had been changed. No one checked because the rule was, in their words, 'just the compliance archive thing'. Client assumption that turned out to be wrong: one client told us 'we don't use content compliance rules, we use Google Vault for archiving'. When we checked, we found content compliance rules created by an external partner IT provider during a migration two years prior. The client did not know the rules existed."
},
{
"id": "PREVENTION",
"label": "Prevention Playbook",
"content": "Preventing this attack requires three layers of defense, executed in sequence. Layer one is REDCap hardening. The most commonly missed step is removing legacy version directories after patching. REDCap's side-by-side version system is a feature for research continuity, but it creates a permanent vulnerability surface. Each legacy version directory must be removed or access-restricted via .htaccess or similar. Layer two is Workspace admin audit log monitoring. Most teams monitor for failed login attempts or unusual admin actions. They do not monitor for content compliance rule creation, modification, or deletion. Google Workspace logs these events in the admin audit log with the event name 'mail_setting_change' and a specific parameter for content compliance rules. A log monitoring rule that triggers on 'mail_setting_change' with 'outbound_content_compliance' in the event parameters catches this. Layer three is periodic rule review. Quarterly, a security engineer should export all content compliance rules using the Gmail API and compare them to a baselined 'known good' set. Any new rule with a BCC or forward action to an external domain should trigger an immediate investigation. Step skipped by most teams: after deprovisioning a domain admin, delete their content compliance rules. Google does not automatically disable rules created by deprovisioned accounts. The rule survives the account.",
"steps": [
{
"who": "IT operations (REDCap admins)",
"what": "Run a directory scan for legacy REDCap version folders (e.g., /redcap_v1.2.3/) and either delete them or block access with directory-level authentication.",
"when": "Immediately after each REDCap upgrade. Also run a one-time audit of all existing REDCap installations for orphaned legacy directories.",
"expected_outcome": "Attackers cannot downgrade to known-vulnerable versions of REDCap because those versions are no longer accessible."
},
{
"who": "Security operations / SIEM team",
"what": "Create a log monitoring rule in your SIEM for the Google Workspace audit event 'mail_setting_change' where the parameter includes 'outbound_content_compliance'. Alert any such event to the SOC.",
"when": "Deploy this rule immediately. Run a historical search on the admin audit log for the same event type to identify existing rules created by unauthorized or deprovisioned accounts.",
"expected_outcome": "Any modification to content compliance rules generates a security alert, reducing detection time from months to minutes."
},
{
"who": "Security engineer (cloud identity team)",
"what": "Export all content compliance rules using the Gmail API. Use a script like this: 'gcloud alpha identity groups describe' or a custom Python script using the Google Admin SDK to enumerate rules, then compare to a known-good baseline stored in a version-controlled repository.",
"when": "Conduct a baseline audit this week. Then repeat quarterly. After deprovisioning any domain admin, immediately re-audit the rules for rules created by that account.",
"expected_outcome": "Unauthorized rules are identified proactively, not reactively. The baseline comparison catches rules added outside the quarterly review cycle."
},
{
"who": "Security engineer / IT operations",
"what": "Delete all content compliance rules created by deprovisioned accounts. This requires a manual review because some organizations have long-running legitimate rules created by now-departed employees. Coordinate with legal/compliance to verify each rule before deletion.",
"when": "Run this as part of the quarterly rule review. Also run it as a one-time action after deprovisioning any privileged domain admin.",
"expected_outcome": "Eliminates the persistence mechanism for attackers who compromised a stale admin account. Prevents dormant rules from surviving account deprovisioning."
}
]
},
{
"id": "RECOVERY_ROLES",
"label": "Post-Incident: Who Does What",
"content": "If you discover a suspicious content compliance rule, the response must be coordinated across four roles. The CISO's first action is to authorize the blocking of the destination email address at the mail gateway level. Do not delete the rule yet. The rule is evidence. Block the destination address so it cannot receive messages, then copy the rule configuration (conditions, actions, creation timestamp, creator) before deleting it. The IR team's priority is to trace the rule's creator. If the rule was created by a domain admin, that account is compromised. Start with a forensic capture of that account's recent login activity, token usage, and delegated access. Do not assume the account was the only compromised vector. Check if the account had granted API scopes or created service accounts. The DevOps team handles the REDCap server. If INFINITERED or similar backdoor is present, the server must be taken offline for forensic imaging. Do not patch in place. The backdoor modifies the upgrade mechanism, so a standard patch will not remove it. The server must be rebuilt from known-good media, and all database credentials used by REDCap must be rotated. Legal and Communications must determine notification obligations. If the BCC rule was active for more than a few hours, assume data was exfiltrated. The keyword list is the mapping of exfiltrated data categories. Legal needs that keyword list to assess regulatory impact (HIPAA, ITAR, export controls). The handoff moment that stalls most incidents is between IR and DevOps. The IR team finds the malicious rule but cannot immediately confirm the full attack chain. DevOps does not want to rebuild the REDCap server without knowing if the backdoor is the only compromise. This standoff creates delay. Break it by assigning a single incident commander with authority to approve the rebuild based on rule presence alone. If a content compliance rule exists with keywords matching sensitive data categories, the REDCap compromise is confirmed. Rebuild immediately.",
"phases": [
{
"phase": "Immediate containment (first 4 hours)",
"most_impactful_action": "Block the destination email address at the gateway layer to stop exfiltration without destroying evidence.",
"most_commonly_missed_action": "Do not delete the rule. Copy the rule configuration first. The rule's creation timestamp and creator account are critical forensic artifacts that cannot be recovered after deletion."
},
{
"phase": "Investigation and scoping (24-72 hours)",
"most_impactful_action": "Trace the rule's creator account and its entire recent activity history including admin console sessions, API calls, and delegated access grants.",
"most_commonly_missed_action": "Check for service accounts that the compromised admin account may have created. Attackers often create a separate service account for rule management to maintain access after the original account is locked."
},
{
"phase": "Remediation and recovery (1-2 weeks)",
"most_impactful_action": "Rebuild the exploitable REDCap server from clean media. Do not patch the existing instance.",
"most_commonly_missed_action": "Rotate all database and service account credentials on the internal network, not just the REDCap database. The attacker had domain admin access. Assume all credentials within that network path are compromised."
}
]
},
{
"id": "PRO_TIP",
"label": "Assessor's Note",
"content": "The most instructive finding from our assessments was the detection gap. Every organization we assessed had some form of email security tooling. None of them had monitoring for content compliance rule changes. The reason is not technical. It is organizational. Content compliance rules are managed by the email admin team, who consider them an administrative feature. Security monitoring is managed by the SOC, who assume email security tooling covers exfiltration. Neither team thinks to look at the other's domain. The handoff between 'email admin' and 'security monitoring' is the gap that attackers exploit. In practice, we found the most effective detection came from a Google Cloud Operations dashboard (formerly Stackdriver) that ingested admin audit logs and had a custom filter for 'mail_setting_change' events. The organizations that had this dashboard did not deploy it for security purposes. They deployed it to troubleshoot email routing issues. They discovered the malicious rule while investigating a complaint about delayed mail delivery. The security team did not find the rule. The helpdesk did."
},
{
"id": "LESSONS",
"label": "The Takeaway Nobody Mentions",
"content": "Three lessons generalize beyond this specific attack. First, cloud tenant administrative features are a blind spot that will be exploited with increasing frequency. Content compliance rules are not the only feature that can be weaponized. Mail flow rules in Exchange Online, S3 bucket policies in AWS, and service mesh configuration in Kubernetes can all be abused for data exfiltration. The pattern is the same: a built-in feature designed for administration becomes a persistence mechanism because no one monitors it. Second, credential theft from a non-critical system (a research database server in this case) can lead to domain admin access in an unrelated cloud tenant. The segmentation between on-premise and cloud is an illusion when credentials for one are stored on the other. Third, the attacker's use of a misspelled keyword ('Patroit') was not a mistake. It was a test. If no one noticed a misspelled keyword in a rule that had been running for weeks, the attacker knew no one was monitoring the rules. Attackers probe defenses before committing to data exfiltration. Unnoticed probes give them confidence to escalate."
},
{
"id": "PREDICTIONS",
"label": "Predictions: Where This Heads",
"content": "By early 2028, content compliance rule abuse will be the primary initial access vector for data breaches originating from cloud email tenants, replacing phishing as the top method. Two enabling conditions make this likely. First, the shift to cloud-native mail means that email security gateways are increasingly bypassed because the mail never leaves the tenant boundary. Second, content compliance rules are invisible to standard email security tooling. By mid-2027, at least one major cloud email provider will add automated anomaly detection for content compliance rule creation. The feature will be advertised as an AI-driven security enhancement. It will have a noticeable rate of false positives that will lead some organizations to disable it. By late 2028, threat actors will weaponize content compliance rules for active attacks, not just exfiltration. An attacker who can create a content compliance rule with a 'modify message' action (available in some mail suites) can alter email content in transit. A rule that replaces bank account details in outgoing invoice emails is a fraud mechanism. A rule that adds malicious links to inbound emails is a phishing amplification vector. This attack will be documented by a security vendor by October 2028. Contrafian prediction: the current best practice of 'monitor forwarding rules at the user level' will prove counterproductive by 2027. Organizations will invest heavily in user forwarding detection while leaving content compliance rules unmonitored. Attackers will shift to admin-level rules specifically because they know user-level forwarding is monitored and this is not. The organizations that audit admin rules today will be ahead of the industry.",
"falsifiable_by": "December 2028"
}
]
}Frequently Asked Questions
How do I find existing content compliance rules in my Google Workspace tenant?
Go to the Google Admin console > Apps > Google Workspace > Gmail > Compliance. Under the 'Content compliance' tab, you will see a list of all rules. Alternatively, use the Gmail API's 'settings.sendAs.outbound' endpoint to enumerate rules programmatically. Export all rules to a file and compare them against a known-good baseline. Pay attention to any rule with a BCC or forward action to an external domain.
What is the difference between a content compliance rule and a mail forwarding rule?
A mail forwarding rule is set at the user level in their Gmail settings. The user can see it and disable it. A content compliance rule is set at the Google Workspace domain level by an admin. It applies to all mail matching specified conditions, is invisible to end users, and persists even if the creating admin account is deprovisioned. Content compliance rules are more dangerous because they are harder to detect and can affect entire domains.
Should I block all BCC actions in content compliance rules?
No. Legitimate use cases exist, such as archiving executive communications to a compliance archive or forwarding invoices to an external accounting system. The goal is not to block all BCC actions but to monitor them. Create an alert for any new content compliance rule that includes a BCC action to an external domain. Then verify the business justification before allowing it to persist. A rule without a documented business justification should be treated as a security incident until proven otherwise.
Related Articles

Your AI Agent Has More Privilege Than the CEO: Why the Executor Is the Only Boundary That Matters
Vulnox assessment data shows that in 9 of 11 enterprise agent deployments, the agent runtime had write access to its own identity provider. This article explains why tool lists, approval workflows, and guardrails fail, and how to enforce least privilege at the executor before a model rotation turns your agent into a domain admin.

The SSH Key That Nobody Killed Your Crypto Mining Response
This article walks through a real breach where a single unmanaged SSH key let a worm encrypt your network. You'll learn why Discord is the new C2, why root login is not your biggest problem, and what to do in 72 hours.

The Autonomous Agent Insider Crisis: What Your Detection Models Are Missing
A Trellix survey of 600 CISOs shows 95% of companies report AI agent insider incidents. Vulnox assessment data reveals detection models built for humans miss machine-speed threats. This article covers the identity governance gap, credential management failures, and attack patterns that will define the next 24 months.
Ready to Secure Your Digital Assets?
Get a comprehensive vulnerability assessment for your website today.