Skip to content

Disable GitHub workflows that use secrets to prevent supply chain attacks - #1420

Merged
tdas merged 6 commits into
unitycatalog:mainfrom
openinx:remove-secret-dependent-workflows
Mar 25, 2026
Merged

tdas merged 6 commits into
unitycatalog:mainfrom
openinx:remove-secret-dependent-workflows

Conversation

@openinx

@openinx openinx commented Mar 25, 2026 •

Copy link
Copy Markdown
Collaborator

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

Disables all GitHub Actions workflows that reference secrets (secrets.*) by adding if: false to every job. The original trigger conditions are preserved as commented-out code so they can be restored easily in the future.

Affected workflows:

Workflow Secret(s) used
docker-build.yml DOCKERHUB_USERNAME, DOCKERHUB_TOKEN
ui-docker-build.yml DOCKERHUB_USERNAME, DOCKERHUB_TOKEN
publish-snapshot.yml SONATYPE_USERNAME, SONATYPE_PASSWORD
backport.yml BACKPORT_ACTION_TOKEN
publish-swagger-docs.yml GITHUB_TOKEN
auto-assign-issues.yml GITHUB_TOKEN

Why disable instead of delete?

Workflow files that reference secrets are a supply chain attack surface — a malicious PR could trigger them and exfiltrate credentials. Disabling with if: false prevents any execution while keeping the workflow definitions intact for future re-enabling. To restore a workflow, simply remove the if: false line and uncomment the original condition.

Removes docker-build.yml, ui-docker-build.yml, publish-snapshot.yml, and backport.yml
which depend on secrets (DOCKERHUB_USERNAME, DOCKERHUB_TOKEN, SONATYPE_USERNAME,
SONATYPE_PASSWORD, BACKPORT_ACTION_TOKEN) that must be configured in GitHub settings.

Keeps workflows that only use the auto-provided GITHUB_TOKEN.

Signed-off-by: Zheng Hu <[email protected]>
@openinx
openinx requested a review from tdas as a code owner March 25, 2026 20:18
openinx added 3 commits March 25, 2026 13:20
Replace workflow deletions with if: false on all jobs, keeping the files
in the repo but preventing any execution. This is safer than deletion as
it makes the intent explicit and prevents reintroduction without review.

Signed-off-by: Zheng Hu <[email protected]>
@openinx openinx changed the title Remove GitHub workflows that require custom secret configuration Disable GitHub workflows that use secrets to prevent supply chain attacks Mar 25, 2026
openinx added 2 commits March 25, 2026 14:09
pull_request_target runs in the context of the base repo and has access
to secrets even from fork PRs, making it a high-risk attack vector.

Signed-off-by: Zheng Hu <[email protected]>
@tdas
tdas merged commit abf29d7 into unitycatalog:main Mar 25, 2026
1 check passed
tdas pushed a commit that referenced this pull request Mar 25, 2026
…in attacks (#1426)

Backport of #1420 to `branch-0.1`.

**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [ ] If there is a related issue, make sure it is linked to this PR.
- [ ] If you've fixed a bug or added code that should be tested, add
tests!
- [ ] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**

Disables all GitHub Actions workflows that reference secrets
(`secrets.*`) by adding `if: false` to every job. The original trigger
conditions are preserved as commented-out code so they can be restored
easily in the future.

Note: branch-0.1 has different workflows from later branches. The
affected files are `project-board-automation-for-issues.yml` and
`project-board-automation-for-prs.yml`, both of which use
`secrets.PROJECT_BOARD_AUTOMATION_TOKEN`.

Affected workflows:

| Workflow | Secret(s) used |
|---|---|
| `project-board-automation-for-issues.yml` |
`PROJECT_BOARD_AUTOMATION_TOKEN` |
| `project-board-automation-for-prs.yml` |
`PROJECT_BOARD_AUTOMATION_TOKEN` |

**Why disable instead of delete?**

Workflow files that reference secrets are a supply chain attack surface
— a malicious PR could trigger them and exfiltrate credentials.
Disabling with `if: false` prevents any execution while keeping the
workflow definitions intact for future re-enabling. To restore a
workflow, simply remove the `if: false` line and uncomment the original
condition.

Signed-off-by: Zheng Hu <[email protected]>
tdas added a commit that referenced this pull request Mar 25, 2026
…in attacks (#1425)

Backport of #1420 to `branch-0.2`.

**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [ ] If there is a related issue, make sure it is linked to this PR.
- [ ] If you've fixed a bug or added code that should be tested, add
tests!
- [ ] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**

Disables all GitHub Actions workflows that reference secrets
(`secrets.*`) by adding `if: false` to every job. The original trigger
conditions are preserved as commented-out code so they can be restored
easily in the future.

Note: only `auto-assign-issues.yml` and `publish-swagger-docs.yml` exist
in `branch-0.2` and are affected by this backport.

Affected workflows:

| Workflow | Secret(s) used |
|---|---|
| `publish-swagger-docs.yml` | `GITHUB_TOKEN` |
| `auto-assign-issues.yml` | `GITHUB_TOKEN` |

**Why disable instead of delete?**

Workflow files that reference secrets are a supply chain attack surface
— a malicious PR could trigger them and exfiltrate credentials.
Disabling with `if: false` prevents any execution while keeping the
workflow definitions intact for future re-enabling. To restore a
workflow, simply remove the `if: false` line and uncomment the original
condition.

Signed-off-by: Zheng Hu <[email protected]>
Co-authored-by: Tathagata Das <[email protected]>
tdas pushed a commit that referenced this pull request Mar 25, 2026
…in attacks (#1423)

Backport of #1420 to `branch-0.3`.

**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [ ] If there is a related issue, make sure it is linked to this PR.
- [ ] If you've fixed a bug or added code that should be tested, add
tests!
- [ ] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**

Disables all GitHub Actions workflows that reference secrets
(`secrets.*`) by adding `if: false` to every job. The original trigger
conditions are preserved as commented-out code so they can be restored
easily in the future.

Note: `publish-snapshot.yml` and `backport.yml` do not exist in
`branch-0.3` and are not included in this backport.

Affected workflows:

| Workflow | Secret(s) used |
|---|---|
| `docker-build.yml` | `DOCKERHUB_USERNAME`, `DOCKERHUB_TOKEN` |
| `ui-docker-build.yml` | `DOCKERHUB_USERNAME`, `DOCKERHUB_TOKEN` |
| `publish-swagger-docs.yml` | `GITHUB_TOKEN` |
| `auto-assign-issues.yml` | `GITHUB_TOKEN` |

**Why disable instead of delete?**

Workflow files that reference secrets are a supply chain attack surface
— a malicious PR could trigger them and exfiltrate credentials.
Disabling with `if: false` prevents any execution while keeping the
workflow definitions intact for future re-enabling. To restore a
workflow, simply remove the `if: false` line and uncomment the original
condition.

Signed-off-by: Zheng Hu <[email protected]>
tdas added a commit that referenced this pull request Mar 25, 2026
…in attacks (#1421)

Backport of #1420 to `branch-0.4`.

**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [ ] If there is a related issue, make sure it is linked to this PR.
- [ ] If you've fixed a bug or added code that should be tested, add
tests!
- [ ] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**

Disables all GitHub Actions workflows that reference secrets
(`secrets.*`) by adding `if: false` to every job. The original trigger
conditions are preserved as commented-out code so they can be restored
easily in the future.

Note: `publish-snapshot.yml` does not exist in `branch-0.4` and is not
included in this backport.

Affected workflows:

| Workflow | Secret(s) used |
|---|---|
| `docker-build.yml` | `DOCKERHUB_USERNAME`, `DOCKERHUB_TOKEN` |
| `ui-docker-build.yml` | `DOCKERHUB_USERNAME`, `DOCKERHUB_TOKEN` |
| `backport.yml` | `BACKPORT_ACTION_TOKEN` — fully removed due to
`pull_request_target` risk |
| `publish-swagger-docs.yml` | `GITHUB_TOKEN` |
| `auto-assign-issues.yml` | `GITHUB_TOKEN` |

**Why disable instead of delete?**

Workflow files that reference secrets are a supply chain attack surface
— a malicious PR could trigger them and exfiltrate credentials.
Disabling with `if: false` prevents any execution while keeping the
workflow definitions intact for future re-enabling. To restore a
workflow, simply remove the `if: false` line and uncomment the original
condition.

Signed-off-by: Zheng Hu <[email protected]>
Co-authored-by: Tathagata Das <[email protected]>
yili-db pushed a commit that referenced this pull request Oct 27, 2026
## 🥞 Stacked PR
Use this
[link](https://github.com/unitycatalog/unitycatalog/pull/2019/files) to
review incremental changes.
-
[**stack/ep3-helm-ci**](#2019)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2019/files)]
← _this PR_
-
[stack/ep3-helm-release](#2020)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2020/files/9090e88439087610b7240d3dd89c8464e6ac83d9..573a422bfdfcc8aa1e144e1a8d28c19879ed5b14)]
-
[stack/ep3-helm-docs](#2021)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2021/files/573a422bfdfcc8aa1e144e1a8d28c19879ed5b14..936a12fac01b260d4d3fa97706943c076c8ac757)]

---------
**Description of changes**

The UI moved from yarn to bun in #1732, but the Helm chart still starts
it with `yarn start`. Yarn 1 refuses to run in a project whose
`package.json` declares `packageManager: bun@…`. So with any UI image
built from today's `ui/`, the UI pod crash-loops and `helm install
--wait` times out.

This PR:

- starts the UI with `bun run start` when the image has bun, and with
`yarn start` otherwise. The UI stays on by default, as on main;
- adds a `helm test` hook that checks the server API, the UI page and
the UI's `/api` proxy. Its image is set by `test.image` (with
`test.imagePullSecrets`), so a mirrored registry can run it;
- adds a **Helm Chart Tests** workflow for pull requests that touch
`helm/`, `ui/` or the `Dockerfile`. It checks that the chart README is
current (helm-docs), runs `ct lint`, installs the chart on kind with
server and UI images built from the PR, and runs `helm test`;
- regenerates the chart README, which was missing the values added in
#1689 and #1690, and fixes two yamllint errors in `values.yaml`. The
yamllint fixes are whitespace only, and the parsed values are identical.

UI images built from today's `ui/` now start with bun. The published
`unitycatalog-ui:main` image (May 2025) predates bun and has only yarn,
so it keeps starting with yarn, and a default install or `helm upgrade`
from main keeps its UI. bun is checked first, because a bun image also
has yarn (from `node:18`), but yarn refuses to run there. Once each
release publishes a bun-based UI image (#2020, #2021), the yarn branch
can go.

**Tests:** on a local kind cluster, the unchanged chart crash-loops the
UI as described above. With this PR, the install is ready in about 30
seconds and `helm test` passes. CI installs the chart with its default
values, with server and UI images built from the PR. This stack changes
no JVM code, and the full `build/sbt test` suite passes locally.

<details><summary><b>📐 Design notes &amp; details</b></summary>

**Repro of the bug** (kind with Kubernetes 1.32, server image `v0.7.0`,
UI image built from `main`):

```
error This project's package.json defines "packageManager": "yarn@[email protected]". However the current global version of Yarn is 1.22.22.
```

With `bun run start`, the following all returned 200 through a
port-forward: the UI page, the server API, a read through the UI's
`/api` proxy, and creating and deleting a catalog and a schema through
that proxy.

**Why this workflow builds Docker images.** #1420 disabled the image
*publishing* workflows to protect their Docker Hub secrets. This
workflow builds images only to load them into a throwaway kind cluster:

- it pushes nothing and uses no secrets;
- `permissions: contents: read` and `persist-credentials: false`;
- it runs on `pull_request`, not `pull_request_target`;
- actions are pinned to commit SHAs and the helm-docs image to a digest;
- zizmor reports no findings for it.

**What the test checks.**

- The UI dev server enables its host check whenever it proxies the API.
In that mode it accepts `localhost`, `*.localhost` and IP addresses, and
rejects other hostnames such as the Service name (see #753). The test
sends `Host: localhost`, as a browser on `kubectl port-forward` does.
Ingress and HTTPRoute mode turn the proxy off, and the test then skips
the proxy check.
- With `auth.enabled`, the test has no token, so it checks only the UI
page. With auth on and the UI off, there is nothing to check, and no
test pod is rendered.
- A failed check prints which check failed, and CI runs `helm test
--logs` so the output reaches the job log. The test pod is kept after it
passes and replaced on the next run, because `--logs` reads it after the
test finishes.
- The test checks that the UI is served, not that the UI compiles: the
dev server serves `index.html` even after a compile error.
- Ingress and HTTPRoute installs aren't exercised, because they need a
controller in kind.

**Local limits.** This machine can't build the server image from source
(old Docker and kernel), so locally I ran the same steps with the
released `v0.7.0` server image. The first from-source build in this
workflow is this PR's CI run.

Tools: Helm 3.20.0, chart-testing-action 2.9.0 (ct 3.15.0), kind-action
1.15.1, helm-docs 1.14.2.

**Measured results** (kind, chart from this PR, UI on, images built from
the PR):

| Request | Status |
|---|---|
| server `GET /api/2.1/unity-catalog/catalogs` | 200 |
| UI `GET /` with `Host: localhost:3000` | 200, UI page |
| UI `GET /` with `Host: uc.example.com` | 200, but the body is `Invalid
Host header` (the dev server's rejection page, see #753) |
| through the UI: `GET /api/2.1/unity-catalog/catalogs` | 200 |
| through the UI: `POST /catalogs {"name": "ep3"}` | 200 |
| through the UI: the same `POST` again | 400 (already exists) |
| through the UI: `GET /catalogs/missing` | 404 |
| through the UI: `DELETE /catalogs/ep3` | 200 |
| unchanged chart (`yarn start`) | UI pod in CrashLoopBackOff; `helm
install --wait` times out |

**Security review: building images in CI again.** #1420 turned off the
workflows that built and pushed images, because they held Docker Hub
secrets. This workflow builds images again, for testing only. I reviewed
it, and also ran GLM 5.3 and Claude Opus reviews; every point below was
checked against the files, the actions at their pinned commits, and a CI
run.

*If a container in this job is compromised:*

| Where the bad code runs | What it can do |
|---|---|
| inside `docker build` (a base image, or an npm, Maven, apk or apt
package) | change the image under test; it gets no token and no secret |
| inside a kind pod (a chart helper image) | the same, unless it escapes
the pod |
| on the runner (helm, uv, ct, kind, helm-docs, or an escape from the
privileged kind node) | control this job: a read-only `GITHUB_TOKEN`, no
secrets, no way to push images, charts or code; it can make the test
pass or fail wrongly |

The one way out of the job was the GitHub Actions cache. A job running
on `main` writes caches that other workflows on `main` restore,
including the sbt and bun caches and `ai-review.yml`, which holds
secrets. So the workflow runs **only on pull requests**: a pull
request's caches are scoped to that pull request, and `main` never reads
them. A tampered helm-docs image could edit chart files before the
install, so the check now fails on any change under `helm/`, not only
`README.md`.

*Docker Hub credentials:* this workflow can't reach them under any
trigger. GitHub gives a job only the secrets it names, and this workflow
names none; pull requests from forks get no secrets at all. Before
anyone turns the old image workflows back on: they log in to Docker Hub
and use the `type=gha` build cache in the same job, so a poisoned cache
could reach the published images.

*Pinned inputs:* actions by commit SHA (`actions/checkout` at v7.0.1);
helm-docs, the Dockerfiles' base images and syntax frontend, the `helm
test` image and the kind node image
(`kindest/node:v1.37.0@sha256:a1ed…`) by digest; kind v0.33.0, kubectl
v1.37.1, helm v3.20.0 and uv 0.13.1 by version; the UI's npm packages by
`bun.lock`. The chart's other helper images still use `latest` here;
#2020 pins them. Not pinned, and pre-existing: `apk add bash` and
`apt-get install jq` during the image builds and `apk add` in the config
init container (signed packages, but versions move), and sbt's Maven
downloads and launcher jar (no hash lock).

*Follow-ups (not in this stack):* zizmor checks for all workflows.
Separately, the existing cache exposure this workflow avoids stays as it
is: `unit-tests.yml`, `lint-check.yml` and `cross-spark-build.yml` write
caches on `main`, and `ai-review.yml` restores caches while holding
secrets. zizmor's cache-poisoning audit doesn't flag the `ai-review.yml`
case (0 findings when run on it).

</details>

**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [ ] If there is a related issue, make sure it is linked to this PR.
- [x] If you've fixed a bug or added code that should be tested, add
tests!
- [ ] If you've added or modified a feature, documentation in `docs` is
updated

This pull request and its description were written by Isaac.

---------

Signed-off-by: Shubham Bansal <[email protected]>
Co-authored-by: Isaac <[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