How the Canadian Centre for Cyber Security used frontier AI to accelerate detection engineering

An introduction to the Communications Security Establishment Canada's work on artificial intelligence in cyber defence

The Communications Security Establishment Canada is examining how artificial intelligence (AI) can support cyber defence and help cyber security practitioners detect, understand and respond to cyber threats.

This work is being led through the Canadian Centre for Cyber Security (Cyber Centre) Frontier AI Lab, which evaluates emerging AI capabilities and their potential applications in cyber security. The Lab brings together expertise from government, academia, and industry to better understand how these technologies can be used effectively, securely, and responsibly.

This technical article is the first in a series on the work of the Frontier AI Lab. The series will share findings from the Lab's research, including potential applications of frontier AI in cyber defence, the limitations of these technologies, and considerations for their effective, secure, and responsible use.

This first article focuses on detection engineering, the process of creating and testing rules that help cyber defenders identify suspicious activity on networks. As cyber threats continue to evolve and organizations process increasing amounts of data, AI may help support certain aspects of this work.

The article outlines how the Cyber Centre has been testing frontier AI models in real operational environments. These hands-on evaluations have provided practical insight into how AI can support defenders working across complex systems, workflows, data, and cyber security challenges. By incorporating frontier AI into daily cyber defence workflows, the Cyber Centre is better equipped to keep pace with the rapidly evolving threat landscape.

Using a practical test case, the article examines how AI can transform publicly available information about a cyber threat into detection rules. It demonstrates how AI can assist analysts with tasks such as drafting rules, identifying potential gaps, validating results against test and operational data, and preparing outputs for review. Throughout the process, human oversight remains essential, with analysts responsible for assessing outputs, validating results, and making operational decisions.

The findings contribute to the Frontier AI Lab's ongoing work to better understand how AI can support cyber defence while ensuring its use remains effective, secure, and responsible.

On this page

Overview: How the AI-powered detection pipeline works

The Cyber Centre used frontier AI models to create an automated, end-to-end detection engineering pipeline capable of transforming public threat intelligence into validated, production-ready detection rules with minimal human intervention. The pilot project employed multiple agents with distinct roles.

Opus 4.8 was assigned the blue-team role of generating detection logic according to operational specifications.

Mythos was assigned the red-team role of adversarially reviewing the detection logic to identify potential bypasses and challenge its effectiveness.

Together, they form an iterative purple-team loop that produces validated detections for analyst review.

Below is the stepped process for the automated detection engineering workflow as shown in Figure 1:

  1. Blue team agent (Opus 4.8): Threat article ingested
  2. Blue team agent (Opus 4.8): Proposed detection
  3. Red team agent (Mythos): AI generate attack plan
  4. Red team agent (Mythos): Lab auto-provisioned
  5. Red team agent (Mythos): Attack plan executed
  6. Blue team agent (Opus 4.8): Analytic validated
  7. Blue team agent (Opus 4.8): Detection rule to production

Figure 1 : Full end-to-end analytic pipeline

Long description immediately follows
Full end-to-end analytic pipeline - Long description

Figure 1 shows the automated detection engineering workflow from threat intelligence ingestion through human review and production deployment. The Blue Team agent, Opus 4.8, is identified in steps 1, 2, 6 and 7, and is responsible for generating and validating detection logic. Steps 3, 4 and 5, identify the Red Team agent, Mythos, as responsible for creating attack scenarios, provisioning a test environment, and executing attack variants. Figure 1 demonstrates how the agents form an iterative purple-team loop that produces validated detections for analyst review.

Typically, these analytic development stages can take anywhere from several hours to one week, depending on complexity and urgency. The pipeline completed the same work in under an hour, and at a scale that would be difficult for human analysts alone.

Test case: Testing the pipeline against a real-world threat scenario

The following test case expands on each stage of the workflow, demonstrating its effectiveness in practice.

Threat article ingested

The analytic pipeline can begin with a range of inputs. This includes threat articles, blogs, incident reports, analyst descriptions, or any other threat source. In this test case, it began by ingesting public threat research from the GitHub: Exploitarium repository, a collection of vulnerability research and exploit proofs of concept (PoCs). (The Cyber Centre is not responsible for the content of the Exploitarium repository and does not endorse it.)

Proposed detection

The model proposed one or more candidate detections, each with a human-readable description of the logic and an associated hunt query. Several of these hunt queries are later combined, along with additional filters, to create a detection.

Resulting scenario created by the pipeline

