https://github.com/eidam/cf-workers-audit-logs
A Cloudflare Worker using KV and CRON trigger for checking and sending Audit Logs to Slack. 🚀
https://github.com/eidam/cf-workers-audit-logs
audit cloudflare logs slack workers
Last synced: about 1 year ago
JSON representation
A Cloudflare Worker using KV and CRON trigger for checking and sending Audit Logs to Slack. 🚀
- Host: GitHub
- URL: https://github.com/eidam/cf-workers-audit-logs
- Owner: eidam
- License: mit
- Created: 2021-01-12T13:20:37.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-12T17:46:27.000Z (over 5 years ago)
- Last Synced: 2025-05-10T05:52:33.838Z (about 1 year ago)
- Topics: audit, cloudflare, logs, slack, workers
- Language: JavaScript
- Homepage:
- Size: 341 KB
- Stars: 17
- Watchers: 2
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cloudflare Worker - Audit Logs
A Cloudflare Worker using KV and CRON trigger for checking and sending Audit Logs to Slack. Using **Cloudflare Workers**, **CRON Triggers,** and **KV storage**. 🚀

## Pre-requisites
You'll need a [Cloudflare Workers account](https://dash.cloudflare.com/sign-up/workers) _(Free Tier is enough)_
Prepare the following secrets
- Cloudflare API token with `Account Logs:Read` and `Account Settings:Read` permissions _(yes, both needed)_
- Slack incoming webhook
## Deploy with Cloudflare Deploy Button
[](https://deploy.workers.cloudflare.com/?url=https://github.com/eidam/cf-workers-audit-logs)
1. Click the button and follow the instructions, you should end up with a clone of this repository
2. Navigate to your new **GitHub repository > Settings > Secrets** and add the following secrets:
```yaml
- Name: CF_API_TOKEN (should be added automatically)
- Name: CF_ACCOUNT_ID (should be added automatically)
- Name: SECRET_CLOUDFLARE_API_TOKEN
- Value: your-read-cloudflare-api-token
- Name: SECRET_SLACK_WEBHOOK_URL
- Value: your-slack-webhook-url
```
3. Navigate to the **Actions** settings in your repository and enable them
4. Trigger last GitHub action (or rerun failed) to deploy Workers 🎉
## Known issues
- **Max 10 message blocks in Slack message**.
It just might take a while to catch up with all the audit logs from a current day once you deploy the Worker.