Skip to content

Commit 1d843e5

Browse files
authored
Merge pull request #540 from Fryguy/add_security_test
Add npm audit security tests
2 parents 36bb3d0 + 40be0aa commit 1d843e5

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
run: bin/setup
2323
- name: Run tests
2424
run: bin/ci
25+
- name: Run security tests
26+
run: yarn test:security
2527
- name: Report code coverage
2628
if: "${{ github.ref == 'refs/heads/master' }}"
2729
continue-on-error: true

.yarnrc.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,16 @@ enableGlobalCache: true
44

55
nodeLinker: node-modules
66

7+
npmAuditExcludePackages:
8+
- angular
9+
# pending | high | GHSA-4w4v-5hc9-xrr2 | angular >=1.3.0 <=1.8.3 | 1.8.3 brought in by angular-bootstrap-switch@npm:0.5.2
10+
# pending | moderate | GHSA-2qqx-w9hr-q5gx | angular <=1.8.3 | 1.8.3 brought in by angular-bootstrap-switch@npm:0.5.2
11+
# pending | moderate | GHSA-2vrf-hf26-jrp5 | angular <=1.8.3 | 1.8.3 brought in by angular-bootstrap-switch@npm:0.5.2
12+
# pending | moderate | GHSA-m2h2-264f-f486 | angular >=1.7.0 | 1.8.3 brought in by angular-bootstrap-switch@npm:0.5.2
13+
# pending | moderate | GHSA-prc3-vjfx-vhm9 | angular <=1.8.3 | 1.8.3 brought in by angular-bootstrap-switch@npm:0.5.2
14+
# pending | moderate | GHSA-qwqh-hm9m-p5hr | angular <=1.8.3 | 1.8.3 brought in by angular-bootstrap-switch@npm:0.5.2
15+
# pending | low | GHSA-j58c-ww9w-pwp5 | angular <=1.8.3 | 1.8.3 brought in by angular-bootstrap-switch@npm:0.5.2
16+
# pending | low | GHSA-m9gf-397r-hwpg | angular >=1.3.0-rc.4 <=1.8.3 | 1.8.3 brought in by angular-bootstrap-switch@npm:0.5.2
17+
# pending | low | GHSA-mqm9-c95h-x2p6 | angular <=1.8.3 | 1.8.3 brought in by angular-bootstrap-switch@npm:0.5.2
18+
719
yarnPath: .yarn/releases/yarn-4.11.0.cjs

Rakefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Import the rake tasks from manageiq core.
2+
#
3+
# HACK: Since we don't have a proper symlink relationship to core like we do
4+
# with other plugins, we have to resort to assuming a sibling directory
5+
# similar to what we do in config/webpack.dev.js.
6+
namespace :app do
7+
load File.join(__dir__, "../manageiq/lib/tasks/test_security.rake")
8+
end
9+
10+
desc "Rebuild yarn audit pending list"
11+
task :rebuild_yarn_audit_pending do
12+
ENV["ENGINE_ROOT"] = __dir__
13+
Rake::Task["app:test:security:rebuild_yarn_audit_pending"].invoke
14+
end

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"gettext:extract": "yarn run build && angular-gettext-cli --files './+(src|dist)/**/+(*.html|ui-components.js)' --dest './locale/ui-components.pot' --marker-names '__,N_' && yarn run gettext:validate",
1313
"gettext:validate": "node scripts/validate-gettext-catalog.js",
1414
"install-vendor": "webpack --config webpack.vendor.config.js",
15-
"build-docs": "jsdoc -c jsdoc-conf.json"
15+
"build-docs": "jsdoc -c jsdoc-conf.json",
16+
"test:security": "yarn npm audit --recursive --no-deprecations --environment production"
1617
},
1718
"repository": {
1819
"type": "git",

0 commit comments

Comments
 (0)