Detection Pattern PoC Signal
Service process (redis-server, php, java, ffmpeg) → shell/command All events PROCESS_EXEC with suspicious parent
Network service spawning /bin/sh -c or /bin/bash 3c, 3e, 3g Behavioral anchor: interpreter spawned by non-interactive parent
File creation in /tmp by service process child 3c, 3g, 3h files write from unexpected lineage
SSH client process crash (SIGSEGV/SIGABRT) 3b events PROCESS_EXIT with signal
Git hook execution from web-facing process 3g events PROCESS_EXEC: gogs → bash → hook

Initial Hunt Query for service process -> shell/cmd to get PoC data in context (events):

SELECT Parent.Tag, Child.Tag, action, eventtime, hbs_agent_id
FROM events
WHERE timestamp BETWEEN '{start}' AND '{end}'
    AND hostname IN ('rtlab-ubu01', 'rtlab-web01')
    AND action IN ('PROCESS_EXEC', 'PROCESS_START')
    AND Parent.Tag RLIKE '(?i)(redis-server|php|java|ffmpeg|gogs|ladybird|objdump)'
    AND Child.Tag RLIKE '(?i)(bash|dash|sh|cmd|touch|calc)'
Resulting scenario created by the pipeline - Long description

This resulting scenario created by the pipeline shows a generated detection scenario that includes suspicious process-behaviour patterns and an example hunt query. It highlights how the query filters event logs by time range, host names, process actions, and parent-child process relationships. The figure demonstrates how the pipeline translates public vulnerability research into an initial analytic concept that analysts can review and refine.

AI generates an attack plan

An attack plan is generated, identifying the required infrastructure, software, and PoCs to be detonated. In this case, the PoCs were included in the repository; however, if no public PoCs were available, Mythos would attempt to create its own.

Pipeline scenario

References:

  • /home/omuser/exploitarium-main/c-ares-tcp-uaf-calc-poc/
  • /home/omuser/exploitarium-main/libssh2-cve-2026-55200-poc/
  • /home/omuser/exploitarium-main/floci-apigateway-vtl-rce-poc/
  • /home/omuser/exploitarium-main/php857-streambucket-soap-rce-rpoc/
  • /home/omuser/exploitarium-main/redis-vset-duplicate-hnsw-id-rce-poc/
  • /home/omuser/exploitarium-main/ffmpeg-rasc-dlta-calc-poc/
  • /home/omuser/exploitarium-main/gogs-admin-csrf-git-hook-rce-poc/
  • /home/omuser/exploitarium-main/ladybird-wasm-esm-host-function-poc/
  • /home/omuser/exploitarium-main/objdump-dlx-calc-poc/
Goal

Validate HBS endpoint telemetry detection of network-service and parser-triggered RCE chains on Linux targets. Each PoC produces a distinct behavioral signal: a service process spawning an unexpected child (shell, calc, marker file creation). These generate kragle_report PROCESS_EXEC events with suspicious parent-child relationships that analytics should detect.

Topology (Proxmox range)

Host VMID IP Role Notes
rtlab-ubu01 504 192.168.200.6 target (services) Redis, PHP, FFmpeg, c-ares, libssh2, objdump builds
rtlab-web01 503 192.168.200.13 target (web apps) Gogs, Floci, Ladybird
rtlab-kali01 506 192.168.200.8 attacker Malicious server scripts, exploit drivers
rtlab-ansible01 501 192.168.200.14 controller Stages PoCs + builds from source

Extra VMs needed: None. All PoCs fit on existing Linux VMs.

1. Provision

No terraform changes required. Uses existing module.ubuntu and module.web01.

2. Configure (Ansible)

cd lab/ansible2-vm
ansible-playbook playbooks/scenario-exploitarium-rce-linux.yml \
    -e lab_unsafe_ack=true

The scenario playbook should:

  • On ubu01: install build-essential, cmake, git, python3, libz-dev, libssl-dev
  • On web01: install docker.io, golang (for Gogs), java (for Floci)
  • Stage all 9 PoC directories to /opt/lab/exploitarium/ on the appropriate target
3. Execute

3a. c-ares TCP UAF (ubu01)
cd /opt/lab/exploitarium/c-ares-tcp-uaf-calc-poc
# Build c-ares from vulnerable commit
./scripts/build_from_checkout.sh
# Run PoC (loopback DNS server + vulnerable client)
./scripts/run_until_hit.sh

Expected telemetry: c-ares-linked process spawns unexpected child (command execution). MITRE: T1203 (exploitation for client execution)

Pipeline scenario - Long description

The pipeline scenario shows the lab scenario generated to validate endpoint telemetry for the proposed detection. It lists proof-of-concept references, the testing goal, a Proxmox-based topology with host roles and IP addresses, and step-by-step provisioning and execution instructions. The figure demonstrates how the attack plan is converted into a repeatable lab setup that can generate telemetry for validation.

Lab auto-provisioned

