Skip to main content

Findings API Client SDK

Project description

IBM Cloud Security Advisor Findings API Python SDK

This repository contains the released Python client SDK for IBM Cloud ecurity Advisor Findings API . Check out our API documentation for more details.

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

you can install latest version by

pip install ibm-cloud-security-advisor-findingsapi-sdk

Since the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python.git)

Then import the package:

import ibm_security_advisor_findings_api_client 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import ibm_security_advisor_findings_api_client

Getting Started

Please follow the installation procedure and then run the following:

 
from __future__ import print_function
import time
import ibm_security_advisor_findings_api_client 
from ibm_security_advisor_findings_api_client.rest import ApiException
from pprint import pprint

note =     {
        "kind": "FINDING",
        "short_description": "Test Finding",
        "long_description": "Test Finding",
        "provider_id": "TEST",
        "id": "test-finding",
        "reported_by": {
            "id": "test-finding",
            "title": "Test findings"
        },
        "finding": {
            "severity": "LOW",
            "next_steps": [{
                "title": "Verify open issues in link "
            }]
        }
}


# Configure API key authorization: UserMin
configuration = ibm_security_advisor_findings_api_client.Configuration()
#Change this to point to London endpoint
configuration.host= "https://us-south.secadvisor.cloud.ibm.com/findings"

api_instance = ibm_security_advisor_findings_api_client.FindingsNotesApi(ibm_security_advisor_findings_api_client.ApiClient(configuration))
body = note # ApiNote | Body for Note creation

authorization = 'Bearer <<YOUR IAM TOKEN>>`
account_id = 'Your account ID' # str | Account ID
provider_id = 'TEST' # str | Part of `parent`. This field contains the provider_id for example: providers/{provider_id}


try:
    # Creates a new `Note`.
    api_response = api_instance.create_note(body, authorization, account_id, provider_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FindingsNotesApi->create_note: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to /findings

Class Method HTTP request Description
FindingsGraphApi post_graph POST /v1/{account_id}/graph query findings
FindingsNotesApi create_note POST /v1/{account_id}/providers/{provider_id}/notes Creates a new `Note`.
FindingsNotesApi delete_note DELETE /v1/{account_id}/providers/{provider_id}/notes/{note_id} Deletes the given `Note` from the system.
FindingsNotesApi get_note GET /v1/{account_id}/providers/{provider_id}/notes/{note_id} Returns the requested `Note`.
FindingsNotesApi get_occurrence_note GET /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id}/note Gets the `Note` attached to the given `Occurrence`.
FindingsNotesApi list_notes GET /v1/{account_id}/providers/{provider_id}/notes Lists all `Notes` for a given provider.
FindingsNotesApi update_note PUT /v1/{account_id}/providers/{provider_id}/notes/{note_id} Updates an existing `Note`.
FindingsOccurrencesApi create_occurrence POST /v1/{account_id}/providers/{provider_id}/occurrences Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource.
FindingsOccurrencesApi delete_occurrence DELETE /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} Deletes the given `Occurrence` from the system.
FindingsOccurrencesApi get_occurrence GET /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} Returns the requested `Occurrence`.
FindingsOccurrencesApi list_note_occurrences GET /v1/{account_id}/providers/{provider_id}/notes/{note_id}/occurrences Lists `Occurrences` referencing the specified `Note`. Use this method to get all occurrences referencing your `Note` across all your customer providers.
FindingsOccurrencesApi list_occurrences GET /v1/{account_id}/providers/{provider_id}/occurrences Lists active `Occurrences` for a given provider matching the filters.
FindingsOccurrencesApi update_occurrence PUT /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} Updates an existing `Occurrence`.

Documentation For Models

Documentation For Authorization

Use "Bearer " + IAM TOKEN in api calls. Refer Getting Started

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ibm-cloud-security-advisor-findingsapi-sdk, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size ibm-cloud-security-advisor-findingsapi-sdk-1.0.4.tar.gz (40.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page