Security Advisor Common Library

Java Client Library to access the IBM Cloud Security Advisor

License

License

Categories

Categories

Security
GroupId

GroupId

com.ibm.cloud
ArtifactId

ArtifactId

securityadvisor-common
Last Version

Last Version

1.2.3
Release Date

Release Date

Type

Type

jar
Description

Description

Security Advisor Common Library
Java Client Library to access the IBM Cloud Security Advisor
Project Organization

Project Organization

IBM Cloud Security Advisor

Download securityadvisor-common

How to add to project

<!-- https://jarcasting.com/artifacts/com.ibm.cloud/securityadvisor-common/ -->
<dependency>
    <groupId>com.ibm.cloud</groupId>
    <artifactId>securityadvisor-common</artifactId>
    <version>1.2.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.ibm.cloud/securityadvisor-common/
implementation 'com.ibm.cloud:securityadvisor-common:1.2.3'
// https://jarcasting.com/artifacts/com.ibm.cloud/securityadvisor-common/
implementation ("com.ibm.cloud:securityadvisor-common:1.2.3")
'com.ibm.cloud:securityadvisor-common:jar:1.2.3'
<dependency org="com.ibm.cloud" name="securityadvisor-common" rev="1.2.3">
  <artifact name="securityadvisor-common" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.ibm.cloud', module='securityadvisor-common', version='1.2.3')
)
libraryDependencies += "com.ibm.cloud" % "securityadvisor-common" % "1.2.3"
[com.ibm.cloud/securityadvisor-common "1.2.3"]

Dependencies

compile (1)

Group / Artifact Type Version
com.ibm.cloud : sdk-core jar 8.3.0

test (3)

Group / Artifact Type Version
org.testng : testng jar 7.1.0
org.powermock : powermock-api-mockito2 jar 2.0.5
org.powermock : powermock-module-testng jar 2.0.5

Project Modules

There are no modules declared in this project.

Build Status semantic-release

IBM Cloud Security Advisor Java SDK Version 2.0.1

Java client library to interact with various IBM Cloud Security Advisor.

Disclaimer: this SDK is being released initially as a pre-release version. Changes might occur which impact applications that use this SDK.

Table of Contents

Overview

The IBM Cloud Security Advisor Java SDK allows developers to programmatically interact with the following IBM Cloud services:

Service Name Artifact Coordinates
IBM Cloud Security Advisor Findings API com.ibm.cloud.securityadvisor:findings_api:2.0.1
IBM Cloud Security Advisor Notifications API com.ibm.cloud.securityadvisor:notifications_api:2.0.1

Prerequisites

  • An IBM Cloud account.
  • An IAM API key to allow the SDK to access your account. Create one here.
  • Java 8 or above.

Installation

The current version of this SDK is: 2.0.1

Each service's artifact coordinates are listed in the table above.

To use a particular service, define a dependency that contains the artifact coordinates (group id, artifact id and version) for the service, like this:

Maven
<dependency>
    <groupId>com.ibm.cloud</groupId>
    <artifactId>securityadvisor</artifactId>
    <version>2.0.1</version>
</dependency>
Gradle
'com.ibm.cloud:securityadvisor:2.0.1'

Authentication

IBM Cloud Security Advisor uses token-based Identity and Access Management (IAM) authentication.

IAM authentication uses a service API key to get an access token that is passed with the call. Access tokens are valid for a limited amount of time and must be regenerated.

To provide credentials to the SDK, you supply either an IAM service API key or an access token:

  • Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
  • Use the access token if you want to manage the lifecycle yourself. For details, check Authenticating using the IAM Token section.

Authenticating using the IAM API key:

import com.ibm.cloud.sdk.core.security.IamAuthenticator;
import com.ibm.cloud.securityadvisor.notifications_api.v1.NotificationsApi;
import com.ibm.cloud.securityadvisor.findings_api.v1.FindingsApi;

IamAuthenticator authenticator = new IamAuthenticator("<apiKey>");
NotificationsApi notificationsApi = new NotificationsApi("notifications_api", authenticator); //Initialize notifications service
FindingsApi findingsApi = new FindingsApi("findings_api", authenticator); //Initialize findings service

Authenticating using the IAM Token:

import com.ibm.cloud.sdk.core.security.IamAuthenticator;
import com.ibm.cloud.sdk.core.security.BearerTokenAuthenticator;
import com.ibm.cloud.securityadvisor.notifications_api.v1.NotificationsApi;
import com.ibm.cloud.securityadvisor.findings_api.v1.FindingsApi;

IamAuthenticator authenticator = new IamAuthenticator("<apiKey>");
IamToken iamToken = authenticator.requestToken(); //Generating the token
String token = iamToken.getAccessToken(); // Getting the token

BearerTokenAuthenticator bearerAuth = new BearerTokenAuthenticator(token); // initialize BearerTokenAuthenticator
NotificationsApi notificationsApi = new NotificationsApi("notifications_api", bearerAuth);//Initialize notifications service
FindingsApi findingsApi = new FindingsApi("findings_api", bearerAuth); //Initialize findings service

Using the SDK

For general SDK usage information, please see this link

For Findings API module usage information of the SDK, please see this link

For Notifications API module usage information of the SDK, please see this link

Questions

If you are having difficulties using this SDK or have a question about the IBM Cloud services, please ask a question at Stack Overflow.

Issues

If you encounter an issue with the project, you are welcome to submit a bug report. Before that, please search for similar issues. It's possible that someone has already reported the problem.

Open source @ IBM

Find more open source projects on the IBM Github Page

Contributing

See CONTRIBUTING.

License

The IBM Cloud Security Advisor Java SDK is released under the Apache 2.0 license. The license's full text can be found in LICENSE.

com.ibm.cloud

IBM Cloud Security

IBM Cloud Security

Versions

Version
1.2.3
1.2.2