@@ -107,6 +107,7 @@ Install dependencies:
107107
108108```
109109pip install -r requirements.txt
110+ pip install -e .
110111```
111112
112113---
@@ -116,7 +117,7 @@ pip install -r requirements.txt
1161171 . Run with SARIF and policy:
117118
118119``` bash
119- python -m secscore.cli.main pr \
120+ secscore pr \
120121 --sarif tests/fixtures/review.sarif \
121122 --policy policy/policy-pr.yml \
122123 --no-diff-aware
@@ -125,11 +126,12 @@ python -m secscore.cli.main pr \
1251262 . Check outputs:
126127- ` pr-comment.md ` (PR-ready markdown summary)
127128- ` secscore-result.json ` (structured result)
129+ - Optional: ` secscore-report.html ` (visual report generated when ` --html-output true ` )
128130
1291313 . Optional: submit result to M.A.R.I.A:
130132
131133``` bash
132- python -m secscore.cli.main pr \
134+ SECSCORE_ALLOW_PRIVATE_MARIA_URLS=true secscore pr \
133135 --sarif tests/fixtures/review.sarif \
134136 --policy policy/policy-pr.yml \
135137 --maria-url http://localhost:5213/api/secscore/submissions \
@@ -147,7 +149,7 @@ Use these commands to validate expected outcomes quickly:
147149### PASS
148150
149151``` bash
150- python -m secscore.cli.main pr \
152+ secscore pr \
151153 --sarif tests/fixtures/pass.sarif \
152154 --policy policy/policy-pr.yml \
153155 --no-diff-aware
@@ -158,7 +160,7 @@ Expected: `Decision: PASS`
158160### REVIEW
159161
160162``` bash
161- python -m secscore.cli.main pr \
163+ secscore pr \
162164 --sarif tests/fixtures/review.sarif \
163165 --policy policy/policy-pr.yml \
164166 --no-diff-aware
@@ -169,7 +171,7 @@ Expected: `Decision: REVIEW`
169171### FAIL
170172
171173``` bash
172- python -m secscore.cli.main pr \
174+ secscore pr \
173175 --sarif tests/fixtures/fail.sarif \
174176 --policy policy/policy-pr.yml \
175177 --no-diff-aware
@@ -194,7 +196,7 @@ Expected: `Decision: FAIL`
194196Single SARIF file:
195197
196198```
197- python -m secscore.cli.main pr \
199+ secscore pr \
198200 --sarif examples/example-snyk.sarif \
199201 --policy policy/policy-pr.yml \
200202 --no-diff-aware
@@ -203,7 +205,7 @@ python -m secscore.cli.main pr \
203205Multiple SARIF files (v0.3.0+):
204206
205207```
206- python -m secscore.cli.main pr \
208+ secscore pr \
207209 --sarif semgrep.sarif,trivy.sarif \
208210 --policy policy/policy-pr.yml \
209211 --no-diff-aware
@@ -212,7 +214,7 @@ python -m secscore.cli.main pr \
212214Send consolidated findings to M.A.R.I.A (token provided at invocation):
213215
214216``` bash
215- python -m secscore.cli.main pr \
217+ secscore pr \
216218 --sarif semgrep.sarif,trivy.sarif \
217219 --policy policy/policy-pr.yml \
218220 --maria-url https://demo.mariaappsec.com/api/secscore/submissions \
@@ -226,10 +228,18 @@ For `/api/secscore/submissions`, SecScore auto-fills required submission fields
226228You can override them with:
227229` --maria-submission-key ` , ` --maria-commit-sha ` , ` --maria-branch-name ` , ` --maria-pipeline-name ` , ` --maria-pipeline-run-id ` , ` --maria-pull-request-id ` .
228230
231+ ### M.A.R.I.A policy import behavior
232+
233+ - When M.A.R.I.A integration is configured (` --maria-url ` , ` --maria-repository-id ` , ` --token ` /` --maria-token ` ),
234+ SecScore imports policy from M.A.R.I.A by default.
235+ - The imported policy is saved on every run to ` policy/policy-maria.yml ` .
236+ - The execution then uses ` policy/policy-maria.yml ` as the effective policy.
237+ - Use ` --maria-import-policy false ` to keep using the local policy file from ` --policy ` .
238+
229239For local PR testing without opening a real PR:
230240
231241``` bash
232- SECSCORE_PULL_REQUEST_ID=local-pr-001 python -m secscore.cli.main pr \
242+ SECSCORE_ALLOW_PRIVATE_MARIA_URLS=true SECSCORE_PULL_REQUEST_ID=local-pr-001 secscore pr \
233243 --sarif semgrep.sarif \
234244 --policy policy/policy-pr.yml \
235245 --maria-url http://localhost:5213/api/secscore/submissions \
@@ -252,10 +262,36 @@ Score: 85 / 100
252262Decision: PASS
253263```
254264
265+ Generate a visual HTML report from the standard JSON output:
266+
267+ ``` bash
268+ secscore pr \
269+ --sarif tests/fixtures/review.sarif \
270+ --policy policy/policy-pr.yml \
271+ --no-diff-aware \
272+ --html-output true
273+ ```
274+
275+ The JSON result is always generated. When HTML output is enabled, SecScore also writes
276+ ` secscore-report.html ` by default. Use ` --html-out custom-report.html ` to choose another path.
277+
255278---
256279
257280## GitHub Action
258281
282+ Recommended workflow permissions:
283+
284+ ``` yaml
285+ permissions :
286+ contents : read
287+ checks : write
288+ pull-requests : write
289+ issues : write
290+ ` ` `
291+
292+ SecScore needs ` contents: read` to access the repository, `checks: write` to create the status check,
293+ and `issues : write`/`pull-requests: write` to upsert PR comments and manage the review label.
294+
259295Minimal example :
260296
261297` ` ` yaml
@@ -281,6 +317,24 @@ Multiple scanners (v0.3.0+):
281317 maria-token: ${{ secrets.MARIA_TOKEN }}
282318` ` `
283319
320+ Generate and publish the HTML report as a workflow artifact :
321+
322+ ` ` ` yaml
323+ - name: Run SecScore
324+ uses: cassiodeveloper/secscore@v1
325+ with:
326+ sarif: results.sarif
327+ html_output: "true"
328+
329+ - name: Upload SecScore report
330+ uses: actions/upload-artifact@v4
331+ with:
332+ name: secscore-report
333+ path: |
334+ secscore-result.json
335+ secscore-report.html
336+ ` ` `
337+
284338Disable diff-aware :
285339
286340` ` ` yaml
0 commit comments