python2 and python3 is already installed and python command on terminal points to python2
➜ ~ python --version
Python 2.7.16
➜ ~ python3 --version
Python 3.7.3
# Install virtualenv and virtualenvwrapper
sudo pip3 install virtualenv
# Jenkins pipeline script in declarative snytax to run bandit on git repo | |
# Needs git token added to the jenkins server in credential store | |
# Runs the job in a docker so jekins should have docker installed. | |
# Need a third-party library called jenkinsci-unstashParam-library to fetch the baseline json uploaded as job parameter. | |
properties([parameters( | |
[string(defaultValue: 'NameofScan', description: 'Use only alphabets, without space', name: 'SCAN_NAME', trim: true), string(defaultValue: '[email protected]:test/repo1.git', description: 'Enter the "Clone with SSH" url', name: 'REPO', trim: true), | |
string(defaultValue: 'dev', description: 'Select the release branch to run scans for particular release', name: 'Branch', trim: true), | |
choice(choices: ['YES', 'NO'], description: 'Run normal scan', name: 'NORMAL_SCAN'), | |
choice(choices: ['YES', 'NO'], description: 'Run baseline scan to hide previous found issues. If you choose YES you MUST upload baseline json file in next step.', name: 'BASELINE_SCAN'), |
1 Create CA | |
1.1 Create keys | |
openssl genrsa -out rootCA_key.key 2048 | |
-des3 algorithm to encrypt the key and will require you to enter a password in order for the key file to be created. | |
1.2 Create Root CA cert with constraint CA = true | |
openssl req -x509 -new -nodes -key rootCA_key.key -sha256 -days 1024 -out rootCA_crt.pem -extensions v3_ca -reqexts v3_req -config /usr/local/etc/openssl/openssl.cnf | |
2 Create SSL cert |