Skip to content

Add a security policy, and stop Dependabot's weekly kubernetes failure - #28

Merged
junior merged 3 commits into
p10node:mainfrom
junior:security-policy
Nov 12, 2026
Merged

junior merged 3 commits into
p10node:mainfrom
junior:security-policy

Conversation

@junior

@junior junior commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Two follow-ups to #16, one commit each.

SECURITY.md is the policy #16 offered to go with private vulnerability reporting, which is on now. GitHub shows it above the report form (https://github.com/p10node/k10s/security/advisories/new). It says that only the newest release gets security fixes, how to report privately and what to put in a report, and what happens next. Its scope is what the docs already promise, so a report has something to be measured against: read-only mode is a guard against k10s, not against you; the self-updater installs only an archive that matches the release's checksums.txt, and does not check attestations; k10s runs a plugin's command without a shell of its own and gives a sh -c script the cluster's values as environment variables, while what the plugin's own script or program does with those values is up to the plugin; a published advisory against Go or a module can be a public issue. Its known limits add one thing the docs do not say: besides the no-sha256-tool case, install.sh also installs unverified, with a warning, when the release's checksums.txt cannot be fetched or does not list the archive. It ends with gh attestation verify, as docs/install.md has it. docs/maintaining.md gets a line under Releases (tags are on main with no release branches, so a fix ships in the next release) and a pointer below the repository settings. README.md is left alone because the docs/readme-simplify branch rewrites it; a one-line link in its Contributing section would fit once that lands.

pierreneter, GitHub tells only admins and security managers about a private report, so these are commitments you would be keeping. Please change any that do not fit:

  • Only the newest release gets security fixes, as a new release rather than a patch to an older one (the new line in docs/maintaining.md says the same).
  • Best effort, with no fixed response times.
  • A maintainer acknowledges each report and asks in the advisory for anything needed to reproduce it.
  • The fix ships in a new release and the advisory is published with it, crediting the reporter unless they would rather not be (GitHub adds the reporter as a credited user by default).
  • A report that is not a vulnerability gets the reason, and the reporter is then free to open a public issue.
  • There is no fallback for someone who cannot use the form. If you want one, an email address would go under "Reporting a vulnerability".

.github/dependabot.yml: the kubernetes group fails on every refresh (runs 41142937813 on 2026-10-30 and 42016449136 on 2026-11-05). Dependabot updates a group one module at a time and starts with k8s.io/api, which does not require client-go. k8s.io/api v0.37.2 dropped scheduling/v1alpha2, which client-go v0.36.4's informers import, so with client-go left at v0.36.4 that first step fails: cannot find module providing package k8s.io/api/scheduling/v1alpha2. The next module, apiextensions-apiserver, moves client-go and k8s.io/api to v0.37.2 together, which is why #20 still got its update, but the job reports the error and fails. At main, in golang:1.27, go get k8s.io/[email protected] && go mod tidy fails the same way, and go get k8s.io/[email protected] && go mod tidy passes with k8s.io/api, apimachinery and client-go at v0.37.2.

