dependency-security-scanning: a scanner in a GitHub Actions workflow is not seen (gate files are a list of its own)

Open
#563 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, typescript
Domain
ci-cd, security

Research direction

Start with GATE_FILES in src/laws/dependency-scanning/vulnerability-checker/services/vulnerability-checker-analysis.service.ts (lines 88-98) and hasScannerInGate in the same service. Check how the shared CI discovery used by the other CI laws finds .github/workflows/*.yml and whether it can feed this check. Done when the workflow example with npm audit --omit=dev passes, a workflow without a scanner step still fails, and existing package.json and Makefile detections are unchanged.

Written by the indexing model from the issue text.

Description

bug

Version: 8.0.1 (tag v8.0.1)
Law: dependency-security-scanning (Dependency Security Scanning), "is a dependency scanner wired into the gate": VulnerabilityCheckerAnalysisService.hasScannerInGate

What happens

The law looks for a scanner (npm audit, pip-audit, Snyk, OSV, Dependabot…) in a fixed list of gate files, GATE_FILES (src/laws/dependency-scanning/vulnerability-checker/services/vulnerability-checker-analysis.service.ts:88-98): package.json, pyproject.toml, .pre-commit-config.yaml, Makefile, noxfile.py, tox.ini, bitbucket-pipelines.yml, .gitlab-ci.yml, .github/dependabot.yml|yaml. GitHub Actions workflows (.github/workflows/*.yml|yaml) are not in it, nor are other CI files the tool already discovers elsewhere.

Reproduction

A project whose only gate is a GitHub Actions workflow:

name: ci
on: [push]
jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm audit --omit=dev

laws.enabled { "Dependency Security Scanning": true }:

1. Dependency Security Scanning [1 violations] (Score: 90/100)
   • Security audit configuration missing

What I ruled out

The same npm audit --omit=dev line in package.json scripts or a Makefile is recognised; only the file it is in differs.

Why it matters

GitHub Actions is the most common place for the scanner the law asks for, and after #545 judging the scanner in the gate is what this law does. A project with the scanner wired in is told it has none.

Suggested direction

Read the CI files through the shared CI discovery the other CI laws use (GitHub Actions, GitLab, Bitbucket, Azure Pipelines, CircleCI, Jenkinsfile, Cloud Build), not a list of its own, so a CI system the tool learns about is learned once. Red/green: the workflow above passes; a workflow without a scanner step does not.

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
2h 36m
Merged PRs (30d)
168

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rule-Of-Code/RoC

All issues in Rule-Of-Code/RoC

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.