Skip to content

Security hardening (tasks collection) #5

Open

Description

@aldbr

This issue is a collection of sub-tasks for:

  • Minimizing our dependencies to secrets

  • Removing un-necessary CI items

  • Augment the audit

  • Hardening who can do what and how in terms of commits, branches, tags

  • harden branches

  • fork only policy for branches for PRs

  • harden tags

  • check for unused secrets

NPM releases:

PyPI releases. Use trusted publisher (with environment) instead of PYPI_TOKEN: coming soon (for ref: https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-pypi)




  • Keep the pre-commit hook revs updated, and run the hooks the same way everywhere (audit of Nov 17):
    • Enable Renovate's pre-commit manager in the shared preset: chore: enable Renovate's pre-commit manager in the shared preset #8 — it is off by default in Renovate, so before this the pinned hook revs never got update PRs (several repos still pin 2023-era hooks: black 23.1.0, flynt 0.77, pyupgrade v3.3.1, which crash on Python ≥ 3.12 runners)
    • Plan: converge all repos on the same CI pattern — pre-commit/action runs the hooks, pre-commit-ci/lite-action pushes auto-fixes to PR branches; Renovate does the rev updates. No more full pre-commit.ci app (it is an external app with write access to the repos):
      • diracx: ci: run all pre-commit hooks in CI and rely on Renovate for hook updates diracx#1193 — full replacement of the app: all hooks run in CI (pixi-dependent ones via stages: [manual] + --hook-stage manual), Renovate does the updates; the pre-commit.ci app can be uninstalled once merged (it also covers diracx-charts, where the app is installed: last autoupdate Dec 2025)
      • DIRAC: ci: run pre-commit via pre-commit/action and lite-action DIRAC#8904 (stacked on #8903 → #8900 → #8891); release branches via the pixi ports #8905 (rel-v9r0) and #8907 (rel-v8r0), which include the same pre-commit change
      • WebAppDIRAC: ci: run pre-commit via pre-commit/action and lite-action WebAppDIRAC#825 (rel-v5r0 can follow via #821 once validated)
      • already on the pattern: intercede, signurlarity, diracx-charts (pre-commit/action + pre-commit-ci/lite-action)
      • remaining plain-style repos (same enforcement, no auto-fix — optional to convert): DB12, diraccfg, diracgrid.org, mkdocs-diracx-plugin, Pilot, .github, container-images, DIRACOS2
      • hooks needing Python 3.11 pins until Renovate updates them: DIRAC, WebAppDIRAC, DB12, diraccfg (pin black/flynt/pyupgrade first, then move the CI job to python-version: 3.x)


  • Minimize GITHUB_TOKEN permissions: always set permissions: {} at the workflow level to disable all permissions by default. Then, grant only the specific permissions needed at the job level.

  • investigate actions's lockfiles, and make sure we have cooldowns

Activity

  1. changed the title [-]On minimizing our dependencies to user tokens[/-] [+]On minimizing our dependencies to secrets[/+] on Nov 11, 2026
  2. changed the title [-]On minimizing our dependencies to secrets[/-] [+]Security hardening (tasks collection)[/+] on Nov 12, 2026
  3. transferred this issue fromDIRACGrid/diracxon Nov 12, 2026
  4. fstagni commented on Nov 17, 2026

    @fstagni
    Contributor

    Status update on the failing PRs (all diagnosed, fixes pushed where needed):

    New PRs opened:

    • diraccfg#15 — ci: run the CI jobs with pixi (stacked on #13). Conda has disappeared from the ubuntu-latest runners (last green CI Nov 13, then conda: command not found), which was breaking the diraccfg CI (and the checks on #13/#14). diraccfg is therefore un-parked: locked pixi environments (py39/py310/py311, committed pixi.lock), build via python -m build, actions pinned, minimal permissions.
    • management#79 — ci: only push the el9-dirac image from master. Fork PRs get a read-only GITHUB_TOKEN, so the unconditional docker push always failed on PRs (installation not allowed to Write organization package) — this is what was red on #78 (and #77 earlier). Same guard as the certificates-generation job already uses.

    Fixes pushed to existing PRs:

    • DIRAC#8900: two root causes found and fixed (8e7ab5b6):
      • pixi.lock was still in .gitignore → never committed → prefix-dev/setup-pixi failed with Failed to generate cache key on all check/check-py314 jobs (and the environments weren't actually locked). Lockfile now generated and committed.
      • the integration workflow quoted $MATRIX_ARGS, merging all KEY=VALUE pairs of matrix.ARGS into a single argument (MYSQL_VER="mariadb:11.4.3 ES_VER=..." → invalid docker reference; backward-compat job got a mangled INSTALLATION_BRANCH). Word-splitting restored.
    • DIRAC#8893 (rel-v8r0 zizmor): merged upstream/rel-v8r0 to resolve the conflict — the only conflict was the pylint-py27 job, dropped in favor of the upstream removal (#8895). Now MERGEABLE again.

    Diagnosed as not caused by the PRs — re-runs triggered:

    • DIRACOS2#210/#211: pre-existing on the bases. Root cause was conda-forge shipping cachetools 8.0.0, which broke DIRAC v9 auth (Registry caches) — fixed upstream by DIRAC#8902, now on integration/rel-v9r0. The failed jobs have been re-run.
    • diracx#1189: pre-existing infra flake on main (cert-manager webhook not ready when issuer.yml is applied → diracx/dex pods never healthy → Connection refused in cli_env). main is green again; failed jobs re-run.
    • diracx-web#521: pre-existing on main since Nov 16 — same cert-manager demo bootstrap failure (secrets "root-secret" not found, webhook connection refused/x509) plus ghcr.io/gubbins/tasks:dev anonymous-pull 403 in the gubbins run. Needs a separate infra issue for the diracx demo/chart maintainers; a plain re-run of #521 will likely fail until that's fixed.

    Still open (unchanged): the zizmor PRs awaiting review, exclude-newer rollout (intercede, signurlarity, diracx-charts, diracx-web), the pixi lockfile-maintenance rule in the shared Renovate preset, and the diraccfg zizmor PR (now stacked on #13 → #15).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions