defguard
  • Welcome
  • Getting help
  • About
    • About defguard
    • Features overview
  • Getting started
    • One-line install script
  • Admin Features
    • Overview
    • Zero-Trust VPN with 2FA/MFA
      • Create/manage VPN Location
      • Network overview
      • Executing custom gateway commands
      • Multi-Factor Authentication (MFA/2FA)
        • MFA Architecture
      • Remote desktop client configuration
      • DNS and domains
    • Remote user enrollment
      • User onboarding after enrollment
    • SSO (OpenID Connect)
      • Portainer
      • Grafana setup
      • Proxmox
      • Matrix / Synapse
      • Django
      • MinIO
      • Vault
    • SMTP for email notifications
    • YubiKey Provisioning
    • Webhooks
    • Forward auth
    • SSH Authentication
    • Network devices
    • Activity & Audit logs
    • Gateway notifications
    • New version notifications
  • User features
    • Overwiew
    • Desktop Client
    • CLI Client
    • Configuring VPN
      • Defguard Desktop Client
        • Update instance
      • Other WireGuard® Clients
        • Configuring a device for new VPN Location manually
    • Password change / Reset
    • Enrollment & Onboarding
      • With internal Defguard SSO
      • With external SSO (Google/Microsoft/Custom)
    • Setting up 2FA/MFA
  • Enterprise Features
    • Overview
    • Enteprise features
      • Automatic (real time) desktop client configuration & sync
      • External OpenID providers
        • Google
        • Microsoft
        • Zitadel
        • Keycloak
        • JumpCloud
        • Okta
        • Custom
      • External OIDC secure enrollment
      • VPN & Client behavior customization
      • Access Control List
        • ACL Aliases
        • Implementation Details
      • Audit Log Streaming to SIEM systems
        • Supported SIEM systems integrations
          • Vector integration guide
          • Logstash integration guide
      • LDAP and Active Directory integration
        • Configuration
        • Settings table
        • Two-way LDAP and Active Directory synchronization
      • REST API
  • Deployment strategies
    • Prerequisites
    • Standalone package based installation
    • Docker images and tags
    • Docker Compose
    • Kubernetes
    • Terraform
    • High Availability and Failover
    • Upgrading
    • Pre-production and development releases
    • Gateway
      • Running gateway on MikroTik routers
  • Securing gRPC communication
  • OpenID RSA key
  • Health check
  • Configuration
  • Tutorials
    • Step by step setting up a VPN server
      • Adding additional VPN locations
  • In depth
    • Architecture
      • How do VPN statistics work
      • Security concepts
    • Roadmap
    • Release cycle
  • For Developers
    • Contributing
    • Environment setup
      • Translations (core/web)
        • Switching language
        • Adding translations
      • Translations (client)
        • Adding translations
  • Resources
    • Troubleshooting Guide
      • Sending support information
      • Client Windows installer exit codes
      • Client "All traffic" connection issues
      • WebAuthn security keys
Powered by GitBook
On this page
  • Basic idea
  • Setup
  • Sample requests
  • New user created
  • User modified
  • User Deleted
  • User YubiKey Provision

Was this helpful?

Edit on GitHub
  1. Admin Features

Webhooks

PreviousYubiKey ProvisioningNextForward auth

Last updated 8 days ago

Was this helpful?

Basic idea

Basic idea of webhooks is to send user data to external systems in order to automate certain tasks like for example sending welcome email to newly created user.

Setup

On the left side of Defguard navigation you'll find webhooks page

On above form you'll see inputs like URL description token and triggers

  • URL is an URL on which data will be sent after certain triggers

  • Description short description of your webhook to remember it's use case

  • Secret token is a token sent with request in authorization header Note if receiver didn't implement any token check it'll do nothing

  • Triggers are events which will trigger the webhook

Sample requests

Below is list of all triggering actions with their request header and sample JSON body which will be sent on URL given at webhook creation.

Note all requests are using GET method and sends data in body of request in JSON format.

New user created

Triggered after creating user

Header with name of trigger

X-Defguard-Event: user_created

Body example:

{
"email":"janedoe@email.pl",
"first_name":"jane",
"last_name":"doe",
"groups":[],
"is_admin":false,
"pgp_cert_id":"",
"pgp_key":"",
"phone":"123456789",
"ssh_key":"",
"username":"jdoe"
}

User modified

Triggered after modifying user

Webhook will be triggered on new user deletion sample request:

Header

X-Defguard-Event: user_modified

Request body example:

{
"email":"janedoe@email.pl",
"first_name":"jane",
"last_name":"doe",
"groups":["admin"],
"is_admin":false,
"pgp_cert_id":"",
"pgp_key":"",
"phone":"123456789",
"ssh_key":"",
"username":"jdoe"
}

User Deleted

Triggered on deleting user

Header

X-Defguard-Event: user_deleted

Request body example:

{ username: "jdoe"}

User YubiKey Provision

Triggered after successfully provisioning YubiKey

Header

X-Defguard-Event: user_keys

request body example:

{
"email":"janedoe@email.pl",
"first_name":"jane",
"last_name":"doe",
"groups":["admin"],
"is_admin":false,
"pgp_cert_id":"",
"pgp_key":"",
"phone":"123456789",
"ssh_key":"",
"username":"jdoe"
}

Note

New webhook form