Giter Club home page Giter Club logo

Comments (4)

quinn-thinkst avatar quinn-thinkst commented on August 22, 2024

Hi @chrisreeves-

Thanks for raising this. This is an unfortunate side effect of Discord taking an unusual webhook format, and as a result not working with the standard output (though it's certainly interesting that the "/slack" inclusion actually makes it behave, I wouldn't have expected that).

We've had internal chatter in the past about adapting the webhook functionality to support Discord, but until now that hasn't come to anything. I'll raise this again and we'll get this working ASAP - so thanks again for the nudge!

from canarytokens.

github-actions avatar github-actions commented on August 22, 2024

This issue is stale because it has been open for 14 days with no activity.

from canarytokens.

chrisreeves- avatar chrisreeves- commented on August 22, 2024

Hey @quinn-thinkst thanks for the reply.

I found a way to do it by transforming the JSON payload being sent by using webhookrelay.com
They use lua for the transform, I'll leave the snippet I used to get it going (for others interested in this solution)

local json = require("json")

local body, err = json.decode(r.RequestBody)
if err then error(err) end

local token_type = body["token_type"]
local src_ip = body["src_ip"]
local time = body["time"]
local memo = body["memo"]

local message = "Canary triggered @ " .. body["time"] .. " src_ip: " .. body["src_ip"] .. " Source: " .. body["memo"] .. " Manage URL: " .. body["manage_url"]

-- Preparing Discord payload
local discord = {
    username= "OpenCanary",
    content= message
    }

local result, err = json.encode(discord)

-- Set modified request body
r:SetRequestBody(result)

Screenshot 2023-10-31 at 2 39 02 pm

from canarytokens.

quinn-thinkst avatar quinn-thinkst commented on August 22, 2024

Hey @chrisreeves-

I'm sorry this has taken a little while to get sorted (that's on me). Official support for discord webhooks is up and running now, so you can setup your tokens directly hooked into discord rather than needing an intermediary (but nice find on the relay - that's a nifty hack that should be usable for any case of an unsupported webhook).

Thanks again for raising this issue, and please do shout if you bump into any issues with the feature!

from canarytokens.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.