1
votes

I'm sending a message to a Microsoft Teams channel using incoming webhooks. This works perfectly fine except for the button "Open log" which should open a file via the browser but simply doesn't.

JSON

{
    "@type": "MessageCard",
    "@context": "http://schema.org/extensions",
    "themeColor": "0076D7",
    "summary": "Error Log",
    "sections": [{
        "activityTitle": "Error in integration " + integration_name,
        "activitySubtitle": "live stage",
        "markdown": True,
        "text": message
    }],
    "potentialAction": [{
        "@type": "ActionCard",
        "name": "Open log",
        "actions": [{
            "@type": "OpenUri",
            "name": "Open log",
            "targets": [{
                "os": "default",
                "uri": "file://someserver/d$/somefolder/logs/" + logname
            }]
        }]
    }]
}

The result of this webhook call looks like this: Message via webhook

My problem is, that this button does absolutely nothing. If I use standard websites, even android/iOS URLs, it works like expected.

Any help to solve this is much appreciated! Am I doing something wrong? Is Microsoft Teams blocking file:// links?

2

2 Answers

2
votes

Yes, currently we sanitize (block) file:// links as they are a pretty significant security hole (e.g. local executables/batch files). See here for more info.

That said, your use case seems both valid and safe. How would you like it to work while still being secure?

0
votes

Is there really no way to create a webhook message containing a link pointing to an file like file://myshare/file.htm? We posting messages with a webhook and we also want to be able to post links to stuff in our companies intranet.