Skip to content

Audit a Kibana service and finish its guide (S-024-13) - #614

Merged
shipmill-romamo[bot] merged 2 commits into
mainfrom
feat/582-kibana-audit-guide
Nov 25, 2026
Merged

shipmill-romamo[bot] merged 2 commits into
mainfrom
feat/582-kibana-audit-guide

Conversation

@shipmill-romamo

Copy link
Copy Markdown
Contributor

Summary

cloudfall audit now checks a Kibana service (S-024-13), modelled on the Elasticsearch (S-012) and MariaDB (S-019) node checks, with the same <kind>.<check>[<service>] naming:

  • kibana.version: the installed kibana package against the Elasticsearch service's declared version (the declaration, not a node's installed version, is the reference)
  • kibana.unit: kibana.service enabled and running
  • kibana.configuration: /etc/kibana/kibana.yml against the settings the role renders (a setting the role does not write is named, never its value) and the heap in node.options
  • kibana.status: the overall level of GET /api/status is available
  • kibana.roles: cloudfall-kibana-view and cloudfall-kibana-edit as the role writes them
  • kibana.users: each declared user of the cluster holds the Kibana role of its access and no other; an undeclared user holding one is listed as unmanaged, not drift
  • kibana.keystore: the three encryption keys, the S-011 secret requirements, by setting name

A listener off loopback (server.host changed by hand and Kibana restarted) is drift of the existing services.bind check; before the restart it is already drift of kibana.configuration. Inspect gains tasks/kibana.yml, which reads the evidence as the cloudfall account in no_log tasks and keeps only names and privileges; the observation schema gets an optional kibana object (additive). A project without Kibana audits as before.

Also: docs/kibana-service-guide.md completed (licence and the paid features, SSH forward, version change, audit), the ROADMAP.md and ARCHITECTURE.md lines, and spec 024 set to built with its Verification section. This is the spec's last build issue.

Plan

  • Serves: G-1, G-3
  • Files: sdk/src/cloudfall/audit.py, config/schemas/v1/observed-server.schema.json, engine/ansible/playbooks/inspect.yml, engine/ansible/roles/cloudfall_inspect/{defaults/main.yml,meta/argument_specs.yml,tasks/main.yml,tasks/kibana.yml}, sdk/tests/test_s024_13_kibana_audit.py, engine/tests/test_s024_13_kibana_inspect.py, docs/kibana-service-guide.md, docs/specs/024-kibana-service.md, ROADMAP.md, ARCHITECTURE.md, changelog.d/582-kibana-audit.md
  • Order: the spec's Audit section: inspect collects Kibana evidence, audit compares it with the declaration and the rendered kibana.yml, then the guide, ROADMAP and ARCHITECTURE lines, and the spec's Verification
  • Proof: S-024-13 (test_s024_13_* in sdk/tests/test_s024_13_kibana_audit.py and engine/tests/test_s024_13_kibana_inspect.py), including a clean audit of a Kibana converged as declared; specs.py coverage --spec 024 lists a test for every criterion
  • Tests changed: none

Test plan

  • uv run ruff check ., uv run mypy, uv run ansible-lint engine/ansible (with ANSIBLE_CONFIG=engine/ansible/ansible.cfg, as CI runs it), uv run cloudfall config validate --project config/examples: pass
  • uv run pytest on the new tests and every SDK and engine test file touching audit, observation, Elasticsearch and Kibana (31 files, 529 passed), plus test_compatibility_surface.py and test_s017_record_kinds.py: pass
  • specs.py check and specs.py coverage --spec 024: pass, every criterion has a test
  • The full suite is left to CI
  • Not verified: a live inspect and audit of a Kibana host; the evidence is proven through Ansible's templating against recorded answers, as the spec's Verification says

Fixes #582

🤖 Generated with Claude Code

shipmill-romamo Bot and others added 2 commits November 25, 2026 16:38
The Kibana kind had no audit: a Kibana moved off its cluster's version, stopped, edited by hand or holding the wrong role went unseen. Audit now checks the installed version against the Elasticsearch service's declared version, the unit, kibana.yml and the heap, Kibana's own status, the two Kibana roles, the Kibana roles of each declared user, and the three keys in the keystore; a listener off loopback stays the services.bind check. Inspect reads the evidence on the Kibana server as the cloudfall account in no_log tasks and keeps names and privileges only, so no token, key, password or hash reaches an observation or a finding. A project without Kibana reads and audits as before.

The guide now covers everything spec 024's Documentation section lists, ROADMAP.md and ARCHITECTURE.md name Kibana, and the spec is built with a per-criterion Verification section.

Fixes #582

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mypy reads the dict literal as dict[str, Sequence[object]], which _template does not take.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@shipmill-romamo shipmill-romamo Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review: MERGE at 8abf6f4. Nothing blocking; no fixes committed.

  • Rebase: already on origin/main, no conflicts; changelog_guard.py check exit 0
  • Checks: ruff, mypy, ansible-lint, config validate --project config/examples pass; 412 tests pass (the two new S-024-13 files, S-012 and S-024 tests, audit, observe, service evidence, S-017 compatibility, MariaDB audit, audit requirements); specs.py coverage --spec 024 lists a test for every criterion, specs.py check clean
  • S-024-13: each of the four cases (version off the Elasticsearch service's declared version, unit stopped, server.host hand-changed off loopback, support given cloudfall-kibana-edit) produces drift; a Kibana converged as declared audits clean against the role's real kibana.yml template
  • Q-1: an observation without kibana evidence reads unknown (consistent with H-4/H-5, #436); a project without Kibana gets no kibana. check
  • Read-only: the inspect tasks only stat, slurp, run kibana-keystore list with changed_when: false, and GET
  • Q-4: every task touching the password is no_log; user metadata (the password digest) is stripped before the record
  • Schema: the kibana object is optional and additive (Q-3)
  • Spec: status: built is honest; its Verification says no criterion has had a live run yet

Nits, not blocking:

  • F-1 sdk/src/cloudfall/audit.py:1728: a 401 or 403 from Kibana reads drift ("did not answer"), not unknown (Q-1)
  • F-2 sdk/src/cloudfall/audit.py:1900: any failure of kibana-keystore list, not only a missing keystore, reads drift (Q-1)
  • F-3 config/schemas/v1/observed-server.schema.json:1060: more than 4096 users would fail the observation's validation
  • F-4 sdk/src/cloudfall/audit.py:380, cloudfall_inspect/tasks/main.yml:745: #597 adds lines beside these; a small text conflict for whichever merges second (H-9)

History: H-1 to H-3, H-6, H-7 unrelated; H-4, H-5, H-8 consistent; H-9 text collision only (F-4).

@shipmill-romamo
shipmill-romamo Bot merged commit f98b977 into main Nov 25, 2026
3 checks passed
@shipmill-romamo
shipmill-romamo Bot deleted the feat/582-kibana-audit-guide branch November 25, 2026 15:38
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.

Kibana service: audit and the guide (S-024-13)

0 participants