In this tutorial, you will create a CDS Workflow with the Web UI that check JavaScript vulnerabilities
Let’s create a project. On the top navbar, click on ‘Create a project’.
The project is now create, you have to link a repository manager. Be sure to have a Repository manager as GitHub, Bitbucket Server or GitLab set up on your CDS Instance.
Select ‘Advanced’ section
In the section ‘Link to a repository manager’, select ‘github’, then click on ‘Connect’
A popup is displayed, Click on ‘Click here’ to finalize the link with GitHub. By doing that, you allow CDS to create hook on GitHub.
Here, GitHub is well linked on your CDS project.
You’ve got a project, linked to GitHub. Let’s create an application.
A CDS Application is useful to have a link to a Git Repository.
Go on Project -> Applications tab, click on ‘Create a new application’
Enter application name, here ‘my-node-app’
Go on Advanced tab, select a Repository
Expand configuration, select ‘https’. If your repository is public, you can keep empty fields, then click on ‘Save’
version: v1.0
name: check-node-vulnerabilities
jobs:
- job: New Job
steps:
- checkout: '{{.cds.workspace}}'
- script:
- npm install --no-audit
- optional: true
script:
- npm audit --json > report.json
- plugin-npm-audit-parser:
file: report.json
requirements:
- binary: git
- binary: npm
- plugin: plugin-npm-audit-parser
Create the pipeline
Then select your application.
Click on create to create the workflow.
Click on ‘Edit the pipeline’
Click on Edit as Code button, then paste that code:
Pipeline is created
The workflow is now ready to be launched
Launch the workflow and double click on the pipeline when build finished
Click on tab ‘Vulnerabilities’
If the workflow has been launch on the default branch of your repository, vulnerabilities are also attached to the CDS application
Go to your project, on application tab
Select your application and go to vulnerabilities tab