Skip to content

iragh/shiftleft-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

devsecops-training-shiftleft

WARNING: THIS REPO CONTAINS MALICIOUS FILES

DevSecOps Lab 1: Create new Repo with name shiftleft-cicd-demo

  • Set up Git on CLI
    • git config --global user.name First Last
    • git config --global user.email email-address
  • Set up SSH keys for Github
  • Create new folder
    • mkdir shiftleft-cicd-demo
    • cd shiftleft-cicd-demo
  • Create new repository in github.com with name shiftleft-cicd-demo
    • Select Public

    • Leave all checkboxes blank

    • Follow instructions to create repository on the command line

      echo "# shiftleft-cicd-demo" >> README.md
      git init
      git add README.md
      git commit -m "first commit"
      git branch -M main
      git remote add origin [email protected]:chkp-[YOUR_GITHUB_USERNAME]/shiftleft-cicd-demo.git
      git push -u origin main

DevSecOps Lab 2: Set up pipeline with GitHub Actions

ShiftLeft Lab 1: Clone this repo and run code-scan and image scan

  • Clone this repo into your home directory:
  • Make shiftleft binary executable
    • chmod +x ./shiftleft
  • Set up cloudguard credentials
    • export CHKP_CLOUDGUARD_ID=<cloudguard_api_key_id>
    • export CHKP_CLOUDGUARD_SECRET=<cloudguard_api_secret>
  • Run code scan
    • ./shiftleft code-scan -s .
  • Build docker image
    • docker build -t chkp-username/myapp ./test-files/
    • docker save -o myapp.tar chkp-username/myapp
    • ./shiftleft image-scan -i myapp.tar

ShiftLeft Lab 2: Modify shiftleft.yml to run code scan, image scan and terraform scan

  • Fork demo app project into your github account - https://github.com/ilavender/demo-app

  • Copy shiftleft executable from the devsecops-training-shiftleft folder into your own shiftleft-cicd-demo folder.

  • In shiftleft.yml add code to perform the following:

    • clone demo-app
    • run shiftleft source code scan
    • build docker image
      • docker build -t chkp-rolandop/myapp ./demo-app
      • docker save -o myapp.tar chkp-rolandop/myapp
    • run shiftleft image scan
    • run iac-assessment scan on demo-app/terraform-template folder with AWS CIS foundations terraform ruleset

    Note: Figure out the commands to run locally before adding them to shiftleft.yml

Check your work against the shiftleft.yml included in this repo.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 80.7%
  • JavaScript 13.0%
  • Dockerfile 6.3%