Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduit-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TE-TEAM1
conduit-backend
Commits
4d9ebb22
Commit
4d9ebb22
authored
4 years ago
by
Jukka Veijanen
Browse files
Options
Downloads
Patches
Plain Diff
npm audit fix, reports in json and html format work
parent
a17be5e7
No related branches found
No related tags found
1 merge request
!18
npm audit fix, reports in json and html format work
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+13
-3
13 additions, 3 deletions
Dockerfile
audit-json-html.sh
+11
-1
11 additions, 1 deletion
audit-json-html.sh
with
24 additions
and
4 deletions
Dockerfile
+
13
−
3
View file @
4d9ebb22
...
...
@@ -14,14 +14,24 @@ WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY
package*.json ./
#COPY package*.json ./
# Bundle app source
COPY
. .
# Install tool to report vulnerabilities in html format
RUN
npm
install
-P
npm-audit-html
RUN
npm
install
# If you are building your code for production
# RUN npm ci --only=production
# Bundle app source
COPY
. .
# Create folder for audit reports
RUN
mkdir
reports
# Check vulnerabilities, fix, and check again and save result into html file
RUN
sh audit-json-html.sh reports/audit-backend-prefix
RUN
npm audit fix
RUN
sh audit-json-html.sh reports/audit-backend-postfix
# 3000 can be found from source code app.js line 82.
EXPOSE
3000
...
...
This diff is collapsed.
Click to expand it.
audit-json-html.sh
+
11
−
1
View file @
4d9ebb22
#!/bin/bash
npm audit
--json
| node_modules/npm-audit-html/index.js
--output
audit-report.html
NOW
=
$(
date
'+%Y-%m-%d_%H.%M.%S'
)
FILE
=
"
$1
"
if
[
-z
"
$FILE
"
]
then
FILE
=
"audit-backend-report-
$NOW
"
fi
echo
"Run audit to file
$FILE
{json|html}"
npm audit
--json
>
$FILE
.json
npm audit
--json
| node_modules/npm-audit-html/index.js
--output
$FILE
.html
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment