Skip to content

This package provides an implementation of the Bugcrowd api.

License

Notifications You must be signed in to change notification settings

paulfri/bug_crowd_client

 
 

Repository files navigation

Bugcrowd api client.

travis-status-image pypi-version-image

This package provides an implementation of the Bugcrowd api.


Installation

To install simply run

pip install bug-crowd-api-client

Using this library

To create a Bugcrowd client
    from bug_crowd.client import BugcrowdClient
    client = BugcrowdClient('API_TOKEN')
To get bug bounties
    from bug_crowd.client import BugcrowdClient
    client = BugcrowdClient('API_TOKEN')
    bounties = client.get_bounties()
To get submissions for a bug bounty
    from bug_crowd.client import BugcrowdClient
    client = BugcrowdClient('API_TOKEN')
    bounty = client.get_bounties()[0]
    submissions = list(client.get_submissions(bounty))
To create a bug bounty submission
    import datetime

    from bug_crowd.client import BugcrowdClient
    client = BugcrowdClient('API_TOKEN')
    bounty = client.get_bounties()[0]
    submission_fields = {
        'substate': 'unresolved',
        'title': 'Example submission',
        'submitted_at': '11-11-2017 00:00:00',
        'description_markdown': 'Example description',
    }

    resp = client.create_submission(bounty, submission_fields).result()
    resp.raise_for_status()
    submission = resp.json()
To update a bug bounty submission
    from bug_crowd.client import BugcrowdClient
    client = BugcrowdClient('API_TOKEN')
    bounty = client.get_bounties()[0]
    submission = client.get_submissions(bounty)[0]

    resp = client.update_submission(
        submission,
        title='A new title',
        internal_bug_type='xss',
        custom_fields={'example': 'value'},
    ).result()
    resp.raise_for_status()
    updated_submission = resp.json()
To comment on a bug bounty submission
    from bug_crowd.client import BugcrowdClient
    client = BugcrowdClient('API_TOKEN')
    bounty = client.get_bounties()[0]
    submission = client.get_submissions(bounty)[0]

    resp = client.comment_on_submission(
        submission,
        'A comment',
        comment_type='tester_message',
    ).result()
    resp.raise_for_status()
    comment = resp.json()
To transition a bug bounty submission to a status
    from bug_crowd.client import BugcrowdClient

    client = BugcrowdClient('API_TOKEN')
    bounty = client.get_bounties()[0]
    submission = client.get_submissions(bounty)[0]

    resp = client.transition_submission(
        submission,
        'triaged',
    ).result()
    resp.raise_for_status()

About

This package provides an implementation of the Bugcrowd api.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%