Coder Social home page Coder Social logo

r1yaz / vma2s Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.43 MB

DevSecOps projects which I've built and am in the process of open sourcing it

Home Page: https://github.com/r1yaz/vmA2s

bandit devsecops devsecops-best-practices devsecops-pipeline python

vma2s's Introduction

vmA2s

DevSecOps projects/code which I've built and am in the process of open sourcing it. Releasing every 2-3 days.

Sample Architecture

Something I'm working on in my free time.

Image of Sample Arch

DVPWA + Bandit

security: bandit

Run bandit SAST scans over the dvpwa (Damn Vulnerable Python Web Application) repository using GitLab CI.

#update things here regarding the 3 screenshots you added (with ref links) start a new project

Code

stages: #denotes the stages in the pipeline. we need only one stage.
  - bandit_scan #since we're running a bandit scan, it's bandit_scan :)

build-job:
  stage: bandit_scan #which stage does this job belong to?
  image: python:3.6 #what image are we cloning to run this?
  script:
    - git clone https://github.com/anxolerd/dvpwa #clone DVPWA
    - cd dvpwa #cd into the folder
    - pip3 install bandit #install the bandit package
    # Run bandit with verbose (-v), recursive (-r) so that it scans all the subdirectories too, pass the path to dvpwa, output format as json (-f), and we want to store the output file as result.json (-o)
    - bandit -v -r /builds/sample_devsecops/damnvulnerablepythonapp/dvpwa -f json -o /builds/sample_devsecops/damnvulnerablepythonapp/dvpwa/result.json
  artifacts: #To keep the generated output result.json as an artifact
    when: always #ensure that this artifact is present even if the build fails
    paths: #where to store the artifact
      - /builds/sample_devsecops/damnvulnerablepythonapp/dvpwa/result.json

Clean code present in .gitlab-ci.yml

Results

Update the YAML CI/CD Code into a repository as the .gitlab-ci.yml file.

Image showing the updated YAML code

Auto-trigger the pipeline when a commit is made to the repository and a valid .gitlab-ci.yml file is present. As indicated, Artifact is generated and uploaded.

Image showing the CI/CD pipeline being triggered and the artifact being generated and uploaded

Artifact contains bandit scan reports of the Damn Vulnerable Python Web Application as highlighted below.

Image showing the Artifact with the bandit scan reports

vma2s's People

Contributors

r1yaz avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.