Skip to main content

Incident API triggering and testing in VDP 23H2 V12.1


jb16wer
Forum|alt.badge.img

As promised some 12.1 content…

 

For the new Test Drive 23h2 V12.1 Hands-ON Lab we wanted to demonstrate the Incident API triggering an automatic backup without wanting to make the lab too large or complicated.

 

*First we need to enable the feature.

 

In VBR Console from the Menu Bar. > Malware Detection. > Incident API Tab. 

 

Below is an example PowerShell script for testing. 

# Run this once, or read credentials from file
# Big thanks to Egor and Ed for their help with below!
# JB 3/1/2024
# $Cred = Get-Credential


# Change ServerName, UserName and Password
$Url = "https://my-vbr-server.veeamhol.local:9419/api/oauth2/token"
$Body = @{
    "grant_type" = "password"
    "username" = "jb@veeamhol.local"
    "password" = "ILoveVeeam2024!"
}
$body = $body | ConvertTo-Json
$headers = @{
    "Content-Type" = "application/json"
    "x-api-version" = "1.1-rev1"
}

# Let's get a token to use
$request = Invoke-RestMethod -Method 'POST' -Uri $url -Credential $Cred -Body $body -Headers $headers -SkipCertificateCheck
$token = $request.access_token

# Now we can add token to headers and forget about authentication once and for all
$headers = @{
    "Content-Type" = "application/json"
    "x-api-version" = "1.1-rev1"
    "Authorization" = "bearer $token"
}

 # Let's create a new event (provide any information you know about machine - fqdn, ipv4, ipv6, uuid from vCenter PowerCLI or similar)
$Body = @{
    "detectionTimeUtc" = "2024-01-02T01:00:07.801Z"
    "machine" = @{
        "fqdn" = "windowstestserver.veeamhol.local"
        "uuid" = "564d10ea-382d-bd89-f734-8c568524bd8a"
      }
    "details" = "This event is raised from REST API for VeeamHOL"
    "severity" = "Infected"
    "engine" = "VeeamHOL AV [AntiVirus Name Here eg. Sophos or CrowdStrike]"
}
$body = $body | ConvertTo-Json
Invoke-RestMethod -Method 'POST' -Uri "https://my-vbr-server.veeamhol.local:9419/api/v1/malwareDetection/events" -Headers $headers -Body $body -SkipCertificateCheck

 

Hope you find this helpful!

 

I will soon add to this post with Anti-Virus testing and triggering….

6 comments

Chris.Childerhose
Forum|alt.badge.img+21
  • Veeam Legend, Veeam Vanguard
  • 8488 comments
  • January 3, 2024

This is very interesting and I am liking testing this feature especially with new ways.  Thanks for sharing.


coolsport00
Forum|alt.badge.img+20
  • Veeam Legend
  • 4138 comments
  • January 3, 2024

I need to get on those HoLs for v12.1. Good stuff!


jb16wer
Forum|alt.badge.img
  • Author
  • Comes here often
  • 13 comments
  • March 4, 2024

In case you missed it.. the new 23H2 V12.1 Labs are now available On-Demand and via Instructor led classes.

 

See if you can get that Threat Center High Score!

 

https://go.veeam.com/hands-on-lab-experience

 

 

 

 

https://go.veeam.com/hands-on-labs-emea-uki


coolsport00
Forum|alt.badge.img+20
  • Veeam Legend
  • 4138 comments
  • March 4, 2024

Thanks for the info @jb16wer !


Chris.Childerhose
Forum|alt.badge.img+21

Nice to see they updated them.  Thanks for sharing @jb16wer 


MarkBoothman
Forum|alt.badge.img+7
  • Veeam Legend
  • 197 comments
  • March 4, 2024

Thanks for the update @jb16wer  Definitely need to try these out.