Using ClickHouse as a webhook endpoint with HMAC verification
Blog post from ClickHouse
ClickHouse 25.12 introduces an HMAC function for verifying webhook requests, enhancing its utility as a webhook endpoint by filtering out requests from unauthorized sources. The process involves setting up a series of tables and materialized views to authenticate, transform, and store verified data, utilizing ClickHouse's SQL capabilities. A staging table initially receives data, which is validated and transformed by a materialized view before being stored in a final table. To demonstrate, a local example is created using a restricted user for security, and the setup is then expanded to a real-world application with GitHub webhooks in ClickHouse Cloud. This involves configuring tables to handle events and signatures, ensuring only data with valid HMAC signatures is logged. The guide also highlights the importance of secure user permission settings and the flexibility of ClickHouse's HTTP insert capabilities.