Borehole · Project · free tier
grafana/loki
Free reading: not for reliance
bd029bc · 13,777 commits · 17,362 files
Read 2026-10-22

grafana/loki: technical due diligence, read from its repository

What Borehole read in grafana/loki's code and history at bd029bc: its licence, security advisories, releases, review practice, tests, dependencies and operations. Every finding cites the file and line it rests on. The full report also covers the team and asks the questions the code cannot answer.

DimensionRating
Architecture & Codebase — including AI provenancestrong
Engineering Process & SDLC Maturitystrong
Product & Engineering Maturityadequate
Security & Reliability Postureadequate
Observability & Operationsadequate
Fit with the Acquirernot assessable

What the repository says

  • README.md:27: The repository says it is feature-complete, in maintenance mode, or needs maintainers
  • Releases are cut from another branch than the one surveyed
  • LICENSE: Relicensed: Apache-2.0 → AGPL-3.0 (2021-04-20)
  • README.md:78: names CNCF
  • .gitmodules:1: 1 submodule(s) this survey does not read: operator/website/themes/doks

Architecture & Codebase — including AI provenance

strong
01.6

pkg/logql/syntax/ast.go is 2,919 lines, 20× this codebase's median file

adequate

The median source file here is 142 lines. 11 files exceed 1,420 lines, the largest being 2,919. Size is not a defect on its own — some problems genuinely live in one place — but these are where merge conflicts, review fatigue and single-owner knowledge concentrate, and they are the first thing that slows an inheriting engineer down.

Evidence
pkg/logql/syntax/ast.go:1 — 2,919 lines (20× median)
pkg/loki/modules.go:1 — 2,621 lines (18× median)
pkg/querier/queryrange/codec.go:1 — 2,582 lines (18× median)
pkg/storage/stores/shipper/indexshipper/tsdb/index/index.go:1 — 2,524 lines (17× median)
pkg/distributor/distributor.go:1 — 2,015 lines (14× median)

Engineering Process & SDLC Maturity

strong

No finding.

Product & Engineering Maturity

adequate
04.3

135 direct dependencies in a single manifest

adequate

go.mod declares 135 direct dependencies. Each one is a maintenance obligation, a supply-chain surface and a potential licence question that transfers with the asset. The count says nothing about whether any given dependency was a good choice; it says how many such choices a buyer inherits.

Evidence
go.mod — 135 declared
operator/go.mod — 24 declared
operator/api/loki/go.mod — 5 declared
pkg/push/go.mod — 3 declared
04.60

The repository says it is feature-complete, in maintenance mode, or needs maintainers

adequate

Its own README says so on line 27: "…n the stack, because Promtail is considered to be feature complete, and future development for logs collection will be ". New features are not planned, or the project is asking for maintainers. Ask who will carry it forward.

Evidence
README.md:27 — …n the stack, because Promtail is considered to be feature complete, and future development for logs collection will be
04.62

Releases are cut from another branch than the one surveyed

adequate

The newest release, v3.7.9, is not on the branch this survey read; the newest release on it is v2.1.0. The shipped product may differ from what this report describes. Survey the release branch too.

Evidence
tag v3.7.9

Security & Reliability Posture

adequate
05.6

8 Dockerfiles run the application as root

adequate

No USER instruction switches away from root, so the process runs with full privileges inside the container. It is a one-line fix and an ordinary expectation, which is why its absence is worth asking about: it usually says more about whether anyone has reviewed the deployment than about this container specifically.

Evidence
clients/cmd/docker-driver/Dockerfile — runs as root
clients/cmd/fluent-bit/Dockerfile — runs as root
cmd/logcli/Dockerfile — runs as root
cmd/logql-analyzer/Dockerfile — runs as root
05.27

The build runs third-party code it does not pin

adequate

3 third-party CI actions are referenced by a tag or branch rather than a commit, so they run whatever that tag points to on the day. Tags have been moved to malicious commits in real supply-chain attacks, and a piped script is whatever the server returns that minute. Pinning to a commit is the fix, and it is small.

