Skip to content

Commit e435756

Browse files
fix(security): source-fixes for CodeQL #2 + Scorecard #296 (#120)
Resolves 2 of the 7 alerts listed in the Security tab cluster: | Alert | Type | Action | |---|---|---| | **#2** Workflow-permissions | CodeQL | boj-build.yml had unresolved merge-conflict markers in main, mis-located permissions: (after jobs:), and a malformed curl payload. Fixed all three + added concurrency + per-job permissions: contents: read + safer env-var-based jq payload. | | **#296** BinaryArtifacts | Scorecard | 13KB ELF binary committed at bindings/ephapax/test_ffi (commit d2a2ded). Deleted; extended .gitignore to prevent recurrence. | **Not in this PR** (separate workstreams required): - #295 BranchProtectionID — repo-settings change via gh api PUT, no file diff - #297 CodeReviewID — historical metric (0/30 approved reviews on existing PRs); improves on policy + going-forward - #298 CIIBestPracticesID — external OpenSSF badge registration at bestpractices.coreinfrastructure.org - #299 FuzzingID — needs ClusterFuzzLite scaffolding (separate substantial PR) - #300 CITestsID — historical metric (15/28); improves naturally as new PRs land with CI 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent eff75e5 commit e435756

3 files changed

Lines changed: 37 additions & 8 deletions

File tree

.github/workflows/boj-build.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
11
# SPDX-License-Identifier: MPL-2.0
22
name: BoJ Server Build Trigger
3+
34
on:
45
push:
56
branches: [main, master]
67
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
716
jobs:
817
trigger-boj:
918
runs-on: ubuntu-latest
19+
timeout-minutes: 5
20+
permissions:
21+
contents: read
1022
steps:
1123
- name: Checkout
12-
<<<<<<< HEAD
13-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
14-
=======
1524
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
16-
>>>>>>> chore/cicd-optimizations
25+
1726
- name: Trigger BoJ Server (Casket/ssg-mcp)
27+
env:
28+
REPO: ${{ github.repository }}
29+
BRANCH: ${{ github.ref_name }}
1830
run: |
19-
# Send a secure trigger to boj-server to build this repository
20-
curl -X POST "http://boj-server.local:7700/cartridges/ssg-mcp/invoke" -H "Content-Type: application/json" -d "{\"repo\": \"${{ github.repository }}\", \"branch\": \"${{ github.ref_name }}\", \"engine\": \"casket\\"}"}
31+
# Send a secure trigger to boj-server to build this repository.
32+
# Payload values are passed via env vars rather than ${{ }}
33+
# interpolation to avoid shell-injection by branch name.
34+
payload=$(jq -nc \
35+
--arg repo "$REPO" \
36+
--arg branch "$BRANCH" \
37+
'{repo: $repo, branch: $branch, engine: "casket"}')
38+
curl -X POST "https://boj-server.local:7700/cartridges/ssg-mcp/invoke" \
39+
-H "Content-Type: application/json" \
40+
-d "$payload"
2141
continue-on-error: true
22-
permissions:
23-
contents: read

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,14 @@ _build/
202202
deps/
203203
.elixir_ls/
204204
.cache/
205+
206+
# Compiled binaries (test_ffi, etc.) — these were getting committed
207+
# from local FFI testing. The actual built artefacts live in build/ or
208+
# target/ and the C-ABI smoke binaries should never enter git.
209+
bindings/*/test_ffi
210+
bindings/*/test_*
211+
bindings/**/*.o
212+
bindings/**/*.so
213+
bindings/**/*.dylib
214+
bindings/**/*.dll
215+
bindings/**/a.out

bindings/ephapax/test_ffi

-13.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)