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

[ADAP-851] [Regression] debug outputs sensitive information #900

Closed
2 tasks done
dataders opened this issue Aug 28, 2023 · 0 comments · Fixed by #901
Closed
2 tasks done

[ADAP-851] [Regression] debug outputs sensitive information #900

dataders opened this issue Aug 28, 2023 · 0 comments · Fixed by #901
Labels
bug Something isn't working regression

Comments

@dataders
Copy link
Contributor

dataders commented Aug 28, 2023

Is this a regression in a recent version of dbt-bigquery?

  • I believe this is a regression in dbt-bigquery functionality
  • I have searched the existing issues, and I could not find an existing issue for this regression

Current Behavior

related: dbt-labs/dbt-snowflake#754

this change was introduced in #754 (core PR: dbt-labs/dbt-core#7741) and landed in version 1.6.0

dbt debug will return the following profile target attributes if the user has them in their profile:

  • token
  • client_secret
  • keyfile_json

The solution is to modify BigQueryCredentials._connection_keys() (see below)

def _connection_keys(self):
return (
"method",
"database",
"execution_project",
"schema",
"location",
"priority",
"maximum_bytes_billed",
"impersonate_service_account",
"job_retry_deadline_seconds",
"job_retries",
"job_creation_timeout_seconds",
"job_execution_timeout_seconds",
"keyfile",
"keyfile_json",
"timeout_seconds",
"token",
"refresh_token",
"client_id",
"client_secret",

._connection_keys() context

our Building a new Adapter: editing the connection manager stipulates

the Credentials’ _connection_keys method […] will return the keys that should be displayed in the output of the dbt debug command. As a general rule, it’s good to return all the arguments used in connecting to the actual database except the password (even optional arguments).

longer-term solution?

potential 2.0 work item would be to invert that current pattern and have a place to define sensitive keys that should not be printed to stdout, and by default include all others?

Expected/Previous Behavior

dbt debug will not print sensitive connection information to stdout

Steps To Reproduce

  1. use dbt-bigquery version 1.6.0.
  2. have a sensitive-field that isn't password defined.
  3. execute dbt debug
@dataders dataders added bug Something isn't working triage regression labels Aug 28, 2023
@github-actions github-actions bot changed the title [Regression] debug outputs sensitive information [ADAP-851] [Regression] debug outputs sensitive information Aug 28, 2023
@dataders dataders removed the triage label Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression
Projects
None yet
1 participant