Implement webhook
A call to a webhook server will return a list of Tweaks to apply.
The webhook server could be this one https://github.com/adnanh/webhook (a Debian package exist).
The webhook call could be very simple : just the name of the HOST or more comprehensive
- Hostname
${Env:COMPUTERNAME}
- Unique SWMB HostID created on installation (in order to secure transaction ?)
- IP
- Domain name (with
Get-DnsClient
? See https://shellgeek.com/get-domain-name-using-powershell-and-cmd/) - Current User
${Env:UserName}
- Current group (admin or not admin)
- Kind of call (logon, boot, logoff, shutdown, HKLM or HKCU...)
A special tweak could be use, SysWebhook
for example, but how to pass some parameter (via a parameter module ?), or the use of $PRESET
with an http://
URL?
# Current User
$PRESET https://www.example.org/swmb/webhook/logon
# Boot
$PRESET https://www.example.org/swmb/webhook/boot
SWMB will send the host and user parameters to the webhook server in JSON format, for example. The webhook server will use the URL form and the JSON file to decide what to send in return. Over time, the JSON file could become increasingly rich in data, enabling us to refine the tweaks we propose. We could imagine a similar process for sending back data (logs, alerts, etc.).
However, it's important to bear in mind that the network isn't always available, the machine must always be in working order, and the process must be as fast as possible.