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

Breaking update v2.16.0 #8378

Open
spanozzo opened this issue Dec 27, 2024 · 3 comments
Open

Breaking update v2.16.0 #8378

spanozzo opened this issue Dec 27, 2024 · 3 comments
Labels
>bug Something isn't working

Comments

@spanozzo
Copy link

Updating to version 2.16.0 breaks our deployment.

We currently run Elasticsearch and Kibana version 8.17.0, and seems like the new Kibana default security context is not compatible with xpack.security.audit.enabled: true.

This is what we see from Kibana logs:

[2024-12-27T13:38:55.453+00:00][WARN ][environment] Detected an uncaughtException: Error: EROFS: read-only file system, open '/usr/share/kibana/logs/audit.log'
[Error: EROFS: read-only file system, open '/usr/share/kibana/logs/audit.log'] {
errno: -30,
code: 'EROFS',
syscall: 'open',
path: '/usr/share/kibana/logs/audit.log'
}

After setting the xpack.security.audit.enabled: false the problem is gone and the update is possible, but that's definitely not what we want.

I haven't tested, but maybe set xpack.security.audit.appender.type: console would solve the problem, even if I don't know what could be the consequences.

Do you have any other idea on how to manage it?

@pebrc
Copy link
Collaborator

pebrc commented Dec 30, 2024

A possible workaround that we are currently considering to add through the operator directly in #8380 by default is an additional emptyDir volume in the logs mount path. For example like so:

apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kibana
spec:
  config:
    xpack.security.audit.enabled: true
  version: 8.16.0
  count: 1
  elasticsearchRef:
    name: elasticsearch
  podTemplate:
    spec:
      containers:
      - name: kibana
        volumeMounts:
          - name: kibana-logs
            mountPath: /usr/share/kibana/logs
      volumes:
        - name: kibana-logs
          emptyDir: {}

There is a trade-off with this approach in that emptyDir volumes are not suitable for large amounts of data as you are effectively writing into the kubelets filesystem. Depending on the logging volume your are seeing through these audit logs you might want to chose a different volume type or as you said use the console appender. In case you want to keep writing to files it would be recommened to ingest the logs e.g. via Elastic Agent and use for example the rolling file appender to rotate the logs and remove old ones.

@geusops
Copy link

geusops commented Jan 9, 2025

Hello team,

Testing the suggested manifest I suspect the podTemplate might be missing.

Here's the snippet we've tested in lab:

apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: eck-lab
spec:
  config:
    xpack.security.audit.enabled: true
  version: 8.17.0
  count: 1
  elasticsearchRef:
    name: "eck-lab"
  http:
    service:
      spec:
        type: LoadBalancer
  podTemplate:
    spec:
      containers:
      - name: kibana
        volumeMounts:
        - name: kibana-logs
          mountPath: /usr/share/kibana/logs
      volumes:
      - name: kibana-logs
        emptyDir: {}
    metadata:
      labels:
        scrape: kb

@pebrc
Copy link
Collaborator

pebrc commented Jan 9, 2025

Good catch. My mistake. Will update the example.

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

No branches or pull requests

4 participants