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

InfoLevel logging is writing token/password in plain-text #312

Closed
stigok opened this issue Mar 1, 2022 · 1 comment · Fixed by #315
Closed

InfoLevel logging is writing token/password in plain-text #312

stigok opened this issue Mar 1, 2022 · 1 comment · Fixed by #315

Comments

@stigok
Copy link

stigok commented Mar 1, 2022

Steps to reproduce:

package main

import (
	"fmt"

	influxdb2 "github.com/influxdata/influxdb-client-go/v2"
	influxdb2log "github.com/influxdata/influxdb-client-go/v2/log"
)

func main() {
	client := influxdb2.NewClientWithOptions(
		"https://influx.example.com:8086",
		"username:password",
		influxdb2.DefaultOptions().SetLogLevel(influxdb2log.InfoLevel),
	)
	_ = client
}

Expected behavior:
The token/password should be hidden or scrambled for InfoLevel. Maybe being shown in plain text for DebugLevel.

Actual behavior:
The token/password is logged in plain text at info level

2022/03/01 12:23:08 influxdb2client I! Using URL 'https://influx.example.com:8087', token 'my-username:my-super-sensitive-password'

Specifications:

  • Client Version: github.com/influxdata/influxdb-client-go/v2 v2.8.0
  • InfluxDB Version: N/A
  • Platform: Linux amd64
@stigok stigok changed the title INFO logging is writing token/password in plain-text InfoLevel logging is writing token/password in plain-text Mar 1, 2022
vlastahajek added a commit to bonitoo-io/influxdb-client-go that referenced this issue Mar 7, 2022
vlastahajek added a commit to bonitoo-io/influxdb-client-go that referenced this issue Mar 7, 2022
@stigok
Copy link
Author

stigok commented Mar 9, 2022

Thanks! Well done :)

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.

1 participant