Evidence
.github/workflows/deploy-pr-preview.yml:17 — action pinned by tag
.github/workflows/helm-ci.yml:23 — action pinned by tag
05.13

4 outbound calls can wait forever

adequate

4 HTTP calls use a client with no timeout (Python `requests` without `timeout=`, or Go's default client). When a dependency slows down, each one holds a worker until the connection gives up, and enough of them take the service down with the dependency.

Evidence
pkg/lokifrontend/frontend/v2/frontend.go:248 — outbound call without a timeout
pkg/lokifrontend/frontend/v2/frontend.go:324 — outbound call without a timeout
pkg/lokifrontend/frontend/v2/frontend.go:368 — outbound call without a timeout
05.9

2 vendored components with no licence

adequate

Third-party code is committed into this repository without any statement of the terms it arrived under. Unknown terms are harder to deal with than inconvenient ones: an awkward licence can be complied with, an absent one cannot. Each of these needs its origin established before the code changes hands.

Evidence
.github/vendor/workflows — 1 tracked files, no licence file
operator/website/node_modules — 1 tracked files, no licence file
05.60

Relicensed: Apache-2.0 → AGPL-3.0 (2021-04-20)

adequate

The root licence changed 1 time(s). The latest terms restrict what users, hosts or a buyer may do in ways the earlier ones did not. Code taken under the old terms stays under them, so both matter in diligence.

Evidence
LICENSE — Apache-2.0 from 2018-12-11
LICENSE — AGPL-3.0 from 2021-04-20
05.65

4 advisories against this project in the last 24 months, 3 high or critical

adequate

The newest was published on 2026-10-15. A project that publishes advisories is telling its users about its fixes, and the count and pace say how much security work it carries. Whether 4 of them are fixed in the code you ship could not be told from this history: its version is only known to be at least 2.1.0. Answer lives in: the release you run, set against each fixed version. The record is incomplete: NVD: 1 record names loki with nothing tying it to this repository (CVE-2005-1943).

Evidence
2026-10-15: CVE-2026-9703 (high): Grafana's data source proxy did not apply role-based access control to write requests forwarded to Loki data sources. A user holding only the Viewer role on an
2026-07-16: CVE-2026-21729 (high): Loki queries with large limits can cause large memory allocations which can impact the availability of the service, depending on its deployment strategy.
2026-06-22: CVE-2026-42129 (high): A user with Viewer permissions can use a path traversal in the Loki data source plugin to reach administrative Loki endpoints and read sensitive backend configu
2026-04-15: GHSA-497x-rrr9-68jp (moderate), fixed in 3.6.4: Grafana Loki Path Traversal - CVE-2021-36156 Bypass

Observability & Operations

adequate
06.9

No error reporter is wired in

adequate

Nothing in the service initialises an error reporter (Sentry, Rollbar, Bugsnag, Honeybadger or an APM agent). An exception in production reaches a person only if someone is reading the logs, which usually means a customer reports it first.

Evidence
no error reporter initialised
06.18

6 of 10 deployed images carry no version, or `latest`

adequate

6 images in the deployment configuration are named without a version or as `latest`. A redeploy can change the software without a commit, a rollback has nothing to roll back to, and nobody can say from the repository what is running.

06.14

Readiness and liveness probes are identical in 1 of 2 workloads

adequate

Both probes call the same endpoint. When a dependency slows down, the liveness probe fails with the readiness probe, so the platform restarts pods that only needed taking out of rotation, and a partial outage becomes a full one. Liveness should ask whether the process is alive; readiness whether it can serve.

Evidence
production/helm/loki/values.yaml — same probe endpoint twice

Fit with the Acquirer

not assessable

Not rated: structurally not assessable from a repository.

Read more, or read your own

The full report on grafana/loki: every dimension, the questions for the room, and the audit log.

Survey a repository: free on public repositories. Private code is read on your own machine by a collector whose source you can read first.