The router configuration, updatable via CDN or file, employs a “Config Validation & Signing” feature to safeguard against tampering through external validation and signing.
Validated & Signed composition
wgc
cli to the file system. In either scenario, the content originates from our platform. It is crucial to detect and mitigate tampering attacks, where an adversary might alter the configuration to reroute your traffic to an unauthorized server. To address this concern, we have developed a feature named “Config Validation & Signing” to identify and prevent such attacks.
When setting up a federated graph, you must use the --admission-webhook-url
option, pointing it to your publicly accessible admission server. Example: https://admission.example.com
(without the /validate-config
path name).
/validate-config
handler on your server each time a composition occurs. Only in case of a successful composition and proper response of your admission hook the config is made available to your router.
The payload for this operation will be structured as follows:
privateConfigUrl
validate the configuration, and then return a HMAC-SHA256 of the configuration, encoded in BASE64. The privateConfigUrl
contains a token that is short-lived (5min).
404
status code.--admission-webhook-secret
option when creating your graph. For existing graphs, the update command also allows you to set it. You need to compute the HMAC signature on your server and compare it to the signature in the X-Cosmo-Signature-256
header. Below is an example in Node.js
--graph-sign-key
parameter to the wgc router fetch
command as well. This ensures consistency in security measures, whether the configuration is obtained from the CDN or directly from a file.
Example implementation