docs
docs copied to clipboard
Document how to automate Defender install on Windows hosts
Use PowerShell
- Validate connectivity
> curl.exe -k https://CONSOLE/api/v1/_ping
OK
- Auth
> curl.exe -H "Content-Type: application/json" `
-d '{\"username\":\"<USERNAME>\", \"password\":\"<PASSWORD>\"}' `
https://CONSOLE/api/v1/authenticate
- And then (taken from the manual Windows Host Defender string of the Compute dashboard):
> add-type "using System.Net; using System.Security.Cryptography.X509Certificates; `
public class TrustAllCertsPolicy : ICertificatePolicy{ public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem) `
{ return true; }}"; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy; `
Invoke-WebRequest -Uri "https://CONSOLE/api/v1/scripts/defender.ps1" -Method Post `
-Headers @{"authorization" = "Bearer TOKEN" } -OutFile defender.ps1; .\defender.ps1 -type serverWindows -consoleCN PC-TENANT.twistlock.com -install