GithubHelp home page GithubHelp logo

betobrandao / fortifyapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fortifyadmin/fortifyapi

0.0 1.0 0.0 894 KB

Python library for Fortify Software Security Center (SSC) RESTFul API

License: MIT License

Python 99.75% Shell 0.25%

fortifyapi's Introduction

https://img.shields.io/circleci/build/github/fortifyadmin/fortifyapi/master?logo=CircleCI

Fortify API

Fortify API is a Python RESTFul API client module for Fortify's Software Security Center

Quick Start

Several quick start options are available:

  • Build locally: pip install wheel setuptools && python setup.py build
  • Install with pip (recommended): pip install fortifyapi
  • Download the latest release.

Example

from os import environ
from locale import LC_ALL, setlocale
from fortifyapi.fortify import FortifyApi

# Set encoding
environ["PYTHONIOENCODING"] = "utf-8"
myLocale = setlocale(category=LC_ALL, locale="en_GB.UTF-8")

# Set vars for connection
url = 'https://some-fortify-host/ssc'
user = 'Fortify SSC User'
password = 'Fortify SSC Password'
description = 'fortifyapi test client'

# Authenticate and retrieve token
def token():
    api = FortifyApi(host=url, username=user, password=password, verify_ssl=False)
    response = api.get_token(description=description)
    return response.data['data']['token']

# Re-use token in all requests
def api():
    api = FortifyApi(host=url, token=token(), verify_ssl=False)
    return api

# List ID, Project/application Version
def list():
    response = api().get_all_project_versions()
    data = response.data['data']
    for version in data:
        print("{0:8} {1:30} {2:30}".format(version['id'], version['project']['name'], version['name']).encode(
            'utf-8', errors='ignore').decode())

if __name__ == '__main__':
     list()

Bugs and Feature Requests

Found something that doesn't seem right or have a feature request? Please open a new issue.

Copyright and License

https://img.shields.io/github/license/fortifyadmin/fortifyapi.svg?style=flat-square

fortifyapi's People

Contributors

betobrandao avatar bluebionic avatar chewjr avatar czguang avatar jakesiegers avatar ksg97031 avatar ryyaan2004 avatar vetsin avatar xolian 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.