Skip to content

Commit 8286b05

Browse files
committed
fix(security): address Copilot/coderabbit review on PR #140
- src/ledgerbase/__init__.py: read LEDGERBASE_ENV in addition to the Flask 3.x-deprecated FLASK_ENV when selecting prod vs dev, and document the choice. Avoids silently treating a misconfigured production deploy as dev when only one of the variables is set. - src/ledgerbase/config.py: drop the dead ProductionConfig.__init__ (Flask's from_object does not instantiate). Move the check into a module-level validate_production_env() and call it from get_config() so the fail-fast actually runs. - All workflows: re-pin step-security/harden-runner from v2.10.1 (which was a downgrade from the prior v2.12 reference) to v2.12.0 (SHA 0634a2670c59f64b4a01f0f96f84700a4088b9f0). - .github/workflows/cifuzzy.yml: correct the inline note so it reflects the actual egress-policy (audit) and points at the follow-up to tighten to block. - SECURITY-FINDINGS.md: update SHA table to v2.12.0; add `bash` language tag on the fenced grep example (markdownlint MD040). Skipped — pre-existing issues on `main`, not regressions from this PR and outside the audit scope: - .github/workflows/security-bandit.yml step mixing `run:` and `uses:`. - .github/workflows/templates/test-matrix.yml coverage.xml not passed between jobs. - Code Quality format failures in 7 unrelated repo-root files (docs/source/conf.py, load_env.py, noxfile.py, scripts/*.py, vulture_whitelist.py) — already failing on `main` before this PR. - FIPS Compliance / CodeQL / Python Compat / submit-pypi job-level failures: workflows expect uv.lock which the repo doesn't have (only poetry.lock). Pre-existing infrastructure mismatch.
1 parent a4c5714 commit 8286b05

35 files changed

Lines changed: 75 additions & 52 deletions

.github/workflows/auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- name: Harden the runner (Audit all outbound calls)
35-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
35+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
3636
with:
3737
egress-policy: audit
3838

.github/workflows/cifuzzy.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
security-events: write
3838
steps:
3939
- name: Harden runner (audit outbound)
40-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
40+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
4141
with:
4242
egress-policy: audit
4343

@@ -47,8 +47,11 @@ jobs:
4747
- name: Build Fuzzers
4848
id: build
4949
# NOTE: google/oss-fuzz publishes CIFuzz actions only on the `master`
50-
# branch; no immutable SHA is available upstream. See SECURITY-FINDINGS.md
51-
# GHA-006 for the mitigation plan (run inside a hardened, egress-blocked job).
50+
# branch; no immutable SHA is available upstream. The job runs with
51+
# step-security/harden-runner in `egress-policy: audit` so any
52+
# unexpected outbound calls show up in the run summary. See
53+
# SECURITY-FINDINGS.md GHA-006 — tighten to `block` with an
54+
# allow-list once the audit run is reviewed.
5255
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
5356
with:
5457
oss-fuzz-project-name: "ledgerbase"

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
steps:
3636
- name: Harden the runner
37-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
37+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
3838
with:
3939
egress-policy: audit
4040

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- name: Harden the runner (Audit all outbound calls)
33-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
33+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
3434
with:
3535
egress-policy: audit
3636

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: Harden the runner (Audit all outbound calls)
39-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
39+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
4040
with:
4141
egress-policy: audit
4242

.github/workflows/dev-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
versions: ${{ steps.load.outputs.versions }}
4242
steps:
4343
- name: Harden the runner (Audit all outbound calls)
44-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
44+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
4545
with:
4646
egress-policy: audit
4747

.github/workflows/fips-compatibility.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Harden the runner (Audit all outbound calls)
51-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
51+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
5252
with:
5353
egress-policy: audit
5454

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
steps:
4444
- name: Harden the runner (Audit all outbound calls)
45-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
45+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
4646
with:
4747
egress-policy: audit
4848

.github/workflows/license.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ubuntu-latest
4848
steps:
4949
- name: Harden the runner (Audit all outbound calls)
50-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
50+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
5151
with:
5252
egress-policy: audit
5353

@@ -77,7 +77,7 @@ jobs:
7777
runs-on: ubuntu-latest
7878
steps:
7979
- name: Harden the runner (Audit all outbound calls)
80-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
80+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
8181
with:
8282
egress-policy: audit
8383

.github/workflows/prepare-poetry.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
steps:
4242
- name: Harden the runner (Audit all outbound calls)
43-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
43+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
4444
with:
4545
egress-policy: audit
4646

0 commit comments

Comments
 (0)