Skip to content

Change config secret_token type to Password. #23

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

Merged

Conversation

mashhurs
Copy link
Contributor

@mashhurs mashhurs commented Dec 5, 2022

Description

This PR ensures to protect the :secret_token from leaks in the debug logs.

Test

# config
input {
  github {
      codec => "json"
      secret_token  => "super-secret"
      port => 5010
      drop_invalid => true
  }
}
output {
    stdout {
        codec => rubydebug
    }
}
# Log before change
[2022-12-05T13:24:04,008][DEBUG][logstash.inputs.github   ] config LogStash::Inputs::GitHub/@port = 5010
      [2022-12-05T13:24:04,008][DEBUG][logstash.inputs.github   ] config LogStash::Inputs::GitHub/@secret_token = "super-secret"

# Log after change
[2022-12-05T13:30:36,288][DEBUG][logstash.inputs.github   ] config LogStash::Inputs::GitHub/@drop_invalid = true
      [2022-12-05T13:30:36,288][DEBUG][logstash.inputs.github   ] config LogStash::Inputs::GitHub/@id = "c27c053a232808ba56d05a942571ee0710c5f162fb7b318346659d7f46f36cbc"
      [2022-12-05T13:30:36,288][DEBUG][logstash.inputs.github   ] config LogStash::Inputs::GitHub/@port = 5010
      [2022-12-05T13:30:36,288][DEBUG][logstash.inputs.github   ] config LogStash::Inputs::GitHub/@secret_token = <password>

@mashhurs mashhurs added the bug label Dec 5, 2022
@mashhurs mashhurs self-assigned this Dec 5, 2022
mashhurs added 2 commits May 23, 2023 14:42
	This change ensures to protect the secret_token from leaks in debug logs.

	Fixes: logstash-plugins#22
	Pull-request: logstash-plugins#23
@mashhurs mashhurs force-pushed the change-secret-token-type-to-password branch from fb02a2e to 28a64b9 Compare May 23, 2023 21:43
@mashhurs
Copy link
Contributor Author

CI failure is because of docker.elastic.co/logstash/logstash:8.8.1-SNAPSHOT miss.

@mashhurs mashhurs requested a review from roaksoax May 30, 2023 00:18
Copy link

@roaksoax roaksoax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@mashhurs mashhurs merged commit 5219573 into logstash-plugins:main May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change secret_token config to Password type.
2 participants