Scanning repository using talisman.

Install talisman Dependency:

The scripts check authenticity of downloaded binary using ‘shasum’ (read about hashing). We can install this module using:

sudo yum install -y perl-Digest-SHA

Download and install using talisman installation script:

This will download the installation scripts to home directory

curl --silent  https://raw.githubusercontent.com/thoughtworks/talisman/master/global_install_scripts/install.bash > /tmp/install_talisman.bash && /bin/bash /tmp/install_talisman.bash 

install talisman html report tool:

curl https://github.com/jaydeepc/talisman-html-report/archive/v1.3.zip -o ~/.talisman/talisman_html_report.zip -J -L && cd ~/.talisman && unzip talisman_html_report.zip -d . && mv talisman-html-report-1.3 talisman_html_report && rm talisman_html_report.zip

Run the scan:

Navigate to target

and run the below command:

talisman --scanWithHtml

See the report:

navigate to talisman_html_reportnavigate to folder in the target directory:

cd talisman_html_report

start a server using below command:

 python -m SimpleHTTPServer 9001

Navigate to : localhost:9001

Note: To run from bash script you have to add to Path, alias won’t work on bash script

Jenkins Shell Job:

 cd ../Pull_source_code
 git checkout --orphan test1
 git reset --hard
 set +e
 git cherry-pick --strategy-option="rename-threshold=30" $(git rev-parse master)
 set -e
 rm -R -f .git
 git init 
 git add .
 git commit -m "new"
 set +e
 talisman --scanWithHtml
 set -e
 echo $PWD
 kill -9 $(pgrep -f "SimpleHTTPServer 9002")
 JENKINS_NODE_COOKIE=dontKillMe
 BUILD_ID=dontKillMe
 cd talisman_html_report
 echo $PWD
 setsid  python2 -m SimpleHTTPServer 9002 >/dev/null 2>&1 < /dev/null &
 echo $PWD
 cp -r ../talisman_html_report ../../talisman_Scan/talisman_html_report