Skip to content

Commit 0b7d209

Browse files
Fix security review findings: runners, DCO, CODEOWNERS, SECURITY.md (#340)
## Summary Follow-up to #329 — the squash merge lost the second commit with these fixes. - Switch all workflows back to `ubuntu-latest` (GitHub-hosted runners) to avoid executing fork PR code on Databricks infrastructure - Fix DCO check to not checkout attacker-controlled fork code — uses the default `pull_request` merge ref (which already contains all PR commits) instead of explicitly checking out the fork's `head.ref`/`head.repo` - Move `BASE_SHA`/`HEAD_SHA` to `env:` vars to prevent script injection via crafted commit SHAs - Add CODEOWNERS requiring `@databricks/eng-oss-sql-driver` review for `.github/` changes - Add SECURITY.md vulnerability disclosure policy ## Security findings addressed - **High**: Self-hosted runners on public repo allow fork PRs to execute on org infrastructure → `ubuntu-latest` - **High**: DCO check explicitly checks out attacker-controlled fork code on runner → default merge ref - **Medium**: No CODEOWNERS for `.github/workflows/` → added - **Medium**: No SECURITY.md → added ## Test plan - [ ] Verify DCO check passes for signed commits - [ ] Verify DCO check fails for unsigned commits - [ ] Verify CI runs on GitHub-hosted runners This pull request was AI-assisted by Isaac. Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
1 parent ec57988 commit 0b7d209

File tree

4 files changed

+28
-39
lines changed

4 files changed

+28
-39
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Require review from eng-oss-sql-driver for CI/CD workflow changes
2+
.github/ @databricks/eng-oss-sql-driver

.github/workflows/dco-check.yml

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,24 @@ permissions:
1010

1111
jobs:
1212
dco-check:
13-
runs-on:
14-
group: databricks-protected-runner-group
15-
labels: [linux-ubuntu-latest]
13+
runs-on: ubuntu-latest
1614
name: Check DCO Sign-off
1715
steps:
1816
- name: Checkout
1917
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2018
with:
2119
fetch-depth: 0
22-
ref: ${{ github.event.pull_request.head.ref }}
23-
repository: ${{ github.event.pull_request.head.repo.full_name }}
24-
25-
- name: Add upstream remote (for forks)
26-
run: |
27-
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
28-
echo "This is a fork, adding upstream remote"
29-
git remote add upstream https://github.com/${{ github.repository }}.git
30-
git fetch upstream ${{ github.event.pull_request.base.ref }}
31-
else
32-
echo "This is not a fork, using origin"
33-
fi
3420

3521
- name: Check DCO Sign-off
22+
env:
23+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
24+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
3625
run: |
3726
#!/bin/bash
3827
set -e
3928
40-
BASE_SHA="${{ github.event.pull_request.base.sha }}"
41-
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
42-
4329
echo "Checking commits from $BASE_SHA to $HEAD_SHA"
4430
45-
if ! git cat-file -e "$BASE_SHA" 2>/dev/null; then
46-
echo "Error: Base commit $BASE_SHA not found"
47-
echo "Trying to fetch from upstream..."
48-
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
49-
git fetch upstream ${{ github.event.pull_request.base.ref }}
50-
else
51-
git fetch origin ${{ github.event.pull_request.base.ref }}
52-
fi
53-
fi
54-
55-
if ! git cat-file -e "$HEAD_SHA" 2>/dev/null; then
56-
echo "Error: Head commit $HEAD_SHA not found"
57-
exit 1
58-
fi
59-
6031
COMMITS=$(git rev-list --no-merges "$BASE_SHA..$HEAD_SHA")
6132
6233
if [ -z "$COMMITS" ]; then

.github/workflows/go.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ permissions:
1212
jobs:
1313
lint:
1414
name: Lint
15-
runs-on:
16-
group: databricks-protected-runner-group
17-
labels: [linux-ubuntu-latest]
15+
runs-on: ubuntu-latest
1816

1917
steps:
2018
- name: Check out code into the Go module directory
@@ -36,9 +34,7 @@ jobs:
3634
matrix:
3735
go-version: [1.20.x]
3836
os: [ubuntu-latest]
39-
runs-on:
40-
group: databricks-protected-runner-group
41-
labels: [linux-ubuntu-latest]
37+
runs-on: ubuntu-latest
4238

4339
steps:
4440
- name: Check out code into the Go module directory

SECURITY.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
If you discover a security vulnerability in this project, please report it responsibly.
6+
7+
**Do not open a public GitHub issue for security vulnerabilities.**
8+
9+
Instead, please report security issues by emailing [security@databricks.com](mailto:security@databricks.com).
10+
11+
Please include:
12+
- A description of the vulnerability
13+
- Steps to reproduce the issue
14+
- Any potential impact
15+
16+
We will acknowledge receipt within 3 business days and aim to provide a resolution timeline within 10 business days.
17+
18+
## Supported Versions
19+
20+
Security updates are applied to the latest release only.

0 commit comments

Comments
 (0)