Skip to content

ci: address the OpenSSF Scorecard findings - #19

Merged
AlexMultiAgent merged 1 commit into
mainfrom
ci/scorecard-hardening
Nov 23, 2026
Merged

AlexMultiAgent merged 1 commit into
mainfrom
ci/scorecard-hardening

Conversation

@AlexMultiAgent

Copy link
Copy Markdown
Owner

The OSSF Scorecard workflow added in #17 now publishes its results, so the findings it reports have to be fixed rather than deferred. This PR addresses the License, Security-Policy, Token-Permissions and Pinned-Dependencies checks, and adds the Scorecard badge.

What changed

License (0/10)

VSC-plugin-MD2Docx-Converter/package.json declares "license": "MIT", but the repository had no root LICENSE file.

  • Added LICENSE at the repository root — the standard MIT text with Copyright (c) 2026 AlexMultiAgent.
  • VSC-plugin-MD2Docx-Converter/LICENSE already existed and was left untouched. It is the pre-existing file, byte-identical to the new root one.
  • dify-plugin-MD2Docx/LICENSE was added — that subdirectory had none, and the .difypkg is a separately distributed package, so it now carries its own license. All three LICENSE files are byte-identical.
  • No .vscodeignore / .difyignore change was needed: vsce package runs inside VSC-plugin-MD2Docx-Converter/ and scripts/package.py walks dify-plugin-MD2Docx/, so the new root LICENSE and SECURITY.md are outside both packaging roots and cannot leak into the VSIX or the .difypkg. Verified with vsce ls (45 entries, no SECURITY.md) and with a fresh python scripts/package.py build (29 entries, containing the plugin's own LICENSE, no SECURITY.md).

Security-Policy (0/10)

Added SECURITY.md (48 lines) at the repository root:

  • Reporting route: GitHub private vulnerability reporting — https://github.com/AlexMultiAgent/mdocx-converter/security/advisories/new.
  • No email address is listed. VSC-plugin-MD2Docx-Converter/package.json declares no email, so none was invented. (dify-plugin-MD2Docx/manifest.yaml does carry a marketplace contact: address; it was deliberately not copied into SECURITY.md — it is Dify marketplace metadata, not the security contact for this repository.)
  • Free-form prose on what counts as a vulnerability in this project (sandbox escape, path traversal, the Mermaid Ink URL filter, injection, reliable crashes) and what does not (rendering differences, missing features, third-party services).
  • Disclosure timeline with concrete numbers: acknowledge within 7 days, publish a fix or advisory within 90 days.
  • Supported versions: both products share one version line, currently 0.5.0 (read from VSC-plugin-MD2Docx-Converter/package.json and dify-plugin-MD2Docx/manifest.yaml; no version was bumped).

Token-Permissions (9/10 → fixed)

.github/workflows/codeql.yml:

  • The workflow-level permissions: block is now read-only — contents: read, actions: read, packages: read. security-events: write was removed from it.
  • The analyze job now carries its own permissions: block with the three read permissions plus security-events: write. Job-level permissions replace workflow-level ones in GitHub Actions, so the read permissions are repeated there. The CodeQL action only needs the write permission on its own job.

.github/workflows/ci.yml — every job was inspected individually:

Job Pushes / creates a release / uploads release assets? Permission
dify-plugin No — builds the .difypkg and uploads it with actions/upload-artifact contents: read
vsc-plugin No — npm run package is vsce package --allow-missing-repository (a local .vsix, no publish); the upload is actions/upload-artifact contents: read
template-sync No contents: read
preset-parity No contents: read
dependency-audit No contents: read

None of them writes to the repository, so all five now declare permissions: contents: read explicitly. The .difypkg and the .vsix leave the workflow through the Actions artifact API, not the repository contents API, so they do not need write access. The workflow-level contents: read was already in place and is unchanged.

Pinned-Dependencies

Every uses: in .github/workflows/ci.yml and .github/workflows/codeql.yml is now pinned to a full 40-character commit SHA with the version in a trailing # vX.Y.Z comment. Each SHA was resolved with git ls-remote <repo> refs/tags/<tag> refs/tags/<tag>^{} and the peeled commit was used — github/codeql-action tags are annotated, so the tag-object SHA (e0462179… for v4.39.4) differs from the commit SHA (1bd86f2f…) and the latter is the correct one to pin.

Every SHA was re-resolved and compared against the committed file content after the edit; all 20 pinned uses: in the three workflows match (17 in the two files touched here, plus the 4 pre-existing pins in scorecard.yml, re-verified for good measure).

Badge

Added the OpenSSF Scorecard badge directly below the H1 in README.md (the README had no badge row).

What was deliberately left alone

  • .github/workflows/scorecard.yml — it was already pinned and already had the correct read-only workflow-level permissions: {} with the writes scoped to the job. No change.
  • The generated templates under multi-templates/, VSC-plugin-MD2Docx-Converter/src/profiles.ts and the Dify plugin sources — untouched. The template sync and preset parity gates still pass.
  • The published versions — 0.5.0 was read, not bumped.
  • Repository settings — no branch protection, no security or other repository settings were changed.

Known remaining findings (out of scope for this PR)

Packaging, Code-Review, Signed-Releases, CII-Best-Practices, Fuzzing, Contributors, SAST.

The Scorecard workflow now publishes its results, so the findings it reports have to be fixed instead of deferred.

- License: add the MIT LICENSE at the repository root. The VS Code extension already carried one and was left untouched; the Dify plugin had none and got the same file, so the .difypkg carries its license too.

- Security-Policy: add SECURITY.md with the private vulnerability reporting route, what counts as a vulnerability in this project, the disclosure timeline and the supported versions (0.5.0, the shared version line of both products).

- Token-Permissions: move security-events: write from the workflow level to the CodeQL analyze job, and give each CI job an explicit contents: read. None of the five CI jobs pushes a commit, creates a release or uploads release assets, so they all stay read-only.

- Pinned-Dependencies: pin every uses: in ci.yml and codeql.yml to a full commit SHA with the version in a trailing comment. The SHAs are the peeled commit of the tag, not the tag object.

- Add the OpenSSF Scorecard badge to the README.

Known remaining findings, left for a follow-up: Packaging, Code-Review, Signed-Releases, CII-Best-Practices, Fuzzing, Contributors, SAST.
@AlexMultiAgent
AlexMultiAgent merged commit ee73c4e into main Nov 23, 2026
11 checks passed
@AlexMultiAgent
AlexMultiAgent deleted the ci/scorecard-hardening branch November 23, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant