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

Default Slack Notification Template contains a misplaced comma in the JSON Payload #3170

Closed
2 tasks done
jeanbritz opened this issue Nov 4, 2023 · 1 comment · Fixed by #3172
Closed
2 tasks done
Labels
defect Something isn't working
Milestone

Comments

@jeanbritz
Copy link

Current Behavior

Currently the Slack notifications for BOM_CUNSUMED and BOM_PROCESSED and maybe other types of notifications are not delivered successfully to Slack, due to malformed JSON sent by Dependency Track.

See example JSON payload:

{
    "blocks": [{
            "type": "header",
            "text": {
                "type": "plain_text",
                "text": "BOM_CONSUMED"
            }
        }, {
            "type": "context",
            "elements": [{
                    "text": "*INFORMATIONAL*  |  *PORTFOLIO*",
                    "type": "mrkdwn"
                }
            ]
        }, {
            "type": "divider"
        }, {
            "type": "section",
            "text": {
                "text": "Bill of Materials Consumed",
                "type": "plain_text"
            },
        }, {
            "type": "section",
            "text": {
                "text": "A CycloneDX BOM was consumed and will be processed",
                "type": "plain_text"
            }
        }
    ]
}

This is due to a misplaced comma in the Pebble template file for slack notifications. See here

Steps to Reproduce

Prerequisites:

  • Setup simple HTTP server which parses JSON for any incoming requests.
  1. Setup Slack notification within Dependency Track with the destination URL set to point to the simple HTTP server.
  2. Upload SBOM to Dependency Track and wait for notification to fire.
  3. If Slack notification has been setted up correctly, you would receive an error in your HTTP server, which points to the misplaced comma

Expected Behavior

Pebble notification for Slack should be revised and checked to contain valid templated JSON. If this is done, all types of notifications should be delivered successfully to the designated Slack channel.

See screenshot below on how the end result should look like:
image

Dependency-Track Version

4.9.0

Dependency-Track Distribution

Container Image

Database Server

PostgreSQL

Database Server Version

12

Browser

Google Chrome

Checklist

@jeanbritz jeanbritz added defect Something isn't working in triage labels Nov 4, 2023
@nscuro nscuro removed the in triage label Nov 4, 2023
@nscuro nscuro added this to the 4.10 milestone Nov 4, 2023
nscuro added a commit to nscuro/dependency-track that referenced this issue Nov 4, 2023
Copy link
Contributor

github-actions bot commented Dec 5, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
defect Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants