Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Wrong data in "ID" variable from MDE-Module - STAT v2 #434

Closed
SimonRefslund opened this issue Sep 8, 2023 · 4 comments · Fixed by briandelmsft/STAT-Function#42
Closed
Labels
bug Something isn't working module/mdca Microsoft Defender for Cloud Apps (formerly MCAS) module/mde Microsoft Defender for Endpoint Module
Milestone

Comments

@SimonRefslund
Copy link

SimonRefslund commented Sep 8, 2023

Im not sure if this is an error in the custom connector, the python module, or somewhere else.

When using the "id" variable from the MDE-Module, STATv1 returned only the DeviceID from the Defender API.
However after updating to STATv2, it now returns a full HTML formatted URL,

image
This error was introduced after updating to STATv2 preview (1.5.5)
Below is a sample of the output from the STATv2 MDE module.
I would expect the "id" to only contain the deviceID.

            "Hosts": [
                {
                    "id": "<a href=\"https://security.microsoft.com/machines/DEVICEID-REDACTED?tid=TENANTID-REDACTED\" target=\"_blank\">DEVICEID-REDACTED</a>",
                    "computerDnsName": "REDACTED-app-1.REDACTED.local",
                    "riskScore": "High",
                    "exposureLevel": "High"
                }
            ],

Could this be a bug, or am i misunderstanding something completely?

@SimonRefslund SimonRefslund added the question Further information is requested label Sep 8, 2023
@briandelmsft
Copy link
Owner

@SimonRefslund thanks for bringing this up. Sounds like a bug, we'll take a look into it

@briandelmsft briandelmsft added bug Something isn't working pending-triage Submitted issue needing triage and removed question Further information is requested labels Sep 8, 2023
@briandelmsft briandelmsft added this to the STAT v2 milestone Sep 8, 2023
@briandelmsft briandelmsft removed the pending-triage Submitted issue needing triage label Sep 8, 2023
@briandelmsft briandelmsft changed the title [QUESTION] Wrong data in "ID" variable from MDE-Module [BUG] Wrong data in "ID" variable from MDE-Module - STAT v2 Sep 8, 2023
@briandelmsft
Copy link
Owner

@SimonRefslund This issue occurs only when commenting is on for the MDE module. As a temporary workaround you can disable comments for the MDE module.

The problem is the hyperlinking we do in the incident comments is done on a reference to the same object that is returned by the module, so the module return also includes the hyperlinked content

@piaudonn piaudonn added module/mdca Microsoft Defender for Cloud Apps (formerly MCAS) module/mde Microsoft Defender for Endpoint Module module/relatedalerts Related Alerts Module and removed module/relatedalerts Related Alerts Module labels Sep 8, 2023
@briandelmsft
Copy link
Owner

briandelmsft commented Sep 8, 2023

@SimonRefslund To apply the patch go to your STATv2 function -> Settings -> Configuration and edit the WEBSITE_RUN_FROM_PACKAGE application setting to a value of: https://github.com/briandelmsft/STAT-Function/releases/download/v1.5.10/stat.zip and Save the change and then restart the function app.

With this build you will still be able to make comments on the incident without it impacting the output.

@SimonRefslund
Copy link
Author

Thanks a lot guys, and thank you for a great project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module/mdca Microsoft Defender for Cloud Apps (formerly MCAS) module/mde Microsoft Defender for Endpoint Module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants