Commit ab812cb
authored
Apply Databricks Labs Repository Lockdown policy (#19)
* Add scripts/security/ action-pinning tooling
Implements the three-script workflow from the Databricks Labs Repository
Lockdown policy: list-external-actions -> resolve-action-ref -> pin-gh-actions.
- list-external-actions: emits every third-party action referenced under
.github/ (requires yq by Mike Farah).
- resolve-action-ref: for each action, finds the most recent release tag
published before the cutoff (2026-03-10T00:00:00Z) and resolves it to a
commit SHA. Handles both mono-repo conventions: subpath-prefixed tags
(databrickslabs/sandbox/acceptance -> acceptance/v0.4.4) and top-level
shared tags (github/codeql-action/analyze -> v4.32.6, where the subpath
is just a directory inside a repo using a unified tag series).
- pin-gh-actions: consumes resolve-action-ref output, rewrites every
matching `uses:` under .github/ with the SHA form + tag comment, and
stages (but does not commit) the result. Skips databricks/databrickslabs
actions per policy. Deviates from the blueprint reference in one way:
does not auto-create or switch branches, because GeoBrix manages
branches manually.
README documents the typical flow and the 2026-03-10 cutoff.
Co-authored-by: Isaac
* Pin external GitHub Actions to commit SHAs (cutoff 2026-03-10)
Every third-party `uses:` under .github/workflows/ and .github/actions/ is
now pinned to the commit SHA of the most recent release published before
2026-03-10T00:00:00Z, with the release tag preserved as an inline comment
for cross-reference (the comment is informational only — reviewers must
re-verify the SHA against the upstream release). Generated by running:
./scripts/security/list-external-actions \
| xargs ./scripts/security/resolve-action-ref \
| ./scripts/security/pin-gh-actions
Resolutions (all 15 external refs, ordered; every ref was on a mutable
tag prior to this change):
actions/cache@v4, v5 -> cdf6c1fa... # v5.0.3
actions/checkout@v5 -> de0fac2e... # v6.0.2 (major bump)
actions/deploy-pages@v4 -> d6db9016... # v4.0.5
actions/download-artifact@v5 -> 70fc10c6... # v8.0.0 (major bump)
actions/setup-java@v5 -> be666c2f... # v5.2.0
actions/setup-node@v4 -> 53b83947... # v6.3.0 (major bump)
actions/setup-python@v5 -> a309ff8b... # v6.2.0 (major bump)
actions/upload-artifact@v5 -> bbbca2dd... # v7.0.0 (major bump)
actions/upload-pages-artifact@v3-> 7b1f4a76... # v4.0.0 (major bump)
codecov/codecov-action@v5 -> 671740ac... # v5.5.2
github/codeql-action/*@v4 -> 0d579ffd... # v4.32.6
pypa/gh-action-pypi-publish@... -> ed0c5393... # v1.13.0
Major-version jumps are consistent with the policy ("latest release before
the cutoff") but carry breaking-change risk — reviewers should validate
each bump against the action's CHANGELOG before merge. In particular,
upload-artifact v4+ and download-artifact v4+ changed artifact immutability
semantics; the new versions may interact with the existing upload_artifacts
composite action in ways worth exercising under CI before unblocking.
Local composite action refs (./.github/actions/*) are unaffected —
they're first-party.
Co-authored-by: Isaac
* Scope non-exempt secrets to environment: runtime; disable release workflows
Databricks Labs Repository Lockdown policy requires any workflow using a
non-exempt secret (anything other than GITHUB_TOKEN or CODECOV_TOKEN) to
run inside a single protected GitHub Environment. GeoBrix uses
REPO_ACCESS_TOKEN (PAT fallback for private-repo checkout) across most
workflows, so every job that calls actions/checkout with that token now
sets `environment: runtime`.
Changes:
- Added `permissions: contents: read` at top level where missing
(codeql-analysis, publish-maven, release) and removed stray top-level
`id-token: write` from build_main / build_python / build_scala /
build_scala_by_package / codecov-scala-parallel / codecov-upload
(none of those jobs request OIDC tokens).
- deploy-docs: moved `pages: write` and `id-token: write` from top level
down to the deploy job only (least privilege). The build job keeps
`environment: runtime` for its REPO_ACCESS_TOKEN checkout; the deploy
job keeps its existing `environment: github-pages`.
- doc-tests: added `environment: runtime` on all three (currently
disabled) jobs that perform REPO_ACCESS_TOKEN checkouts, so they are
compliant when re-enabled.
- release.yml: changed `environment: release` -> `environment: runtime`
to converge on the single protected env the policy expects.
- release.yml + publish-maven.yml: DISABLED via `if: false` on their
publish jobs with a banner comment explaining the policy context and
how to re-enable. GeoBrix is not publishing to PyPI or GitHub Packages
from Actions today; we will coordinate with Labs before re-enabling.
Exempt secrets per policy (GITHUB_TOKEN, CODECOV_TOKEN) are untouched
and do not require the protected environment.
Co-authored-by: Isaac
* Add 7-day Dependabot cooldown; document github-actions ecosystem opt-out
Labs Repository Lockdown policy: every Dependabot ecosystem in the repo
must apply a cooldown so we are not the first adopters of a just-released
(possibly compromised) version. Applied `cooldown.default-days: 7` to both
maven and pip ecosystems.
The policy also excludes `github-actions` from Dependabot entirely — action
SHAs are refreshed manually via scripts/security/pin-gh-actions so bumps
are reviewed as part of the security workflow rather than as auto-opened
PRs. Added a comment documenting the intentional absence.
Co-authored-by: Isaac
* Pin base image digest; checksum-verify Hadoop/GDAL/Maven downloads
Databricks Labs Repository Lockdown policy requires all build-time binary
fetches to be integrity-verified and all base images to be pinned by
digest so a compromised registry/mirror cannot silently swap bytes.
Dockerfile changes:
- Pinned `FROM ubuntu:24.04` to the multi-arch manifest-list digest
`sha256:c4a8d5503dfb2a3eb8ab5f807da5bc69a85730fb49b5cfca2330194ebcc41c7b`
(kept `# ubuntu:24.04` comment for human readability).
- Hadoop 3.4.0 tarball: replaced `wget | tar` stream with
download -> sha512sum -c -> extract, using the official
HADOOP_SHA512 from downloads.apache.org/.sha512.
- GDAL 3.11.4 tarball: same pattern with a locally-computed SHA-256.
OSGeo only publishes MD5; we MD5-verified the upstream download
(9f4fa4b3be48fb60d5dd76fecb11a5f6) then computed and pinned SHA-256.
- Apache Maven 3.9.9: replaced the dynamic `.sha512` fetch (which reads
the checksum from the same origin as the tarball and therefore provides
no protection against origin compromise) with an in-Dockerfile pinned
MAVEN_SHA512 ARG, cross-checked against archive.apache.org.
scripts/util/install_hadoop.sh:
- Not referenced by the build; kept as a manual mirror of the Dockerfile
flow. Rewrote with `set -euo pipefail`, a pinned HADOOP_SHA512, and
`sha512sum -c` verification. Made executable.
Each checksum has a matching comment documenting the authoritative source
and the requirement to bump it in lockstep with the underlying version.
Co-authored-by: Isaac
* Pin PDAL to commit SHA; add origin-guard banner to disabled doc-tests jobs
Addresses review feedback on PR #19:
1. Pin PDAL 2.8.2 to commit SHA 736fa0a66af4bed7105dff5fa152edf26bbb8a3a.
Tags are mutable; switch the pdal-builder stage from `git clone -b <tag>`
to `git fetch --depth 1 origin <SHA>` + `git checkout FETCH_HEAD`.
New ARG PDAL_SHA is documented alongside PDAL_VERSION with the bump
procedure, matching the Hadoop/GDAL/Maven pattern.
2. Add a SECURITY banner above the `if: false` line on each disabled job
in doc-tests.yml (test-python-docs, test-scala-docs, validate-structure).
These jobs now bind environment: runtime (which scopes REPO_ACCESS_TOKEN);
combined with the workflow_run trigger and head_sha checkout used by two
of the three jobs, naively re-enabling would expose REPO_ACCESS_TOKEN to
fork-controlled code. Banner prescribes the required origin guard:
if: github.event.workflow_run.head_repository.full_name == github.repository
Banner also added to test-scala-docs since copy-paste from siblings is
the likely re-enable path.
Co-authored-by: Isaac
* Add CODEOWNERS pointing all paths at @databrickslabs/geobrix-write
Required by the Databricks Labs Repository Lockdown policy. Combined with
branch protection, the listed team must approve every PR before merge.
Pattern matches sibling labs repos (ucx, blueprint, dqx): root-level
CODEOWNERS with a single `*` rule pointing to the per-repo write team.
Co-authored-by: Isaac1 parent 5b95993 commit ab812cb
22 files changed
Lines changed: 539 additions & 75 deletions
File tree
- .github
- actions
- python_build
- scala_build
- upload_artifacts
- workflows
- scripts
- docker
- security
- util
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | | - | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
62 | | - | |
| 66 | + | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| |||
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
99 | | - | |
| 103 | + | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
| |||
113 | 117 | | |
114 | 118 | | |
115 | 119 | | |
116 | | - | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
121 | | - | |
| 125 | + | |
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| 17 | + | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | | - | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | | - | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
76 | | - | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
100 | | - | |
| 103 | + | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
0 commit comments