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

Logstash secureSettings does not properly populate secrets with spaces #8270

Open
h3xcat opened this issue Nov 28, 2024 · 2 comments
Open

Logstash secureSettings does not properly populate secrets with spaces #8270

h3xcat opened this issue Nov 28, 2024 · 2 comments
Assignees
Labels
>bug Something isn't working :logstash

Comments

@h3xcat
Copy link

h3xcat commented Nov 28, 2024

Secrets containing spaces are being cut-off at first space when they're stored inside Logstash keystore.
I have encountered the issue as I was trying to populate sasl_jaas_config for kafka output, which is typically considered sensitive.

@botelastic botelastic bot added the triage label Nov 28, 2024
@barkbay barkbay self-assigned this Nov 28, 2024
@barkbay barkbay added the >bug Something isn't working label Nov 28, 2024
@botelastic botelastic bot removed the triage label Nov 28, 2024
@barkbay
Copy link
Contributor

barkbay commented Nov 28, 2024

Can be reproduced with:

apiVersion: v1
kind: Secret
metadata:
  name: logstash-secure-settings
  namespace: logstash-sample
stringData:
  V1: "Hello, world!"
---
apiVersion: logstash.k8s.elastic.co/v1alpha1
kind: Logstash
metadata:
  name: logstash-sample
  namespace: logstash-sample
spec:
  version: 8.16.1
  count: 1
  pipelines:
    - pipeline.id: main
      config.string: |-
        input { exec { command => 'uptime' interval => 10 } }
        output {
          stdout {}
        }
        filter {
          if ("${V1:}" != "") {   
            mutate { add_tag => ["${V1:}"] }
          }
        }
  secureSettings:
    - secretName: logstash-secure-settings

In the container logs we can see that the value is only Hello,:

{
       "message" => " 09:26:12 up 1 day, 23:55,  0 users,  load average: 1.34, 0.56, 0.44\n",
          "tags" => [
        [0] "Hello,"
    ],
...

@barkbay
Copy link
Contributor

barkbay commented Nov 28, 2024

This is actually the same issue as the one described in elastic/logstash#11436

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working :logstash
Projects
None yet
Development

No branches or pull requests

2 participants