logstash-plugins / logstash-input-rackspace

Apache License 2.0
2 stars 6 forks source link

Change `api_key` configs type to `Password`. #9

Closed mashhurs closed 1 year ago

mashhurs commented 1 year ago

Description

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

Test

# config
input {
  rackspace {
      api_key => "my-super-secret-api-key"
      username  => "mashhur"
  }
}
output {
    stdout {
        codec => rubydebug
    }
}
# Log before change
  [2022-12-05T15:45:19,516][DEBUG][logstash.inputs.rackspace] config LogStash::Inputs::Rackspace/@api_key = "my-super-secret-api-key"
  [2022-12-05T15:45:19,516][DEBUG][logstash.inputs.rackspace] config LogStash::Inputs::Rackspace/@username = "mashhur"

# Log after change
 [2022-12-05T16:10:19,203][DEBUG][logstash.inputs.rackspace] config LogStash::Inputs::Rackspace/@api_key = <password>
  [2022-12-05T16:10:19,203][DEBUG][logstash.inputs.rackspace] config LogStash::Inputs::Rackspace/@username = "mashhur"
mashhurs commented 1 year ago

CI fail is due to docker.elastic.co/logstash/logstash:8.8.1-SNAPSHOT miss.