Skip to content

Update README.md - #88

Closed
cmainas wants to merge 17 commits into
mainfrom
cmainas-patch-1
Closed

cmainas wants to merge 17 commits into
mainfrom
cmainas-patch-1

Conversation

@cmainas

@cmainas cmainas commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Description

Related issues

  • Fixes #

How was this tested?

LLM usage

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

ananos and others added 17 commits December 1, 2026 20:19
The takeover job cloned the repo and pushed origin/main to main-pr<N>.
That push used the GITHUB_TOKEN persisted by actions/checkout, so the
job needed contents: write and pull-requests: write on a
pull_request_target run. The urunc-bot token was only used by gh.

We now create the branch through the git refs API with the urunc-bot
token and drop the checkout:

- GITHUB_TOKEN gets no permissions.
- The app token is limited to contents and pull-requests.
- No workflow runs on push to main-pr*, so a bot-created ref does not
  start anything new.

Fixes the Scorecard Token-Permissions alert for pr-takeover.yml.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
git-trailers pushes the rewritten commits with plain git push. Its
token input only feeds gh, so the push used the GITHUB_TOKEN persisted
by actions/checkout. That is why the job held contents: write on a
pull_request_target run.

We now generate the urunc-bot token first and hand it to
actions/checkout, so git push and gh both run as urunc-bot. The job
drops to contents: read. The app token is limited to contents,
pull-requests and workflows. GitHub refuses pushes that touch
.github/workflows without the workflows permission, which GITHUB_TOKEN
can never have.

The checkout also loses its ref: github.event.pull_request.base.ref.
The default ref of pull_request_target is the base branch already, so
we check out the same main-pr<N> commit. Scorecard flags any
github.event.pull_request ref on this trigger as an untrusted checkout.

No workflow runs on push to main-pr*, so pushing as urunc-bot does not
start anything new. The PR to main was already opened and merged with
the urunc-bot token.

Fixes the Scorecard Dangerous-Workflow and Token-Permissions alerts for
pr-merge.yml.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
Same change as pr-merge.yml. git-trailers pushed the rewritten PR
commits with the GITHUB_TOKEN persisted by actions/checkout, so the
job needed contents: write. We now pass the urunc-bot token to
actions/checkout and drop GITHUB_TOKEN to contents: read.

One behavior change: a push by urunc-bot fires pull_request
synchronize, while a GITHUB_TOKEN push does not. The rewritten head of
a same-repo PR now gets its own CI, CodeQL and dependency review run.
The merge still happens right after the push, as before.

These are the commits that land on main. Today they carry no checks,
which is presumably part of the low Scorecard CI-Tests score (5/13).

Fixes the Scorecard Token-Permissions alert for add-git-trailers.yml.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
rolling_release.yml was the only workflow without a top-level
permissions block. Its single job sets its own permissions, so this
changes nothing at run time. It keeps any job added later at read-only
by default.

Fixes the Scorecard "no topLevel permission defined" alert.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
The nightly rolling release needs contents: write to create the release
and move the tag. It took that from GITHUB_TOKEN, while
release-trigger.yaml already publishes versioned releases with a
urunc-bot token limited to permission-contents: write.

We now do the same here. The token is minted only after the tip check
passes. ci_main.yml passes URUNC_BOT_PRIVATE_KEY explicitly, and both
jobs drop to contents: read. The tip check keeps using the read-only
GITHUB_TOKEN.

The privilege is the same, held by the same identity as the versioned
release. A release or tag created by urunc-bot fires no workflow here:
nothing listens on release, and every push trigger filters on branches.

Fixes the Scorecard Token-Permissions alerts for ci_main.yml and
rolling_release.yml.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
publish_docs.yml ran with workflow-level contents: write. In the same
job it installed unpinned packages from requirements.txt and pushed
gh-pages with mkdocs gh-deploy. Any of those packages could use the
write token to push branches or move tags.

We now split the workflow:

- build: contents: read. It installs the docs dependencies with
  --require-hashes, runs mkdocs build and uploads the site.
- deploy: pages: write and id-token: write only, through the
  GitHub-owned actions/deploy-pages. No job can push to the repo.

requirements.in keeps the old list, without the duplicate entries.
requirements.txt is now generated from it with pip-compile
--generate-hashes, with the command in its header. Dependabot (pip,
monthly) keeps the pins fresh. The versions are what an unpinned
install picks today. The built site matches gh-deploy, CNAME included.

This needs the Pages source switched from the gh-pages branch to
"GitHub Actions" when this merges:

  gh api -X PUT repos/urunc-dev/urunc/pages -f build_type=workflow

