Quick start
Run SESAR Webhook on your workstation, check it, then connect it to SESAR.
Prerequisites
- Windows, with the .NET 9 SDK and Git.
- The webhook key and initialization vector (IV), as defined in the SESAR configuration. On your workstation, use test keys, never production ones.
1. Get and build
git clone https://github.com/SecureExchanges/SESARWebhookCore.git
cd SESARWebhookCore
dotnet build SESARWebHookCore.sln -c Release
dotnet test SESARWebHook.Tests.NetCore\SESARWebHook.Tests.NetCore.csproj
2. Prepare the secrets file
Create a folder outside the project, for example
C:\SESARWebHook\Config\.Copy
SESARWebHook.API.NetCore\connectors.secrets.template.jsonto it asconnectors.secrets.json.Fill in
WebHookEncryptionKeyandWebHookEncryptionIVwith the webhook key and IV, copied exactly from the SESAR configuration.Tell the application where to find this file:
$env:ConnectorsSecretsPath = "C:\SESARWebHook\Config\connectors.secrets.json"
Do not leave this file in the project folder: the project's .json files are copied to the build and publish output, and your plain-text file would end up there.
Warning
At startup, the application encrypts this file with DPAPI, for the Windows account that runs it. Only that account, on that machine, will be able to read it. See Secrets and DPAPI.
3. Start the application
dotnet run --project SESARWebHook.API.NetCore
The application listens on https://localhost:61094, according to the project's launch profile. If your browser or PowerShell rejects the certificate, trust the ASP.NET Core development certificate:
dotnet dev-certs https --trust
4. Check
Invoke-RestMethod https://localhost:61094/api/health/status | ConvertTo-Json -Depth 5
Configuration.ProcessorInitialized must be true. Otherwise, Configuration.InitializationError gives the reason, often a missing key or IV, or an unreadable secrets file.
Do not use /api/health for this check: it always answers Healthy, even when the webhook cannot process anything.
5. Try without SESAR (optional)
The debug routes process a plain-text manifest, without a HashKey. Turn them on only on your workstation, for the time of the test:
$env:EnableDebugEndpoints = "true"
dotnet run --project SESARWebHook.API.NetCore
In another PowerShell window:
$sample = Invoke-RestMethod https://localhost:61094/api/debug/sample-manifest
Invoke-RestMethod -Method Post -Uri https://localhost:61094/api/debug/connector/filesystem -ContentType "application/json" -Body ($sample.SampleManifest | ConvertTo-Json -Depth 10)
The File system connector then writes the manifest, empty, to C:\SESARWebHook\Output\. Stop the application and remove the EnableDebugEndpoints variable after the test.
6. Connect SESAR
- Deploy the application on a server that SESAR can reach, over HTTPS: see Deploy on Windows.
- In the SESAR configuration, set the webhook address, for example
https://webhook.example.com/api/webhook/handler/my-handler: see Configure SESAR. - Before production, apply Secure the deployment.
Next
- Create a handler, to send the data to your system
- Configuration reference