Storing Sensitive Data
Do NOT store any sensitive data in the files that others can access
What can be sensitive data:
password
token
secret
e-mail address
xray client id
xray client secret
API key
personal uuid
Sensitive data should come from a vault/password manager. Here are some examples.
Jenkins
Read this 1st: https://www.jenkins.io/doc/book/using/using-credentials/ , https://www.jenkins.io/doc/pipeline/steps/credentials-binding/
Create the credentials in Jenkins
Add your credential to the Jenkinsfile using the IDE of your choice
string(credentialsId: 'credentialIdSetinJenkinsCredentials', variable: 'variableNameYouWantToUse'),
Use the environment variable in the maven command
Please read: https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#string-interpolationsh 'mvn ... -DenvironmentVariableUsedInTheTest=${variableNameYouWantToUse} ...'
GitHub Actions
Read this 1st: https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions
Create the secrets in GitHub
Add your secrets as environment variables in your workflow file using the IDE of your choice
Workflow files must be under the .github/workflows folderenv: user: ${{secrets.Q_USER}} pass: ${{secrets.Q_PASSWORD}}
Use the environment variable in the maven command
- name: xyz shell: cmd run: | ... -DenvironmentVariableUsedInTheTest=%user% -DserverPassword="%pass%" ...
External Systems
KeePass
Read this 1st: https://keepass.info/
TESTIFI also has KeePass integration to read credentials from a KeePass file.