Send ONTAP Ransomware Alerts to Your SOC with Wazuh and Mattermost
ONTAP Autonomous Ransomware Protection (ARP) watches your volumes and raises an alert when files start being encrypted. In many organizations, though, that alert lands in System Manager or in an AutoSupport mail that the security team never sees.
This guide connects ONTAP to the tools a SOC actually watches:
- Wazuh (SIEM) receives the ARP event as a level-14 alert, mapped to MITRE ATT&CK T1486 (Data Encrypted for Impact). It also receives ONTAP’s audit log, so every response action is on record next to the alert.
- Mattermost (chat) gets an alert card that already has the context: the volume, the suspect files, who is connected over SMB and from which PC, and the last clean snapshot. The card has three buttons: Isolate the user, Restore the volume from the clean snapshot, and Close the incident.
Everything here was built and tested end to end in my homelab (ONTAP Select 9.19.1, Wazuh 4.14, Mattermost 12.1) with a real ARP detection of a simulated attack from a Windows PC. All the code and config files are on GitHub: ontap-soc-integration on GitHub.
This guide assumes you already run ONTAP, Wazuh and Mattermost, and that you’re comfortable with the ONTAP CLI. If you haven’t hardened the cluster itself yet, start with my NetApp ONTAP security hardening guide.
- ONTAP sends ARP events over syslog to Wazuh.
- The same events go to a small service, ontap-soc-responder, through an EMS REST API (webhook) destination over HTTPS.
- The responder looks up the context on ONTAP and posts an alert card in a Mattermost channel.
- An analyst clicks a button on the card.
- Mattermost calls the responder back.
- The responder makes the change on ONTAP through the REST API, as a dedicated account with a limited role.
- ONTAP’s audit log goes to Wazuh as well, so every change made from the card is on record.
Nothing changes on ONTAP without a person clicking a button. The responder only reads until then.
| Component | Tested with | Notes |
|---|---|---|
| ONTAP | 9.19.1 | ARP needs ONTAP 9.10.1 or later. The REST calls used here exist in recent 9.1x releases. |
| Wazuh | 4.14 | Manager reachable from ONTAP on TCP 514 |
| Mattermost | 12.1 (Team Edition) | System admin access to create a bot |
| Responder host | Linux, Python 3.9+ | Any VM or container. ONTAP and Mattermost must reach it on one HTTPS port, and it must reach ONTAP and Mattermost. |
Names used in this guide (change them to yours):
| Storage VM with the SMB share | svm_files |
| Volume | projects |
| Wazuh manager | wazuh.example.com |
| Mattermost | https://chat.example.com |
| Responder | https://soc-responder.example.com:8443 |
The screenshots come from my lab, where the storage VM is called corp_fs.
ARP watches a volume’s file activity: entropy, file extensions and IOPS patterns. The responder can only restore to a snapshot that was taken before the attack, so the volume needs a snapshot policy as well.
cluster1::> volume modify -vserver svm_files -volume projects -snapshot-policy default
cluster1::> security anti-ransomware volume enable -vserver svm_files -volume projects
cluster1::> security anti-ransomware volume show -vserver svm_files -volume projects
Vserver Name: svm_files
Volume Name: projects
State: enabled
Attack Probability: none
...
Depending on your ONTAP version, ARP first runs in a learning (dry-run) mode before it switches to active mode. On recent versions (ARP/AI) it is active straight away. In System Manager you’ll find it under Storage > Volumes > volume > Security:
Tip: to protect every new volume on the storage VM, set
vserver modify -vserver svm_files -anti-ransomware-default-volume-state dry-run(orenabled).
The responder needs a few privileges, and only on the storage VMs it protects. Create a cluster-scoped role whose rules are limited to svm_files with a query:
cluster1::> security login role create -role soc_responder -cmddirname "volume" -access readonly -query "-vserver svm_files"
cluster1::> security login role create -role soc_responder -cmddirname "volume snapshot" -access all -query "-vserver svm_files"
cluster1::> security login role create -role soc_responder -cmddirname "security anti-ransomware volume" -access all -query "-vserver svm_files"
cluster1::> security login role create -role soc_responder -cmddirname "vserver cifs share" -access readonly -query "-vserver svm_files"
cluster1::> security login role create -role soc_responder -cmddirname "vserver cifs share access-control" -access all -query "-vserver svm_files"
cluster1::> security login role create -role soc_responder -cmddirname "vserver cifs session" -access all -query "-vserver svm_files"
cluster1::> security login create -user-or-group-name soc_responder -application http -authentication-method password -role soc_responder
Why each rule is there:
| Command directory | Access | Used for |
|---|---|---|
volume | read | find the volume and its ARP state |
volume snapshot | all | list snapshots, restore the clean one |
security anti-ransomware volume | all | read the suspect files, clear the suspect state when the incident is closed |
vserver cifs share | read | find the shares on the volume |
vserver cifs share access-control | all | add and later remove a No access entry for the user |
vserver cifs session | all | list SMB sessions on the volume, close the user’s sessions |
To protect more storage VMs, use -query "-vserver svm_files|svm_other". The account can’t create or delete volumes, can’t change other storage VMs, and can’t log in over SSH.
cluster1::> event filter create -filter-name soc-ransomware
cluster1::> event filter rule add -filter-name soc-ransomware -type include -message-name *arw*
cluster1::> event filter rule add -filter-name soc-ransomware -type include -message-name app.log.notice
*arw* matches every ARP event, including callhome.arw.activity.seen, the one that says an attack was detected. app.log.notice is only there so you can send a test event later (step 7). You can remove it once you’re live.
cluster1::> event notification destination create -name soc-siem -syslog wazuh.example.com -syslog-port 514 -syslog-transport tcp-unencrypted -syslog-message-format rfc-5424
Use rfc-5424, because the Wazuh decoder in step 4 expects that format.
ONTAP checks the responder’s certificate, so first install the CA that signed it:
cluster1::> security certificate install -type server-ca -vserver cluster1
Please enter Certificate: Press <Enter> when done
-----BEGIN CERTIFICATE-----
...
Then create the destination. The last part of the URL is a long random secret that you’ll also give the responder (step 6). It works as the webhook’s password.
cluster1::> event notification destination create -name soc-responder -rest-api-url https://soc-responder.example.com:8443/ems/<RESPONDER_SECRET>
cluster1::> event notification create -filter-name soc-ransomware -destinations soc-siem,soc-responder
The destination check command isn’t available in ONTAP 9.19.1. To see if a destination works, read its connectivity state from the REST API once an event has been sent:
curl -s -u admin https://cluster1.example.com/api/support/ems/destinations/soc-responder?fields=connectivity
{ "connectivity": { "state": "success" } }
cluster1::> cluster log-forwarding create -destination wazuh.example.com -port 514 -protocol tcp-unencrypted -facility user
ONTAP’s audit log records every change made through the CLI or REST API, including what the responder does.
In production: use
-syslog-transport tcp-encrypted/-protocol tcp-encryptedwith a TLS syslog receiver if your SIEM has one.
On the Wazuh manager, add a <remote> block to /var/ossec/etc/ossec.conf (config/wazuh_cluster/wazuh_manager.conf in the Docker deployment):
<remote>
<connection>syslog</connection>
<port>514</port>
<protocol>tcp</protocol>
<allowed-ips>192.0.2.0/24</allowed-ips> <!-- the subnet of ONTAP's management LIFs -->
</remote>
Use tcp. A syslog listener in Wazuh uses one protocol: with udp,tcp it logs warning 9002 (“Only secure connection supports TCP and UDP at the same time”) and falls back to TCP anyway. In the Docker deployment, check that 514:514/tcp is published in docker-compose.yml.
Copy two files from the repo to the manager:
wazuh/ontap_decoders.xml→/var/ossec/etc/decoders/wazuh/ontap_rules.xml→/var/ossec/etc/rules/
chown wazuh:wazuh /var/ossec/etc/decoders/ontap_decoders.xml /var/ossec/etc/rules/ontap_rules.xml
/var/ossec/bin/wazuh-control restart
The decoders pull out the event name, node, volume and storage VM from EMS events, and the user, source address, command and result from audit log lines. The rules:
| Rule | Level | Fires on |
|---|---|---|
| 100500, 100501 | 3 | any ONTAP EMS event |
| 100505 | 5 | ARP state events (arw.*) |
| 100510 | 14 | callhome.arw.activity.seen: ransomware activity detected, MITRE T1486 |
| 100519, 100520 | 2 | any audit log entry (a change on ONTAP) |
| 100521 | 8 | a change made by the soc_responder account |
Rules 100501 and 100519 matter more than they look. Wazuh’s generic syslog rule 1002 (“Unknown problem somewhere in the system”) grabs any line that contains words like attack or error before your own rules see it. The ARP clear command is literally .../attack/clear-suspect, so without these two rules that step silently drops out of your trail. They take ONTAP’s lines back from rule 1002.
The core of the alert rule:
<rule id="100510" level="14">
<if_sid>100500,100501</if_sid>
<field name="ontap.event" type="pcre2">^callhome\.arw\.activity\.seen$</field>
<description>Ransomware activity detected by ONTAP on volume $(ontap.volume) (storage VM $(ontap.svm))</description>
<mitre><id>T1486</id></mitre>
<group>ransomware,</group>
</rule>
wazuh-logtest shows how a line is decoded and which rule fires. Paste an ARP event in the format ONTAP sends:
# /var/ossec/bin/wazuh-logtest
1 2026-12-01T12:48:57+00:00 cluster1-01 kernel - callhome.arw.activity.seen - Call home message for "POSSIBLE RANSOMWARE ACTIVITY DETECTED", Volume: "projects" (UUID: "8ca7e607-...") in Vserver: "svm_files" (UUID: "c6b25843-...")
**Phase 2: Completed decoding.
name: 'netapp-ontap'
ontap.event: 'callhome.arw.activity.seen'
ontap.node: 'cluster1-01'
ontap.svm: 'svm_files'
ontap.volume: 'projects'
**Phase 3: Completed filtering (rules).
id: '100510'
level: '14'
description: 'Ransomware activity detected by ONTAP on volume projects (storage VM svm_files)'
mitre.id: '['T1486']'
mitre.technique: '['Data Encrypted for Impact']'
**Alert to be generated.
Don’t fake this event on a live cluster.
callhome.*events trigger AutoSupport. To test the whole chain, use the drill in step 7.
System Console > Integrations > Bot Accounts: set Enable Bot Account Creation to true.
When someone clicks a button, the Mattermost server calls the responder. Mattermost blocks calls to internal addresses unless you allow them. In System Console > Environment > Developer, add the responder’s host name to Allow untrusted internal connections to:
Mattermost must also trust the responder’s TLS certificate. If you use an internal CA, add it to the Mattermost server’s trust store. In Docker, mount it and set SSL_CERT_DIR=/etc/ssl/certs:/path/to/your/ca.
Integrations > Bot Accounts > Add Bot Account: username ontap-guard, display name ONTAP Guard, role Member. Save, then copy the access token that’s shown. You won’t see it again.
Create a channel, for example #soc-alerts. Add the bot and your analysts to it. The responder needs the channel ID: open the channel, click its name, then View Info. The ID is at the bottom.
Only members of this channel can use the buttons. You can narrow that to named users with MM_ALLOWED_USERS (step 6).
The responder is one Python file, ontap-soc-responder.py, under 500 lines. Its only dependency is requests. It:
- receives ONTAP’s webhook on
/ems/<secret>, and withEMS_ALLOWED_SOURCESonly from ONTAP’s addresses - on
callhome.arw.activity.seen, reads the volume’s ARP report, snapshots, SMB shares and sessions from ONTAP, and posts the card - receives button clicks on
/mm/action. Each button carries a signature that Mattermost never shows to users. The responder also checks that the person who clicked is a member of the channel. - runs the step and replies in the card’s thread
Clone the repo on the responder host and run the commands from the repo folder:
git clone https://github.com/johnhenriksson/ontap-soc-integration.git
cd ontap-soc-integration
sudo useradd --system --home /opt/ontap-soc-responder ontap-soc
sudo mkdir -p /opt/ontap-soc-responder /etc/ontap-soc-responder
sudo python3 -m venv /opt/ontap-soc-responder/venv
sudo /opt/ontap-soc-responder/venv/bin/pip install requests
sudo cp ontap-soc-responder.py /opt/ontap-soc-responder/
sudo cp responder.env.example /etc/ontap-soc-responder/responder.env
sudo cp ontap-soc-responder.service /etc/systemd/system/
Put the responder’s TLS certificate and key in /etc/ontap-soc-responder/ (readable by ontap-soc), then edit responder.env:
ONTAP_HOST=cluster1.example.com
ONTAP_USER=soc_responder
ONTAP_PASSWORD=...
ONTAP_CA_BUNDLE=/etc/ontap-soc-responder/ontap-ca.pem
MM_URL=https://chat.example.com
MM_BOT_TOKEN=... # from step 5c
MM_CHANNEL_ID=... # from step 5d
MM_ALLOWED_USERS= # empty = any member of the channel
RESPONDER_URL=https://soc-responder.example.com:8443
RESPONDER_SECRET=... # the same secret as in the ONTAP webhook URL
TLS_CERT=/etc/ontap-soc-responder/tls.crt
TLS_KEY=/etc/ontap-soc-responder/tls.key
EMS_ALLOWED_SOURCES=192.0.2.10/32,192.0.2.11/32
Make a secret with openssl rand -base64 30 | tr -d '/+='. Then:
sudo chmod 600 /etc/ontap-soc-responder/responder.env
sudo chown -R ontap-soc: /etc/ontap-soc-responder
sudo systemctl enable --now ontap-soc-responder
curl --cacert your-ca.pem https://soc-responder.example.com:8443/healthz # {"ok": true}
The responder logs one JSON line per event to the journal (journalctl -u ontap-soc-responder -f), and keeps open incidents in /var/lib/ontap-soc-responder/incidents.json, so the buttons still work after a restart.
| Button | ONTAP REST calls (as soc_responder) |
|---|---|
| Isolate user | DELETE /api/protocols/cifs/sessions/… for each of the user’s sessions, then POST /api/protocols/cifs/shares/…/acls with no_access for the user on every share of the volume |
| Restore from snapshot | volume snapshot restore -force true to the newest snapshot taken before the attack (through /api/private/cli) |
| Restore access & close | security anti-ransomware volume attack clear-suspect -false-positive false, then remove the no_access entries |
Two details matter:
- Which snapshot is “clean”? The responder uses the time in the volume’s ARP attack report (
anti_ransomware.attack_reports[].time), when ONTAP saw the attack begin, and picks the newest snapshot before it. Don’t use the per-file suspect times: some of them can be older than the attack itself. - Why
-force? During an attack ARP takes its ownAnti_ransomware_backupsnapshots. A normal restore to an older snapshot is refused while they exist.-forcerestores anyway and discards the newer snapshots, so press Restore only once you’re sure.
To test the whole chain, send ONTAP an application log event that the responder treats as a detection. The subject is <volume> <storage VM>:
curl -s -u admin -X POST https://cluster1.example.com/api/support/ems/application-logs \
-H 'Content-Type: application/json' \
-d '{"computer_name":"soc","event_source":"soc-drill","event_id":'$RANDOM',"app_version":"1",
"category":"drill","event_description":"projects svm_files","severity":"notice","autosupport_required":false}'
A card appears in #soc-alerts. Use a new event_id each time, because ONTAP suppresses repeats of the same event. The card shows Attack probability: None, because ARP saw nothing on the volume. That’s how you can tell a drill from a real detection. The drill doesn’t reach Wazuh’s level-14 rule. Check that one with wazuh-logtest (step 4c).
For a real test, use a scratch volume with test data and a script that overwrites a few hundred files with random data and renames them. Never on production data. ARP needs some time to flag it.
This is the second of two test runs, start to finish. A Windows PC logged on as finance.user encrypts 1000 invoices on the projects share:
The alert arrives in Mattermost with what the analyst needs to decide: what was hit, who is connected and from where, and where to go back to. ARP flagged the attack after 682 files, so the card shows 682 suspect files rather than all 1000:
In Wazuh, the same event is a level-14 alert with MITRE ATT&CK T1486:
Isolate closes the user’s SMB session and blocks them from the share:
On the PC, the share now refuses access:
Restore rolls the volume back to the clean snapshot. All 1000 invoices were back, with no .locked files left:
Restore access & close clears the attack on ONTAP and gives the user their access back:
The trail in Wazuh: the alert, then every change the responder made, from ONTAP’s own audit log:
The same flow works for persistent volumes provisioned by Trident (see Trident: persistence in an ephemeral world for an introduction). Set K8S_ENABLED=1 and give the responder kubectl access. When the attacked ONTAP volume has no SMB share, the responder looks for the PersistentVolume whose volumeAttributes.internalName is that volume. It then finds the PVC, the Deployment that mounts it, and the newest VolumeSnapshot from before the attack. The buttons become:
- Stop deploy/name: scale to 0, and keep the attacked PVC as evidence
- Recover from VolumeSnapshot: a new PVC
<name>-recoveredfrom the snapshot (a FlexClone on ONTAP), with the Deployment moved onto it - Close incident: clear the suspect state on ONTAP
I tested the Kubernetes flow end to end with my lab build of the responder. The repo version has the same logic, but my test runs of the repo version covered the SMB flow, so give the Kubernetes path a drill on a test namespace first.
- Wazuh’s rule 1002 eats lines with “attack” in them. My first test run had every response step in the SIEM except clear-suspect.
wazuh-logteston the real line showed rule 1002 winning. The fix is the twoif_sid 1002rules in the rule file. - Wazuh syslog listens on one protocol.
udp,tcpgives warning 9002 and TCP only. Saytcp. - The EMS webhook body is chunked XML (namespace
http://www.netapp.com/filer/admin), not JSON. The volume and storage VM are in the event text:Volume: "…" … Vserver: "…". - ONTAP suppresses identical events sent shortly after each other. Drills need a new
event_idevery time. - Closing an SMB session needs its connection ID as well as its session ID. A wildcard isn’t accepted.
- Windows remembers “Access denied” for the share for the rest of its logon session, even after access is restored. The user needs to log off and on again (or reconnect the drive).
- ONTAP checks the webhook’s certificate: install the responder’s CA with
security certificate install -type server-cafirst, or the destination will fail. - The audit log shows REST calls with UUIDs (
DELETE /api/protocols/cifs/sessions/<node>/<svm>/…). The/api/private/cli/...calls show their parameters, which makes the trail easier to read. Note that ONTAP also audits GET calls made through/api/private/cli, so the responder reads through the regular REST endpoints to keep the trail clean. - Don’t fake
callhome.*events to test: with AutoSupport on, they go to NetApp too.
- Run the responder’s HTTPS with a certificate from your internal CA. Set
ONTAP_CA_BUNDLEso the responder checks ONTAP’s certificate too. - Set
EMS_ALLOWED_SOURCESto ONTAP’s management addresses, andMM_ALLOWED_USERSto your incident responders. - Use encrypted syslog if your SIEM supports it.
- Keep Restore as a human decision. The restore discards everything written after the snapshot.
- Remove the
app.log.noticerule from the EMS filter once you’re done testing. - Add the Wazuh rule IDs to your existing alerting (email, pager, ticketing). Rule 100510 is level 14 on purpose.
Lab notes: built and tested on ONTAP 9.19.1 (ONTAP Select in my homelab), Wazuh 4.14.10, Mattermost 12.1 Team Edition, with a simulated attack on test data from a Windows 10 PC. The responder is a sample, not a NetApp product. Review it and test it in your own environment before you rely on it.
Short videos of this setup, for a file share and for a Kubernetes pod, are in my LinkedIn post.