The lab environment is automatically provisioned based on the attack plan and instrumented with the same security stack used in production networks to capture comparable telemetry. Several environment variants may be created to ensure complete test coverage.

Attack plan executed

The attack plan is executed using multiple variants of the technique to exercise the detection logic under different conditions.

Confirmation of successful PoC detonation

  • Behavioural variant detonated at 14:04 UTC. The exploit:
    1. Connected to SSH server on port 2222
    2. Made a second connection to C2 on port 4444 (in-process, no fork/exec)
    3. Wrote proof file directly (in-process fopen/fprintf)

No child process was spawned. Waiting 10 minutes for telemetry, then verifying whether any current signal catches it AND exploring event + network for hardening opportunities.

Confirmation of successful PoC detonation - Long description

The confirmation of successful PoC detonation shows evidence that a proof of concept was successfully detonated in the lab environment. It summarizes a behavioural variant that connects to an SSH server, establishes an in-process connection to a command-and-control server, and writes a proof file without spawning a child process. The figure demonstrates how the pipeline verifies that simulated activity occurred before using the resulting telemetry to assess detection coverage.

Analytics validation

The proposed detection logic is validated against both lab-generated simulations and real operational data, including client telemetry. This iterative process repeats earlier steps, as needed, until the simulated activity is reliably detected and false positives are minimized.

Summary of results from the querying data lake (1 of 2)

  • Excellent. Key findings from event:
    1. CONNECT / DISCONNECT actions — records network connections with the remote IP in child.Tag (e.g., child=192.168.200.8 for the DISCONNECT)
    2. PROCESS_FORK — records fork events, showing parent-child relationships
    3. IMAGE_LOAD — records shared library loads

For the behavioral tier evasion (in-process, no child spawn), the detection opportunity in event is: we can correlate CONNECT events (to SSH ports) with IMAGE_LOAD events (loading suspicious libraries) from the same process — all without needing a child process.

Now let me build the behavioral variant. The evasion: memfd_create() to create an anonymous in-memory file, write an ELF binary to it, then fexecve() — this creates a child process but from an anonymous file descriptor with no path on disk. Let me also consider the pure in-process variant (socket operations only, no fork/exec at all).

Summary of results from the querying data lake (1 of 2) - Long description

The summary of results from the querying data lake (1 of 2) shows a summary of telemetry findings from event data collected during validation. It highlights recorded network, process, and image-load activity, including connections, process-fork relationships, and shared-library loading. The figure demonstrates how the pipeline analyzes observed telemetry to identify durable detection signals and potential evasion paths.

Summary of results from the querying data lake (2 of 2)

Method Tier Original Hardened
Baseline (sh -c) CAUGHT (S1) CAUGHT (S1+S4)
Cosmetic (rename) cosmetic MISSED CAUGHT (S4)
Structural A (execve known) structural CAUGHT (S2) CAUGHT (S2+S5)
Structural B (execve novel) structural MISSED CAUGHT (S5)
Behavioral (in-process C2) behavioral MISSED CAUGHT (S6)

Convergence achieved. All tiers caught. Only evasions that tunnel C2 inside the SSH channel itself (invisible to network telemetry) would bypass Signal 6.


Files Modified
Summary of results from the querying data lake (2 of 2) - Long description

The summary of results from the querying data lake (2 of 2) shows a results table comparing detection performance across different methods and analytic tiers. It summarizes whether the original and hardened detections identified each technique variant and notes a remaining bypass condition involving command-and-control traffic tunneled through SSH. The figure demonstrates how validation results are used to harden the analytic and document the artifacts changed during the process.

Detection rule to production

The resulting detections are then converted into the required analytic engineering formats. This includes Sigma implementations for straightforward detections and Python implementations for more complex analytics, along with any required filters, tuning logic, and supporting documentation. These artifacts are submitted for analyst review as a detailed package containing the supporting evidence, validation results, and implementation details behind the final analytics.

SSH client process

# UNCLASSIFIED / NON CLASSIFIÉ // TLP:CLEAR
title: SSH Client Process Spawns Shell Interpreter
name: SSH_Client_Process_Spawns_Shell_Interpreter
id: a3d7e1f2-9c4b-4a8e-b5d6-7f0e2c1a3b94
status: testing
description: |
  Detects an SSH client process (ssh, scp, sftp, libssh2-linked, PuTTY, plink, Dropbear)
  spawning a shell interpreter with the -c flag. A legitimate SSH client should never
  exec sh -c as a child process — this is the primary indicator of client-side RCE
  exploitation (e.g., CVE-2026-55200 libssh2 heap overflow).
references:
  - https://attack.mitre.org/techniques/T1203/
  - https://nvd.nist.gov/vuln/detail/CVE-2026-55200