The custom domain (urunc.io) is a Pages setting and stays as is. The
gh-pages branch can be removed once the first deployment is live.

Fixes the Scorecard Token-Permissions and Pinned-Dependencies (pip)
alerts for publish_docs.yml.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
The commit lint job ran npm install with no lockfile. The spell check
job ran npm install -g cspell, which picks whatever is latest on each
run. Both resolve versions at run time, so a bad npm release reaches
CI without any change in the repo.

We now:

- add .github/linters/package-lock.json and install with npm ci in
  both jobs, with monthly Dependabot updates;
- pin cspell to 10.5.1, the newest 10.x older than two weeks. CI used
  10.6.0 until now, and the commitlint spellcheck plugin accepts it as
  a peer;
- run the spell check on Node 22, since cspell 10 needs >= 22.18;
- skip requirements.txt and package-lock.json in cspell, since both
  are generated.

Locally, cspell reports 0 issues on 194 files and commitlint passes on
this branch.

Fixes the two Scorecard Pinned-Dependencies (npm) alerts.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
The final stage of the urunc-deploy image installed yq==3.2.3 with
pip. Its dependencies (PyYAML, xmltodict, tomlkit, argcomplete) were
unpinned and unverified, and the image is pushed to ghcr and signed
with cosign.

We now generate deployment/urunc-deploy/requirements.txt from
requirements.in with pip-compile --generate-hashes and install it with
--require-hashes. The yq version is unchanged. The file is part of the
build-trigger paths and the Dependabot pip updates.

Checked on the pinned alpine:3.21 base: the install succeeds and yq
reports 3.2.3.

Fixes the Scorecard Pinned-Dependencies (pip) alert for the
urunc-deploy Dockerfile.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
v0.61.0 is affected by GO-2026-6860 (quadratic text node coalescing
in x/net/html) and GO-2026-6866 (raw text rendering under nested
namespaces). Both are fixed in v0.62.0. x/net is an indirect
dependency.

go build ./... passes. An OSV query over all 84 modules in go.mod
reports no known vulnerabilities after the bump.

Fixes the Scorecard Vulnerabilities alert.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
SECURITY.md only had a relative link to
docs/developer-guide/security.md. Readers on GitHub and tools like
Scorecard look for the reporting channels and the disclosure timeline
in SECURITY.md itself.

We now list the two reporting channels (private vulnerability reporting
and security@urunc.io), the 48-hour acknowledgment, the embargo and the
advisory. The content comes from the existing policy page, and the file
links to it on urunc.io for the full text and the report template.

Fixes the Scorecard Security-Policy alert.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
add-git-trailers.yml admin-merged a PR on any approved review. On a
public repo any GitHub account can approve. The ruleset ignores such an
approval, but --admin bypasses the ruleset. Both auto merges also ran
gh pr merge without a SHA. A push during the sleep 5 window, or between
the trailer push and the merge, would be merged unreviewed.

We now:

- check in add-git-trailers that the reviewer has write or admin
  access, and that the approval is for the current head. Otherwise the
  job stops with a notice;
- wait until the PR head is the commit we pushed, then merge with
  --match-head-commit, in add-git-trailers and pr-merge. This also
  replaces the fixed sleep.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
zizmor flags two patterns across the workflows:

- artipacked: actions/checkout leaves GITHUB_TOKEN in .git/config for
  the rest of the job. Any later step, or an artifact that includes the
  checkout, can read it. We now set persist-credentials: false on every
  checkout. The exceptions are add-git-trailers.yml and pr-merge.yml,
  where git-trailers pushes with those credentials. The only later git
  network call, git fetch in build-trigger.yml, reads this public repo
  and needs no token.
- template-injection: ${{ }} expanded inside run: blocks. The values
  are trusted today (github.workflow, caller constants). We still pass
  them through env, so a future caller cannot turn an input into shell
  code. The cosign annotations use the GITHUB_* variables the runner
  already sets.

No behavior change.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
The commit messages of the CI hardening series name a few tools and
Python packages that cspell does not know.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
Commit 4f89012 dropped the checkout ref and relied on the default ref
of pull_request_target being the base branch. It is not: the default
ref is the default branch. In a sandbox run, actions/checkout checked
out main. git-trailers rebased nothing and force-pushed main over
main-pr<N>. That dropped the merged PR from the branch, and gh pr
create then failed with "No commits between main and main-pr<N>".

We now set ref: ${{ github.base_ref }}. It names the same branch as
the old github.event.pull_request.base.ref, through the documented
context for a PR's base branch. Scorecard flags
github.event.pull_request refs because they usually point at the PR
head. The base branch here only holds what a writer merged into it.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
PR: #85
Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
PR: #85
Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
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.

3 participants