项目作者: eidam

项目描述 :
A Cloudflare Worker using KV and CRON trigger for checking and sending Audit Logs to Slack. 🚀
高级语言: JavaScript
项目地址: git://github.com/eidam/cf-workers-audit-logs.git
创建时间: 2021-01-12T13:20:37Z
项目社区:https://github.com/eidam/cf-workers-audit-logs

开源协议:MIT License

下载


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. 🚀

Slack notifications

Pre-requisites

You’ll need a Cloudflare Workers account (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

Deploy to Cloudflare Workers

  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:

    1. - Name: CF_API_TOKEN (should be added automatically)
    2. - Name: CF_ACCOUNT_ID (should be added automatically)
    3. - Name: SECRET_CLOUDFLARE_API_TOKEN
    4. - Value: your-read-cloudflare-api-token
    5. - Name: SECRET_SLACK_WEBHOOK_URL
    6. - 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.