ibmcloud-security-advisor-findings
v1.0.0
Published
JavaScript client library for the IBM Cloud Security Advisor Findings API
Downloads
5
Maintainers
Readme
IBM Cloud Security Advisor Findings API Node SDK
Findings API is supported in the following regions:
Requirements
Node.js 6.4.0 or later
Installation
For Node.js
To install the SDK:
npm install ibmcloud-security-advisor-findings --save
Install from a tagged release, for example, v1.0.0
npm install ibm-cloud-security/security-advisor-findings-sdk-nodejs#v1.0.0
Getting Started
Please follow the installation instruction and execute the following JS code:
var findings = require('ibmcloud-security-advisor-findings');
var defaultClient = findings.ApiClient.instance;
defaultClient.basePath = "https://us-south.secadvisor.cloud.ibm.com/findings"
let apiInstance = new findings.FindingsNotesApi();
let accountId = "accountId_example";
let authorization = "authorization_example";
let providerId = "providerId_example";
apiInstance.listNotes(accountId, authorization, providerId).then((data) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, (error) => {
console.error(error);
});
To target different regions set the basePath
on the client instance accordingly:
- Dallas -
https://us-south.secadvisor.cloud.ibm.com/findings
- London -
https://eu-gb.secadvisor.cloud.ibm.com/findings
Generating Authorization token
Authorization token
to be passed as second paramters in all the function calls is obtained by calling IBM Cloud IAM API. It is a bearer token in JWT format.
Find a sample here. Read more about the access here
Documentation for API Endpoints
All URIs are relative to:
- https://us-south.secadvisor.cloud.ibm.com/findings
- https://eu-gb.secadvisor.cloud.ibm.com/findings
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- findings.FindingsGraphApi | postGraph | POST /v1/{account_id}/graph | query findings findings.FindingsNotesApi | createNote | POST /v1/{account_id}/providers/{provider_id}/notes | Creates a new `Note`. findings.FindingsNotesApi | deleteNote | DELETE /v1/{account_id}/providers/{provider_id}/notes/{note_id} | Deletes the given `Note` from the system. findings.FindingsNotesApi | getNote | GET /v1/{account_id}/providers/{provider_id}/notes/{note_id} | Returns the requested `Note`. findings.FindingsNotesApi | getOccurrenceNote | GET /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id}/note | Gets the `Note` attached to the given `Occurrence`. findings.FindingsNotesApi | listNotes | GET /v1/{account_id}/providers/{provider_id}/notes | Lists all `Notes` for a given provider. findings.FindingsNotesApi | updateNote | PUT /v1/{account_id}/providers/{provider_id}/notes/{note_id} | Updates an existing `Note`. findings.FindingsOccurrencesApi | createOccurrence | POST /v1/{account_id}/providers/{provider_id}/occurrences | Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource. findings.FindingsOccurrencesApi | deleteOccurrence | DELETE /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} | Deletes the given `Occurrence` from the system. findings.FindingsOccurrencesApi | getOccurrence | GET /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} | Returns the requested `Occurrence`. findings.FindingsOccurrencesApi | listNoteOccurrences | 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. findings.FindingsOccurrencesApi | listOccurrences | GET /v1/{account_id}/providers/{provider_id}/occurrences | Lists active `Occurrences` for a given provider matching the filters. findings.FindingsOccurrencesApi | updateOccurrence | PUT /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} | Updates an existing `Occurrence`.
Documentation for Models
- findings.ApiEmpty
- findings.ApiListNoteOccurrencesResponse
- findings.ApiListNotesResponse
- findings.ApiListOccurrencesResponse
- findings.ApiListProvidersResponse
- findings.ApiListProvidersResponseInner
- findings.ApiNote
- findings.ApiNoteKind
- findings.ApiNoteRelatedUrl
- findings.ApiOccurrence
- findings.ApiProvider
- findings.Body
- findings.Body1
- findings.Body2
- findings.Body3
- findings.BreakdownCardElement
- findings.Card
- findings.CardElement
- findings.Certainty
- findings.Context
- findings.DataTransferred
- findings.Finding
- findings.FindingCountValueType
- findings.FindingType
- findings.InlineResponse200
- findings.InlineResponse2001
- findings.InlineResponse2001Context
- findings.InlineResponse2001Finding
- findings.InlineResponse2001FindingDataTransferred
- findings.InlineResponse2001FindingNetworkConnection
- findings.InlineResponse2001FindingNetworkConnectionClient
- findings.InlineResponse2001Kpi
- findings.InlineResponse2001Occurrences
- findings.InlineResponse2002
- findings.InlineResponse200Card
- findings.InlineResponse200CardElements
- findings.InlineResponse200Finding
- findings.InlineResponse200FindingNextSteps
- findings.InlineResponse200Kpi
- findings.InlineResponse200Notes
- findings.InlineResponse200RelatedUrl
- findings.InlineResponse200ReportedBy
- findings.InlineResponse200Section
- findings.Kpi
- findings.KpiType
- findings.KpiValueType
- findings.NetworkConnection
- findings.NumericCardElement
- findings.NumericCardElementValueType
- findings.RemediationStep
- findings.Reporter
- findings.Section
- findings.Severity
- findings.SocketAddress
- findings.TimeSeriesCardElement
- findings.ValueType
Examples
Try out the examples. Go to Security Advisor dashboard for visualizing it. The examples require you to export the following variables:
export account_id=<your account id>
export authorization=<Bearer <token>>
export region=eu-gb
node create_notes.js
node create_occurrences.js
us-south
will target the Dallas endpoint. Use eu-gb
to target London by exporting region
. Default region in the example is us-south
Obtain authorization token for filling in the token value. We have used async/await to simplify the examples. Make sure your Node version supports it natively. You can check here