author:  CCCS
date: 2026/07/13
modified: 2026/07/13
tags:
  - attack.initial_access
  - attack.t1190
  - attack.execution
  - attack.t1203
  - attack.t1059.004
logsource:
  category: process_creation
  product: linux
detection:
  selection_parent:
    ParentImage|re: '(?i).*([]\\]ssh|[]\\]scp|[]\\]sftp|[]\\]putty|[]\\]plink|libssh|ssh2|dbclient).*'
  selection_child:
    Image|re: '(?i).*(bash|dash|/sh$|zsh|ksh|ash).*'
    CommandLine|re: '(?i)((ba)?sh|dash|zsh|ash|ksh|cmd)\s+(-c|/c)\s+'
  filter_server_side:
    ParentImage|re: '(?i).*(sshd|ssh-agent|ssh-keygen|ssh-add|ssh-keyscan|sshfs).*'
  filter_benign_commands:
    CommandLine|re: '(?i)((ba)?sh|dash)\s+-c\s+(umask|locale|ssh-agent|test\s+-|\[\s+-)'
  condition: selection_parent and selection_child and not filter_server_side and not filter_benign_commands
falsepositives:
  - SSH session setup evaluating .bashrc (filtered by benign command patterns)
  - Legitimate SSH-based automation (Ansible, rsync) — typically uses sshd as parent, not ssh client
level: high
SSH client process - Long description

The SSH client process describes how to detect an SSH client launching a shell interpreter via the -c flag. It includes metadata, references to MITRE ATT&CK and CVE-2026-55200, Linux log source details, regex-based detection criteria and filters, noted false positives, and a severity level marked high.

Pipeline orchestration

The workflow is orchestrated by a collection of specialized agent skills, each responsible for a specific stage of the detection engineering process. These skills can be tuned by analysts to improve consistency, enforce quality standards, and ensure repeatable outcomes across different use cases.

Skills invoked during the purple-loop

Skill Purpose How it was used
/purple-loop Orchestration framework Loaded at session start with arg scenario-exploitarium-rce-linux. Defined the 7-step workflow: export → PoC → detonate → verify → decide → harden → record.
/ensure-trino-auth JWT validation Called twice (once proactively, once after token expiry). Decodes the TRINO_JWT payload, checks the exp claim against current UTC time, prompts user if expired.
/run-analytic Production noise check After adding Signal 5, ran the full analytic SQL against 3 days of production data via Trino to confirm 0 false positives.
/export-analytic Red team handoff Extracted the analytic's WHERE clauses, behavioral anchors, kragle_report Action coverage, and blind spots into red-agent/exports/ssh_client_rce_spawn.md. This is what the red-team side reads to design evasions.
/poc-cpp PoC authoring rules Guided the creation of each C variant — one observable behavior per file, comments citing the technique, placement under lab/poc/T1190_libssh2-rce/.
/detonate-poc Lab execution with approval gate Built a fire plan for each detonation (target resolution from lab-hosts.json, pre-flight checks, staging confirmation). User approved each execution before guest-side commands ran.
/verify-evasion Post-detonation verification Converted the Spark SQL analytic to Trino syntax, scoped to the detonation agent_id + time window, and queried hits tables + raw telemetry tables.
Skills invoked during the purple-loops - Long description

The skills invoked during the purple-loop shows the commands and skills used across the automated security analytics workflow. It pairs each command with its purpose and usage notes, covering activities such as proof-of-concept export, detonation, telemetry verification, analytic review, and decision-making.

Results and operational benefits

After multiple rounds of automated testing against generated telemetry and technique variants, the agents iteratively refined the analytics. Once completed, the pipeline prepared the production-ready detections and submitted them for analyst review. Analysts could then validate, approve, or modify the detections as needed before they were merged into the repository. In total, 8 new production detection rules were created from the above test case, with more than 5 variants of each technique tested to identify durable behaviour indicators.

Overall, frontier AI is a force multiplier that can help identify detection gaps faster and operationalize defensive analytics at a pace that better matches the evolving threat landscape. By automating much of the detection engineering workflow, analysts can spend less time performing repetitive tasks and more time:

  • analyzing real malicious activity
  • observing how techniques behave under different conditions
  • providing valuable feedback to upstream engineering teams on identified visibility gaps

Next steps for the Cyber Centre’s use of frontier AI

While the overall capability continues to mature, the progress to date has been very encouraging. Several components are already delivering operational value, and the workflow will continue to evolve through collective use and feedback.

Additional ongoing efforts are applying the same techniques to continuously refine and strengthen existing detections by transforming validated false positives into structured, evidence-based tuning recommendations.

Date modified: