From 2a1282ffec56ee28444b0674de41c11b8e0986d0 Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Sat, 23 Oct 2021 20:25:03 +0100 Subject: [PATCH] Audit only production dependencies Security checks have been failing for months due to Vue CLI dependencies and lack of resolution from the developers. This commit makes auditing ignore development dependencies. The reasons include: - Vulnerabilities in developer dependencies cause pipelines to fail on every run. - This is caused by dependencies such that lack resolution from the developers. Vue developers consider `npm audit` broken design and do not prioritize solutions. Discussions: vuejs/vue-cli#6637, vuejs/vue-cli#6621, vuejs/vue-cli#6555, vuejs/vue-cli#6553, vuejs/vue-cli#6523, vuejs/vue-cli#6486. - Development packages are not relevant for the production payload. - False positives create behavior of ignoring them completely instead of taking action, which creates a security vulnerability itself. `npm audit --omit=dev` is used instead of `npm audit --production` which is deprecated as of npm v8.7.0 npm/cli#4744. --- .github/workflows/checks.security.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.security.yaml b/.github/workflows/checks.security.yaml index 4d03041a2..943993cd2 100644 --- a/.github/workflows/checks.security.yaml +++ b/.github/workflows/checks.security.yaml @@ -19,4 +19,4 @@ jobs: uses: ./.github/actions/setup-node - name: NPM audit - run: exit "$(npm audit)" # Since node 15.x, it does not fail with error if we don't explicitly exit + run: exit "$(npm audit --omit=dev)" # Since Node 15.x, it does not fail with error if we don't explicitly exit