The ignore lists all three update types instead of naming k8s.io/api alone. GitHub's docs say an ignore applies to security updates too, so a name-only ignore would also stop a security update for k8s.io/api. The docs say nothing about an ignore's update types there, but dependabot-core drops them in a security update and keeps only the version ranges (IgnoreCondition#ignored_versions: https://github.com/dependabot/dependabot-core/blob/05146d8f2a50ea4adf6e00a197c85afae99f7051/common/lib/dependabot/config/ignore_condition.rb#L41-L46), so with update types a security update for k8s.io/api can still come. Ignoring only minor and major would not do: k8s.io/api v0.36.5 and v0.36.6 exist, so the next refresh would move k8s.io/api alone to v0.36.6 and list that in the table, before apiextensions-apiserver moves it to v0.37.2. The group's exclude-patterns would only give k8s.io/api a pull request of its own, failing the same way. With the ignore, the group's table stays the six rows #20 has now: k8s.io/api is not listed, though go.mod moves it.

Checked with check-jsonschema 0.39.0 against schemastore's dependabot-2.0 schema, both the copy it ships and the live one: the new file passes, and copies with an invalid update type or a misspelled key fail, so the ignore block is checked. SECURITY.md is plain ASCII and its links and anchors resolve.

Private vulnerability reporting has been on since p10node#16, which offered a
SECURITY.md to go with it. GitHub shows the policy above the report
form, so a reporter reads it before writing.

It says that only the newest release gets security fixes, how to
report privately and what to put in a report, and what happens next:
best effort, with no response times promised, and the advisory
published with the release that fixes it. Its scope is what the docs
already promise, so a report has something to be measured against:
read-only mode is a guard against k10s, not against you; the
self-updater installs only an archive that matches the release's
checksums.txt, and does not check attestations; k10s runs a plugin's
command without a shell of its own and gives a sh -c script the
cluster's values as environment variables, while what the plugin's own
script or program does with those values is up to the plugin; a
published advisory against Go or a module can be a public issue. It
ends with gh attestation verify, as docs/install.md has it.

docs/maintaining.md now says in its Releases section that releases are
tagged on main with no release branches, so a fix ships in the next
release, and points at SECURITY.md below the repository settings.

Signed-off-by: Adao Oliveira Jr <[email protected]>
The kubernetes group fails on every refresh: runs 41142937813 on
2026-10-30 and 42016449136 on 2026-11-05. Dependabot updates a group
one module at a time, and it starts with k8s.io/api, which does not
require client-go. k8s.io/api v0.37.2 dropped scheduling/v1alpha2,
which client-go v0.36.4's informers import, so with client-go left
behind, go mod tidy fails:

  cannot find module providing package k8s.io/api/scheduling/v1alpha2

The next module, apiextensions-apiserver, moves client-go and
k8s.io/api to v0.37.2 together, which is why p10node#20 still got its
update, but the job reports the error and fails.

Ignore every version update of k8s.io/api by itself; client-go, which
requires the matching k8s.io/api, moves it. The ignore lists the
three update types rather than the name alone. GitHub's docs say an
ignore applies to security updates too, so a name-only ignore would
also stop a security update for k8s.io/api. dependabot-core drops an
ignore's update types in a security update and keeps only its version
ranges (IgnoreCondition#ignored_versions), so with update types a
security update for k8s.io/api can still come.

Signed-off-by: Adao Oliveira Jr <[email protected]>
@junior
junior requested a review from pierreneter as a code owner November 7, 2026 23:54
junior added a commit to junior/k10s that referenced this pull request Nov 9, 2026
p10node#28 adds a sentence after the same table, so the two pull requests
conflicted in docs/maintaining.md. Above the table, both apply in
either order.

Signed-off-by: Adao Oliveira Jr <[email protected]>
@junior

junior commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

@pierreneter, could you approve this one here when you have a moment? The protect-main ruleset needs an approving review on the pull request before it can merge, and the v0.1.9 notes in #33 wait for it.

@pierreneter pierreneter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Docs-only, merges clean. One inline note on the plugin paragraph, and one thing outside this PR:

k10s --help (main.go:223) still says read-only blocks "dangerous plugins", while internal/ui/plugins.go:86 refuses every external plugin, as this SECURITY.md says. The help text is the stale one; one-line fix in a separate PR.

Comment thread SECURITY.md
plugin's command directly, never through a shell of its own, and fills
object names, namespaces and column values into its arguments as text. When
the command is `sh`, `bash`, `zsh`, `dash` or `ksh` with `-c`, the script
gets them as environment variables instead of having them pasted into its

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This promises a bit more than plugin.ExecCommand does. It treats only the single argument right after the first short-flag group containing c as the script, and only when the command's own basename is one of the five shells. Two configs slip through:

  • sh -c -x 'kubectl get pod $COL-STATUS' (valid POSIX order): -x is taken as the script, the real one is text-expanded.
  • env bash -c '...' or busybox sh -c '...': basename is not a shell, no env substitution at all.

Since the next sentence makes "k10s turning a cluster value into code" a vulnerability, this gap is reportable by the policy's own definition. Two ways out: state the exact condition here (script must be the argument right after -c, and the command itself must be the shell), or tighten ExecCommand to match this wording (skip option args after -c until the first non-option; maybe strip a leading env). I'd keep this text as the intended guarantee and do the code fix separately. Not a blocker for this PR.

@junior
junior merged commit 7244b70 into p10node:main Nov 12, 2026
3 checks passed
junior added a commit that referenced this pull request Nov 12, 2026
A plugin whose command is a POSIX shell gets plugin values in its -c
script through the environment, so a value from the cluster is never read
as shell syntax (SECURITY.md). ExecCommand took the argument right after
the first short option group containing c as the script, and only when the
command itself was one of the five shells, so values were pasted as text
into the script the shell really runs in:

- sh -c -x '...', sh -c -o errexit '...' and sh -c -- '...': a shell reads
  options up to the first argument that does not start with - or +, or up
  to --, so the script comes after -x, -o errexit or --;
- env bash -c '...' and busybox sh -c '...': the command is not a shell.

shellCode now reads the options as the shells do: groups that start with -
or + (c turns on -c, +c too), o taking the next argument when it ends its
group, -- or a lone - ending the options, and bash's long options. It finds
the shell behind env, whose options it reads as getopt does, and behind
busybox's sh, ash, hush and bash. The script and the options before it get
values through the environment; arguments after the script ($0, $1, ...)
still get them as text. Where the shells read an option differently, or
k10s does not know it (bash's -O, o inside a group, a lone +, other long
options, an env option it does not know), every argument gets the
environment: safe, though a value meant for $1 then arrives as the
variable's name. A Windows build of a shell (bash.exe) counts as the shell.

env -S is not a way to a shell: it builds a command line of its own from a
string and expands ${VAR} in it, so the environment would not keep a value
out of it. It stays a program that reads its own command line, as
python3 -c is, and gets values as text.

SECURITY.md names env and busybox, and puts env -S with python3 -c;
docs/plugins.md says how values reach a -c script.

From the review of #28.

Signed-off-by: Adao Oliveira Jr <[email protected]>
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.

2 participants