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

Dynatrace Integration Prints API Token Secret #967

Open
TimGerlach opened this issue Sep 15, 2022 · 1 comment
Open

Dynatrace Integration Prints API Token Secret #967

TimGerlach opened this issue Sep 15, 2022 · 1 comment

Comments

@TimGerlach
Copy link

Observed Issue

When using the Dynatrace integration of this buildpack it will log the complete API token into the staging logs of Cloud Foundry.

For example when running cf push with Dynatrace enabled it looks like the following:

-----> Downloading Dynatrace One Agent latest from https://<DYNATRACE_URL>/api/v1/deployment/installer/agent/unix/paas/latest?include=java&bitness=64&Api-Token=dt0c01.NDL63DNEONLLGXTYFDMZ4J47.C5YSHCIF22EWGTVZ2V7PLTZTR4XI6GSWEF4AARMFXLMKOOJUJB6QTTDXLY3J4QS2 (found in cache)

Expected Behaviour

According to the Dynatrace API token format specification the public portion of the token can be treated like a public secret key. This allows for identifying which token was used for staging the app. The secret portion of the token, however, should not be logged to avoid that it shows up in CI/CD pipelines, for example.

Therefore, a better way of logging the API token would be like so:

dt0c01.NDL63DNEONLLGXTYFDMZ4J47.<masked>
@rbamberger
Copy link
Contributor

The integration uses the download function from the Buildpack-internal base component which prints out the whole Url. We are currently evaluating the option to adapt the sanitizer to prevent the logging of the secret portion of the key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants