• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • _unsorted
    • Jenkins: 2.479.2
      Plugin Version: 751.v2e44153c8fe1
      ##### NOTE ####
      I had to put the slack-uploader-plugin as the component. However, this belongs to the slack-notification plugin. It just wasn't listed as an option.

      Version: slack-plugin-751.v2e44153c8fe1

      File: src/main/java/jenkins/plugins/slack/pipeline/SlackUploadFileRunner.java

      Line: 65

      Setup Steps:

      1. Follow this to set up a Slack app 
      2. Navigate to Manage Jenkins > System Log
      3. Create a new logger 
      4. Name = Slack
      5. Logger = jenkins.plugins
      6. Log Level = ALL
      1. Create a pipeline job to trigger the logging statement
      2. Here is an example script (File path, channel, and the token id must be changed).

       

      pipeline {

          agent any

          environment

      {         SLACK_CHANNEL = 'all-testing'     }

          stages {

              stage('Upload File to Slack') {

                  steps {

                      withCredentials([string(credentialsId: 'slack-token', variable: 'SLACK_TOKEN')]) {

                          script

      {                         slackUploadFile(                             filePath: 'C:\\Users\\kyler\\Downloads\\sensitive-info\\business-data.txt.txt',                             initialComment: 'Uploading sensitive business data to Slack',                             channel: env.SLACK_CHANNEL                         )                     }

                      }

                  }

              }

          }

      }

      Navigate back to the log and look for the output. Mine is attached. This will log the full file path. 

      A fix for this could be to say that the upload was successful or to log the base file name. 

       

          [JENKINS-75103] CWE-532 In Slack Notification Plugin

            Unassigned Unassigned
            kylerkatz Kyler
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: