markewaite I believe that if some string is used in credentials, that string is masked, whenever found.
My pipeline:
pipeline {
agent any
environment {
SERVER = 'http:
}
stages {
stage('Do the job') {
steps {
script {
withCredentials([usernamePassword(credentialsId: 'SOME_CREDENTIALS_ID',
passwordVariable: 'ACCESS_KEY', usernameVariable: 'SECRET_KEY')]) {
def my_secret_params = '$ACCESS_KEY $SECRET_KEY' def my_script = """#!/bin/bash -e
echo mc config host add minio ${SERVER} ${my_secret_params}
"""
sh label: 'Run', script: my_script
}
}
}
}
}
}
[Pipeline] sh (Run)
Warning: A secret was passed to "sh" using Groovy String interpolation, which is insecure.
Affected argument(s) used the following variable(s): [SECRET_KEY, ACCESS_KEY]
See https:mc config host add minio http:
The string "mycompany" was replaced as a part of URL with "****".
If I change the url to have "my-company" in it, the pipeline runs with no warnings.
[Pipeline] withCredentials
Masking supported pattern matches of $SECRET_KEY or $ACCESS_KEY
[Pipeline] {
[Pipeline] sh (Run)
mc config host add minio http:
I believe that a plugin is required for that type of masking. Did your change to Jenkins 2.235.5 also upgrade the mask passwords plugin or other plugins?