Skip to content

Commit cd2cab7

Browse files
aksOpsclaude
andauthored
ci: lift OSSF Scorecard score (3.7 → ~6.5+) (#18)
* checkpoint: pre-yolo 2026-04-22T23:48:23 * ci: lift OSSF Scorecard score (3.7 → ~6.5+) - Add SECURITY.md (Security-Policy 0→10) - Add .github/dependabot.yml for gomod, npm, actions (Dep-Update 0→10) - Add explicit CodeQL workflow with push trigger (SAST 0→10) - SHA-pin all actions in ci.yml, release.yml, scorecard.yml (Pinned-Dependencies 4→10) - Per-job permissions scoping (Token-Permissions 0→10) - Branch protection applied to main via API (Branch-Protection 3→10, configured out-of-band) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 42d091a commit cd2cab7

6 files changed

Lines changed: 165 additions & 19 deletions

File tree

.github/dependabot.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
day: monday
8+
time: "06:00"
9+
timezone: UTC
10+
open-pull-requests-limit: 5
11+
labels:
12+
- dependencies
13+
- go
14+
15+
- package-ecosystem: npm
16+
directory: /ui
17+
schedule:
18+
interval: weekly
19+
day: monday
20+
time: "06:00"
21+
timezone: UTC
22+
open-pull-requests-limit: 5
23+
labels:
24+
- dependencies
25+
- javascript
26+
groups:
27+
react:
28+
patterns:
29+
- react
30+
- react-dom
31+
- "@types/react*"
32+
dev-tooling:
33+
patterns:
34+
- vite
35+
- vitest
36+
- "@vitejs/*"
37+
- typescript
38+
- eslint*
39+
- "@eslint/*"
40+
- prettier
41+
d3:
42+
patterns:
43+
- "d3-*"
44+
- "@types/d3-*"
45+
46+
- package-ecosystem: github-actions
47+
directory: /
48+
schedule:
49+
interval: weekly
50+
day: monday
51+
time: "06:00"
52+
timezone: UTC
53+
open-pull-requests-limit: 5
54+
labels:
55+
- dependencies
56+
- ci

.github/workflows/ci.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ on:
55
branches: [main]
66
pull_request:
77

8-
permissions:
9-
contents: read
8+
permissions: read-all
109

1110
jobs:
1211
ui:
1312
name: ui (build + test + budget)
1413
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
1516
steps:
16-
- uses: actions/checkout@v6
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1718

18-
- uses: actions/setup-node@v6
19+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
1920
with:
2021
node-version: '22'
2122
cache: 'npm'
@@ -46,7 +47,7 @@ jobs:
4647
fi
4748
4849
- name: Upload ui/dist
49-
uses: actions/upload-artifact@v7
50+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
5051
with:
5152
name: ui-dist
5253
path: ui/dist
@@ -56,6 +57,8 @@ jobs:
5657
test:
5758
name: test (${{ matrix.os }})
5859
needs: ui
60+
permissions:
61+
contents: read
5962
strategy:
6063
fail-fast: false
6164
matrix:
@@ -64,9 +67,9 @@ jobs:
6467
env:
6568
CGO_ENABLED: "1"
6669
steps:
67-
- uses: actions/checkout@v6
70+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
6871

69-
- uses: actions/setup-go@v6
72+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
7073
with:
7174
go-version-file: go.mod
7275

@@ -75,7 +78,7 @@ jobs:
7578
run: clang --version
7679

7780
- name: Go build cache
78-
uses: actions/cache@v5
81+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
7982
with:
8083
path: |
8184
~/.cache/go-build
@@ -88,7 +91,7 @@ jobs:
8891
# Hydrate ui/dist with the build artifact produced by the `ui` job so
8992
# the //go:embed ui/dist directive has real assets to embed.
9093
- name: Download ui/dist
91-
uses: actions/download-artifact@v8
94+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
9295
with:
9396
name: ui-dist
9497
path: ui/dist
@@ -103,7 +106,7 @@ jobs:
103106
run: CGO_ENABLED=1 go build -tags sqlite_fts5 -o docsiq ./
104107

105108
- name: Upload docsiq binary
106-
uses: actions/upload-artifact@v7
109+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
107110
with:
108111
name: docsiq-${{ matrix.os }}
109112
path: docsiq
@@ -114,23 +117,25 @@ jobs:
114117
name: integration tests (-race)
115118
needs: ui
116119
runs-on: ubuntu-latest
120+
permissions:
121+
contents: read
117122
steps:
118-
- uses: actions/checkout@v6
123+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
119124

120-
- uses: actions/setup-go@v6
125+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
121126
with:
122127
go-version-file: go.mod
123128

124129
- name: cache go build
125-
uses: actions/cache@v5
130+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
126131
with:
127132
path: |
128133
~/.cache/go-build
129134
~/go/pkg/mod
130135
key: go-integ-${{ hashFiles('go.sum') }}
131136

132137
- name: Download ui/dist
133-
uses: actions/download-artifact@v8
138+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
134139
with:
135140
name: ui-dist
136141
path: ui/dist

.github/workflows/codeql.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '0 5 * * 1'
10+
11+
permissions: read-all
12+
13+
jobs:
14+
analyze:
15+
name: Analyze (${{ matrix.language }})
16+
runs-on: ubuntu-latest
17+
permissions:
18+
security-events: write
19+
packages: read
20+
actions: read
21+
contents: read
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
include:
27+
- language: go
28+
build-mode: autobuild
29+
- language: javascript-typescript
30+
build-mode: none
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
35+
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@ce64ddcb0d8d890d2df4a9d1c04ff297367dea2a # v3
38+
with:
39+
languages: ${{ matrix.language }}
40+
build-mode: ${{ matrix.build-mode }}
41+
queries: security-extended
42+
43+
- name: Perform CodeQL Analysis
44+
uses: github/codeql-action/analyze@ce64ddcb0d8d890d2df4a9d1c04ff297367dea2a # v3
45+
with:
46+
category: "/language:${{ matrix.language }}"

.github/workflows/release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ on:
66
push:
77
branches: [main]
88

9-
permissions:
10-
contents: write
9+
permissions: read-all
1110

1211
concurrency:
1312
group: release-main
@@ -17,8 +16,10 @@ jobs:
1716
release:
1817
name: auto-tag + release
1918
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
2021
steps:
21-
- uses: actions/checkout@v6
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2223
with:
2324
fetch-depth: 0
2425

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: checkout
24-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2525
with:
2626
persist-credentials: false
2727

@@ -33,7 +33,7 @@ jobs:
3333
publish_results: true
3434

3535
- name: upload artifact
36-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
36+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
3737
with:
3838
name: scorecard-results
3939
path: results.sarif

SECURITY.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
Please report security vulnerabilities via GitHub's
6+
[private vulnerability reporting](https://github.com/RandomCodeSpace/docsiq/security/advisories/new).
7+
8+
Do **not** open a public issue for security reports.
9+
10+
We aim to acknowledge reports within 72 hours and provide a remediation
11+
plan within 7 days of triage.
12+
13+
## Scope
14+
15+
In scope:
16+
17+
- The `docsiq` binary and all Go packages under `internal/` and `cmd/`
18+
- The embedded React SPA in `ui/`
19+
- The MCP server and REST API exposed by `docsiq serve`
20+
- Build, release, and CI workflows under `.github/`
21+
22+
Out of scope:
23+
24+
- Third-party LLM providers (Azure OpenAI, OpenAI, Ollama) — report
25+
upstream
26+
- Vulnerabilities that require a compromised local shell or filesystem
27+
access
28+
29+
## Supported Versions
30+
31+
docsiq is pre-1.0. Only the latest `v0.0.0-beta.N` prerelease receives
32+
security patches.
33+
34+
## Disclosure
35+
36+
We follow coordinated disclosure. Once a fix ships in a release, we
37+
publish a [GitHub Security Advisory](https://github.com/RandomCodeSpace/docsiq/security/advisories)
38+
crediting the reporter unless they request anonymity.

0 commit comments

Comments
 (0)