Advent Calendar Day 4: Turning a Veeam Malware Event into a ServiceNow Ticket
// Table of Contents
Advent Calendar Day 4: Turning a Veeam Malware Event into a ServiceNow Ticket
Disclaimer: I’m not a professional developer, and this content is intended to demonstrate the “art of the possible” rather than serve as production-ready guidance. Use these features with caution, and test thoroughly in your environment before relying on them for critical tasks.
Welcome back to Day 4 of our Veeam Blog Advent Calendar! Yesterday was all about sending a Wazuh alert into Veeam through the Incident API. Today we’re taking a Veeam malware event the other way, out of VBR and into ServiceNow.
Seeing a malware event in VBR is one thing, but I want that same event to turn up where someone can actually triage it. Veeam’s REST API hands over everything about the event, and ServiceNow is where I thought would be a good place for it to land. The incident could be assigned to your security team as an example and they could keep a close eye on what’s happening in the environment.
Here’s what we’re going to do: poll VBR for malware events, create one ServiceNow incident for each event, and make sure running the poll again doesn’t create a duplicate. Then we’ll flip it around and let the ticket drive the response.
Coffee and a mince pie at the ready? Let’s get into it!
How It Works
The poller is a small Python script (standard library only, nothing to install) that runs every minute on a systemd timer on my demo VM, lab-demo-01. Each run does three things:
- Signs in to the VBR REST API as the same service account we used yesterday,
svc-incident-demo - Reads
GET /api/v1/malwareDetection/events, asking only for events created since its last look, then signs straight back out - For each event it hasn’t seen before, opens one incident in ServiceNow through the Table API
The very first run doesn’t ticket anything. It just writes down “now” as its starting point, so all the old demo events already sitting in VBR don’t turn into a pile of tickets on day one.
Starting with the Veeam Event
Everything here starts with what VBR hands back. To get a fresh event, I ran yesterday’s (totally fake) ransomware attack again with the same trigger playbook, and a few seconds later there it was in VBR:
Whoever picks up the ticket doesn’t need every field, so I was a bit choosy. These are the ones the poller puts in the incident, as VBR returned them for this event:
- The event ID, which becomes our correlation key (more on that in a minute)
- The machine: its name,
lab-demo-01, and its backup object ID - Severity (Infected), engine (Wazuh) and source (External)
- When it was detected and when Veeam created the event, which aren’t the same thing, as you’ll see
- Who reported it,
svc-incident-demo - The details, which here are the Wazuh rule that fired
Creating the Incident
On the ServiceNow side, it’s the Table API, with a REST API key sent in the x-sn-apikey header (ServiceNow has been turning off basic auth to its REST API for most users this year, so a key was the way to go). Creating an incident is one call, POST /api/now/table/incident, with the fields in a JSON body: a short description, the description built from the fields above, urgency, impact and a caller.
Here’s the incident the poller opened for that event:
See the two times? Wazuh detected the attack at 03:24:18.510 UTC, and Veeam created the event 1.3 seconds later, when custom-veeam’s request landed. Having both in the ticket is handy when someone’s piecing a timeline together.
Polling Without the Duplicates
Let’s be honest, nobody wants a brand new ticket every time a script polls. So every incident gets a correlation_id built from Veeam’s event ID, veeam-malware-event:<event ID>, and before the poller creates anything, it asks ServiceNow whether an incident with that ID already exists. Here’s the heart of it, trimmed down a little:
found = snow.request("GET", "/api/now/table/incident", {
"sysparm_query": "correlation_id=" + CORRELATION_PREFIX + event_id,
"sysparm_fields": "sys_id,number", "sysparm_limit": "1"})
if found:
return found[0]["number"], False # already ticketed, nothing to do
record = snow.request("POST", "/api/now/table/incident", ..., body)ServiceNow is the source of truth here. The poller also keeps a little state file of what it’s already ticketed, so a normal run doesn’t have to search for every old event, but if that file ever went missing, the search would still stop a duplicate.
The Proof
Here’s how it played out (times in AWST, my local time):
| Time | What happened |
|---|---|
| 11:24:15 | The fake ransomware starts on lab-demo-01 |
| 11:24:19 | Veeam creates the malware event |
| 11:25:05 | The poller’s next run opens INC0010008 |
So about 46 seconds from Veeam’s event to a ticket, and most of that was just waiting for the timer’s next minute.
Then I ran the poll twice more, straight after each other, through a check in my lab’s validation playbook. Here’s its report:
Run 1 (ok): 1 event(s) read, 0 incident(s) opened, 0 found in ServiceNow, 1 already ticketed, 0 failed.
Run 2 (ok): 1 event(s) read, 0 incident(s) opened, 0 found in ServiceNow, 1 already ticketed, 0 failed.
The second run read 1 event(s) and opened no incident.
Event a3e07339-7255-46b6-80e1-f12ee4853390: 1 incident(s) INC0010008And to compare the incident count properly, the check asks ServiceNow itself how many incidents carry that event’s correlation ID. One, exactly as it should be:
One event, one ticket, no matter how many times the poll runs. Exactly what I wanted!
How Did It Go?
Honestly, the live run worked first time, but only because the reviews of the code caught a few things beforehand. The one that mattered most: the VBR service account is shared with yesterday’s integration and my demo dashboard, and VBR locks an account after three failed sign-ins, which is exactly what you want on a backup server. A poller signing in every minute could hit that fast if the password ever changed, so it now stops after a single refusal and won’t try again until its config changes.
There was one more thing to tune once it was live. When I reset the demo afterwards, which marks the VM clean in Veeam, a minute later a second ticket turned up: INC0010009, “Veeam malware event on lab-demo-01: Clean”. That’s because markAsClean is recorded as a malware event of its own, with a severity of Clean and a source of MarkAsCleanEvent, which is great for the audit trail, as you can see exactly when a machine was cleared. My poller just ticketed it a bit too keenly! So it now skips Clean events and only tickets real detections. If you build your own, filter on severity, or your SOC gets a ticket every time someone says “all good”.
A few smaller things I noticed:
- The times in ServiceNow look odd at first. The incident list says it was opened at 2026-11-17 19:25:05. That’s just my developer instance showing its own time zone, and it’s the same moment as 03:25:05 UTC.
- No assignment group. My developer instance doesn’t have a “Security Operations” group, so the incident opened unassigned. In a real instance you’d route it straight to your SOC.
- VBR logs every sign-in. That’s exactly what you want from your backup server, but it means a poller signing in every minute adds an entry to VBR’s audit log every minute. Fine for a short demo, and it’s another reason I only switched the poller on for this post, and switched it off again once I had my screenshots. For anything longer lived, the official app below is the way to go.
Going Both Ways
The poller is the simple version, and it’s pretty much what Veeam’s official app does for real (more on that in a bit). But on my dashboard from yesterday, I wanted to see what happens when the ticket doesn’t just record the response, it runs it.
The ticket comes first
When I run the attack from the dashboard, it doesn’t wait for Veeam at all. The incident opens on Wazuh’s first loud alert, at the same time custom-veeam is telling Veeam, so the ticket holds the whole response right from the start. In the run from yesterday’s post, it was open 5.2 seconds after the attack began.
It’s the same Table API as the poller, with the run’s own ID as the correlation ID this time, so a retry finds the incident it already opened instead of opening another:
GET /api/now/table/incident?sysparm_query=correlation_id=<run ID>
POST /api/now/table/incident{
"short_description": "Ransomware activity on lab-demo-01: Wazuh rule 100204 (level 12)",
"description": "<the steps so far, and the ATT&CK techniques Wazuh has seen>",
"urgency": "1",
"impact": "2",
"correlation_id": "<run ID>",
"correlation_display": "Incident API demo"
}Urgency 1 with impact 2 comes out as priority 2 (High) in ServiceNow’s default matrix, which feels about right for ransomware on a box. Here’s the incident it opened for that run:
From there, the incident becomes the run’s audit log. Every step lands as a work note with its own timestamp: each new ATT&CK technique Wazuh spots, the network cut, Veeam’s malware event, and every backup job starting and finishing. Each one’s just a PATCH on the incident with a work_notes field:
PATCH /api/now/table/incident/<sys_id>
{"work_notes": "<what happened, and when (UTC)>"}My end-to-end check counted 14 work notes on one run, with the cut among them. Here’s the start of that audit log, newest at the top, so read it from the bottom up: the incident opening as priority 2, the cut 0.2 seconds after Wazuh’s alert, custom-veeam telling Veeam, Veeam recording the event, and the first backup job starting. (The times in each note’s header are my developer instance’s own time zone again, and the UTC times are in the notes themselves.)
The ticket talks back
And this is where it goes both ways. While the run’s on screen, the dashboard keeps reading the incident, so whoever’s working the ticket can drive the response from ServiceNow without ever touching the lab:
- Type
start IREin a work note and the dashboard opens the clean room (more on that in a second), then replies with a work note of its own saying what it’s doing.end IREcloses it again. Only work notes count, never the customer-visible comments, and the dashboard ignores its own notes. - Resolve the incident and the whole demo resets itself: the VM goes back on the network, its files come back, and Veeam marks it clean. If someone resolves it a bit too early, it waits for the attack’s backup to finish first, so nothing ends up flagged by mistake.
Here’s how that looked on the run, again read from the bottom up. start IRE went in once all five backups had finished, the dashboard answered two seconds later, each room posted its own note as it started, and four minutes after that the sealed room’s verdict landed right there in the ticket. (I’ve blanked out my orchestrator’s name and links.)
ServiceNow never connects into my lab, either. The dashboard does all the talking, outbound, which is exactly how I’d want it. Every 3 seconds while a run’s on screen, it makes two reads:
GET /api/now/table/incident/<sys_id>?sysparm_fields=number,state,priority,assignment_group,resolved_by,resolved_at
GET /api/now/table/sys_journal_field?sysparm_query=element_id=<sys_id>^element=work_notes^ORDERBYDESCsys_created_on&sysparm_limit=50The first one watches the incident’s state. As soon as it reads 6 (Resolved) or 7 (Closed), the reset kicks off, exactly as if I’d pressed the button. And it works the other way round too: press Reset on the dashboard and it resolves the incident itself, with a PATCH setting state to 6, a close code of “Solution provided” and close notes saying what the reset did.
The second read is the clever bit. Work notes don’t live on the incident record at all. Each one’s a row in ServiceNow’s sys_journal_field table, tied to the incident by element_id. So the dashboard reads the newest 50, skips any it’s already handled (it remembers each note’s sys_id, so a restart never replays one) and any written by its own account, and checks the first line of the rest:
IRE_COMMANDS = {"start ire": "start", "end ire": "end"}
def ire_command(text):
""""start" or "end" when a work note's first line is start IRE or end IRE."""
if not isinstance(text, str) or not text.strip():
return None
first = re.sub(r"\s+", " ", text.strip().splitlines()[0]).strip().rstrip(".!?,;:").strip().lower()
return IRE_COMMANDS.get(first)Any case, extra spaces and a full stop on the end are all fine, so Start IRE. works. But it never guesses at a typo, because “close enough” isn’t what you want from something that spins up recovery environments!
ServiceNow’s access rules can hide sys_journal_field from an API account without any error, so if you build your own and the read comes back empty, your commands are never seen. That one caught me out on the first live run. A read ACL for the account sorts it, and the dashboard now spots the problem for me (an empty read, when it knows it’s posted notes itself) and says so on its ServiceNow card.
The sealed room
So the box is off the network, and Veeam has a fresh restore point of it, flagged Infected. Now what? Usually someone wants a proper look at what happened, without going anywhere near production.
That’s what start IRE kicks off. A little orchestrator I built takes that Infected restore point and restores it through VBR into a sealed network on Proxmox, where it can’t reach anything else. Then it runs two checks inside: one hunts for ransomware indicators, and the other makes sure the room really is sealed. In my runs it’s ready in about four minutes, and the work note it posts even includes the SSH command to get in.
And the verdict? INFECTED, exactly as it should be, with the isolation check passing. The security team gets a sealed copy of the infected machine to investigate, while the real one stays cut off.
Here’s the dashboard’s Clean rooms board from that run. Room 1’s verdict is Infected and it’s held for the investigators, with every one of the 36 locked files found and the way out to the network blocked. Along the top you can see the restore point it picked, 16:12, the one Veeam wrote after the attack (and Room 2 on the right, already busy with the last clean copy from 06:05):
There’s a second room too, which recovers the last clean copy from the Veeam Data Cloud Vault into Azure, but that one deserves a day of its own. I’m saving it for Day 15!
Wait, Veeam Already Does This?
I’ll be honest, I had a lot of fun building this one. Everything you’ve just seen uses the two public APIs directly, glued together with a little script of mine, and the ServiceNow end of it is a free developer instance. It’s the art of the possible, as we like to say: a homelab mock-up to show just how easy it is to tie these things together.
But the part that surprises a lot of people is that everything we’ve hand-built over the last two days, Veeam already ships for real, as supported integrations built for enterprise customers. So think of the last two days as a peek under the hood, because my little scripts are barely scratching the surface of what these do!
ServiceNow
The Veeam App for ServiceNow is Veeam’s certified app on the ServiceNow Store. Version 2 collects VBR’s malware detection events and opens ServiceNow incidents from them, through rules you set up. Sound familiar? That’s exactly what we just built by hand ๐
It does a lot more than that, too. The same rules can raise incidents from four-eyes authorization requests and Security & Compliance Analyzer results, you can run VBR backup and restore jobs straight from ServiceNow and work with Veeam ONE alarms, and it supports VBR 12.3 and 13. The user guide has all the details, and it’s free for Veeam Data Platform Advanced and Premium customers.
Security platforms
Remember Day 3, where Wazuh told Veeam about an attack? The big security platforms have official Veeam apps that do that and plenty more:
- Microsoft Sentinel: the Veeam App for Microsoft Sentinel brings in VBR events and Veeam ONE alarms and raises incidents from them. Its playbooks can find clean restore points, scan a backup, or run a Quick Backup or an Instant Recovery. You’ll find it in Sentinel’s Content Hub (the solution’s source is on GitHub).
- Palo Alto Networks Cortex XSOAR and XSIAM: the Veeam App opens XSOAR incidents for malware detections and other Veeam findings, and its playbooks can run a Quick Backup, an Instant VM Recovery or a YARA scan.
- Splunk: the Veeam App for Splunk gives you dashboards, alerts and reports built from VBR events and Veeam ONE alarms.
- CrowdStrike: there’s a Veeam App for Falcon LogScale and a Veeam Data Platform data connector for Falcon Next-Gen SIEM.
Veeam’s Security Integrations page is the place to start, and the Help Center’s Security and Threat Response section has a guide for each app.
The Incident API
And Day 3’s Incident API isn’t just for homelab tinkering either. It’s a documented VBR feature built for exactly this, a third-party security tool reporting an infection, and VBR can even run a Quick Backup automatically when an event arrives. Security vendors build on it too: Fortinet FortiSOAR and Torq are both Veeam Ready qualified with the Incident API.
Clean rooms
And the sealed room? If you’re on vSphere or Hyper-V, that’s exactly what Veeam’s SureBackup and its virtual labs are for. They boot your restore points in an isolated network and check them, and the same virtual lab powers On-Demand Sandbox when you just want a safe place to poke around.
So yes, this advent calendar is a bit of fun, and I’ll be tinkering in the lab all month. But this is enterprise-level stuff, official, supported apps on the platforms your security team already lives in, and you can switch them on today. If you’re doing this for real, grab the official app for your platform. And if you just want to see how it all works under the hood, a homelab and a couple of public APIs will get you a long way!
Wrapping Up
One malware event in VBR, one ServiceNow incident about 46 seconds later, and no duplicates however many times the poll runs. Not bad for one small script and two public APIs!
And that’s really the story of these first few days. On Day 2 we pulled metrics out of VBR, on Day 3 Wazuh told Veeam about an attack, and today that attack became a ticket that can run the whole response. Fun homelab projects, every one of them, but every one is built on things Veeam already ships, and the official integrations take it way further than my scripts ever will.
If you’ve got a lab with VBR and a free ServiceNow developer instance, give it a go. It’s a great way to get your head around both APIs. And when it’s for real, you know where the official app is ๐
See you tomorrow for Day 5, where we give Claude read-only eyes on Veeam through MCP! ๐
Stay curious, stay automated, and as always, happy backing up! ๐