IBM Cloud Security Advisor Java SDK

Java Client Library to access the IBM Cloud Security Advisor

License

License

Categories

Categories

Security
GroupId

GroupId

com.ibm.cloud
ArtifactId

ArtifactId

securityadvisor
Last Version

Last Version

1.2.3
Release Date

Release Date

Type

Type

pom
Description

Description

IBM Cloud Security Advisor Java SDK
Java Client Library to access the IBM Cloud Security Advisor
Project URL

Project URL

https://github.com/ibm-cloud-security/security-advisor-sdk-java
Project Organization

Project Organization

IBM Cloud Security Advisor
Source Code Management

Source Code Management

https://github.com/ibm-cloud-security/security-advisor-sdk-java/tree/master

Download securityadvisor

Filename Size
securityadvisor-1.2.3.pom 20 KB
Browse

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • modules/common
  • modules/findings_api
  • modules/notifications_api
  • modules/coverage-reports

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