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

hydra-automigrate is logging database DSN with password #55

Closed
juusujanar opened this issue Sep 25, 2019 · 1 comment · Fixed by ory/hydra#1581
Closed

hydra-automigrate is logging database DSN with password #55

juusujanar opened this issue Sep 25, 2019 · 1 comment · Fixed by ory/hydra#1581

Comments

@juusujanar
Copy link

Describe the bug

Hydra auto-migrate init container in Kubernetes logs multiple lines, which include the full DSN (which includes the database password). Info log level lines are also there, which hide database user and password with asterisks.

To Reproduce

Steps to reproduce the behavior:

  1. Enable autoMigrate in helm chart
  2. Deploy the chart.
  3. Check initContainer logs.

Expected behavior

Database password does not get logged.

Environment

  • Docker image oryd/hydra:v1.0 with image ID oryd/hydra@sha256:c60c647f6f34502ec6807a8423fb9cde0128abed3128c3d203750b68bb2ef81f (Docker Hub gives timestamp 3 days ago)
  • Tested in a Google Kubernetes Engine cluster.

Additional context

Logs from the init container pod.

➜ kubectl logs -f hydra-58fd8cb8dd-h5tnm -c hydra-automigrate
Config file not found because "Config File ".hydra" Not Found in "[/]""
migrate dsn set viper 2: postgres://hydra:<PASSWORD>@<HOST>:5432/hydra
migrate dsn set viper 3: postgres://hydra:<PASSWORD>@<HOST>:5432/hydra
time="2019-09-25T21:39:30Z" level=info msg="No tracer configured - skipping tracing setup"
time="2019-09-25T21:39:30Z" level=info msg="Establishing connection with SQL database backend" dsn="postgres://*:*@<HOST>:5432/hydra?"
time="2019-09-25T21:39:30Z" level=info msg="Successfully connected to SQL database backend" dsn="postgres://*:*@<HOST>:5432/hydra?"
Got dsn: postgres://hydra:<PASSWORD>@<HOST>:5432/hydraThe following migration is planned:

| DRIVER | MODULE | ID | # |        QUERY         |
|--------|--------|----|---|----------------------|
|--------|--------|----|---|----------------------|
Successfully applied 0 SQL migrations!
aeneasr added a commit to ory/hydra that referenced this issue Sep 26, 2019
aeneasr added a commit to ory/hydra that referenced this issue Sep 26, 2019
@aeneasr
Copy link
Member

aeneasr commented Sep 26, 2019

Thank you for the report - this will be fixed with the linked PR and released as 1.0.4.

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

Successfully merging a pull request may close this issue.

2 participants