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

fix: redact secretKey from printed on screen #4526

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

allanrogerr
Copy link
Contributor

@allanrogerr allanrogerr commented Mar 28, 2023

Description

secretKey should not appear in logs.

Motivation and Context

Users may copy/paste logs inadvertently sharing privileges access information.

How to test this PR?

secretKey should not appear when running mc commands with debug e.g. mc alias set ALIAS URL ACCESSKEY SECRETKEY --debug

Example:

➜  mc git:(redact-alias-set) ✗ sudo ./mc alias import myminio-invalid invalid.json --debug --insecure
mc: <ERROR> Invalid secret key `hideme`. Invalid arguments provided, please refer `mc <command> -h` for relevant documentation.
 (0) alias-import.go:98 cmd.checkCredentialsSyntax(..) Tags: [hideme]

versus

mc: <ERROR> Invalid secret key. Invalid arguments provided, please refer `mc <command> -h` for relevant documentation.
 (0) alias-import.go:98 cmd.checkCredentialsSyntax(..)

Example:

➜  mc git:(redact-alias-set) ✗ sudo ./mc alias set myminio http://127.0.0.1:9000 minioadmin hideme --debug --insecure
mc: <ERROR> Unable to initialize new alias from the provided credentials. The request signature we calculated does not match the signature you provided. Check your key and signing method.
 (5) alias-set.go:343 cmd.mainAliasSet(..) Tags: [myminio, http://127.0.0.1:9000, minioadmin, hideme]
 (4) alias-set.go:259 cmd.BuildS3Config(..) Tags: [http://127.0.0.1:9000, minioadmin, , auto]
 (3) alias-set.go:229 cmd.probeS3Signature(..) Tags: [s3v4, s3v2]
 (2) alias-set.go:221 cmd.probeS3Signature.func1(..) Tags: [s3v2]
 (1) client-s3.go:1586 cmd.(*S3Client).Stat(..) Tags: [probe-bucket-sign-3vvwmuuhba0a]
 (0) client-s3.go:2218 cmd.(*S3Client).bucketStat(..)

versus

mc: <ERROR> Unable to initialize new alias from the provided credentials. The request signature we calculated does not match the signature you provided. Check your key and signing method.
 (5) alias-set.go:343 cmd.mainAliasSet(..) Tags: [myminio, http://127.0.0.1:9000, minioadmin]
 (4) alias-set.go:259 cmd.BuildS3Config(..) Tags: [http://127.0.0.1:9000, minioadmin, , auto]
 (3) alias-set.go:229 cmd.probeS3Signature(..) Tags: [s3v4, s3v2]
 (2) alias-set.go:221 cmd.probeS3Signature.func1(..) Tags: [s3v2]
 (1) client-s3.go:1586 cmd.(*S3Client).Stat(..) Tags: [probe-bucket-sign-gpcj9ot2e4jb]
 (0) client-s3.go:2218 cmd.(*S3Client).bucketStat(..)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

@harshavardhana harshavardhana changed the title Redact secretKey fix: redact secretKey from printed on screen Mar 28, 2023
@harshavardhana harshavardhana merged commit ada9929 into minio:master Mar 28, 2023
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 this pull request may close these issues.

3 participants