Git Product home page Git Product logo

fuzzgoat's Introduction

How to add cyderian fuzz testing to your CI/CD

First create a file with the path .github/workflows/. You can call this file fuzztest.yaml.

Add a job to send a fuzzing request by adding the following content fuzztest.yaml:

name: Cyderian

on: [push]

jobs:
  fuzztest:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.7
      uses: actions/setup-python@v1
      with:
        python-version: 3.7
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install requests
    - name: sending requests
      env:
        CYDERIAN_USERNAME: ${{ secrets.CYDERIAN_USERNAME }}
        CYDERIAN_PASSWORD: ${{ secrets.CYDERIAN_PASSWORD }}
      run: |
        python .github/cyd.py

In this job first we install requests package for python and then we run a script that authenitcates the project with the api and send a fuzz request to the server.

Next step is to add the script. Create a file in the path .github/cyd.py and copy the following content into it:

import requests
import os

base_url = 'https://redtest.ca/api/'

response = requests.post(f'{base_url}users/login/', data={'username': os.getenv('CYDERIAN_USERNAME'), 'password': os.getenv('CYDERIAN_PASSWORD')})
access = response.json()['access']
headers = {'Authorization': f'Bearer {access}'}
print(access)

response = requests.get(f'{base_url}users/self', headers=headers)
user_id = response.json()['id']
print(user_id)

response = requests.post(f'{base_url}users/{user_id}/git/', data={'repo': 'https://github.com/sudomakeinstall2/fuzzgoat.git',
                                               'commit': os.getenv('GITHUB_SHA')},headers=headers)

print(response.status_code)

The final step is to create secret values for your cyderian credentials. Go to your secrets page of your project and add CYDERIAN_USERNAME, CYDERIAN_PASSWORD with proper values.

Now you should be able to run fuzztest on every push on the repository.

#....,....|...

fuzzgoat's People

Contributors

hamidazimy avatar sudomakeinstall2 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.