IBM Secret Server APIs
IBM Secret Server APIs
APIs
—
Support Webinar
Grey Thrasher
[email protected]
Announcing IBM VIP Rewards
Engage. Earn points. Get Rewards.
• Courses
• Videos
• Hands-on Labs
• Live Events
• Badges
Learning at no cost.
• Presenter:
Grey Thrasher - Identity Support Technical Lead
• Panelists:
Daryl Romano - Identity Support
Jensen Toma - Identity Support
Gary Sedler - Identity Support
Mohammad Khan - Identity Support
Agenda
• Introduction
• REST
• SDK
• Demo
• Q/A
Introduction
Introduction
• API: Application Programming Interface
😴
• POST
• GET
• PUT
• DELETE
• Stateless: Each request is independent
• Request Data is typically JSON,
x-www-form-urlencoded and/or query parameters
• Response Data is typically JSON
{
"id": 12,
"name": "SDK Test",
Coding/Usage:
"secretTemplateId": 2,
"folderId": 7,
"active": true,
"items": [
{
"itemId": 53,
"fileAttachmentId": null,
"filename": null,
"itemValue": "fooserver",
"fieldId": 60,
"fieldName": "Resource",
"slug": "resource",
• Authentication: returns Token to be used in all other requests "fieldDescription": "The URL or location where information is being secured.",
"isFile": false,
"isNotes": false,
"isPassword": false
},
POST: https://ss/SecretServer/oauth2/token {
{
"itemId": 54,
"access_token": "AgLlj_5QYUil….", "fileAttachmentId": null,
Headers: Content-Type: application/x-www-form-urlencoded "token_type": "bearer",
"filename": null,
"itemValue": "sdktest",
"fieldId": 61,
Body: username, password, grant_type=password "expires_in": 1200
}
"fieldName": "Username",
"slug": "username",
"fieldDescription": "The name assocated with the password.",
"isFile": false,
"isNotes": false,
"isPassword": false
• Get Secret: },
{
"itemId": 55,
"fileAttachmentId": null,
"filename": null,
POST: https://ss/SecretServer/api/v1/secrets-permissions
"fieldDescription": "Any comments or additional information for the secret.",
"isFile": false,
"isNotes": true,
{
"requiresComment": false,
"checkOutEnabled": false,
"checkOutIntervalMinutes": -1,
“secretId” : 15,
"checkOutChangePasswordEnabled": false,
"accessRequestWorkflowMapId": -1,
"proxyEnabled": true,
//auth to SS
form: {
username: username,
password: password,
grant_type: 'password’
}
};
/oauth2/token to if(jsonBody.hasOwnProperty("error")){
console.log("login error: " + jsonBody.error);
res.send('<p><strong>Login Failed...please try again: </strong><a href="/">Login</a></p>’);
authenticate and save the } else {
req.session.sstoken = jsonBody.access_token;
Token to the Session console.log("login.js: login success. here's the token: " + jsonBody.access_token);
req.session.save();
res.redirect('./menu’);
}
}
});
});
module.exports = router;
Coding: Node.js
Get Secrets var express = require('express');
var request = require('request');
var router = express.Router();
//auth to SS
const options = {
method: "GET",
Define the data for the url: process.env.SS_URL + "/api/v1/secrets",
headers: {
pass to /api/v1/secrets 'cache-control': 'no-cache’,
'Accept': 'application/json’,
'Authorization': 'Bearer ' + req.session.sstoken
}
};
client });
}
});
module.exports = router;
Troubleshooting
• Server:
• Catch/Print errors
Documentation
• REST APIs: Can access docs locally via SS console > Help > Secret
Server REST API Guide:
example: https://<SecretServer>/SecretServer/Documents/restapi/
• Status:
tss status
• Remove configuration:
tss remove
• Retrieve Token:
tss token
• Get Secret:
tss secret –s <secretID> -f <field slug> -o <output file> -ad
• Version:
tss version
SDK Usage
{"resource":"fooserver","username":"sdktest","passw
ord":"#5r5^(h^jLzK","notes":"This is a test secret
to use with SDK"}
import subprocess
import json
secret = None
print(jsonSec["username"])
print(jsonSec["password"])
python sdkTest.py
sdktest
#5r5^(h^jLzK
Troubleshooting
• Server:
• SDK (tss)
- Initialize
- Get Secrets
• Postman
- Download/install Postman ( https://getpostman.com )
- Create an Environment
- Create a Collection
- Get Auth Token
- Get Secret Data
• Node.js
Examples
• GitHub:
https://github.com/gthrasher/SecretServer
Summary
28
For more information
• IBM Secret Server Support Forum: http://ibm.biz/SecretServer-SupportForum
• IBM Secret Server Security Learning Academy: http://ibm.biz/ISSS-LearningAcademy
29
Thank you
Follow us: © Copyright IBM Corporation 2019. All rights reserved. The information contained in these
materials is provided for informational purposes only, and is provided AS IS without
warranty of any kind, express or implied. Any statement of direction represents IBM’s
securitylearningacademy.com current intent, is subject to change or withdrawal, and represent only goals and objectives.
IBM, the IBM logo, and other IBM products and services are trademarks of the
International Business Machines Corporation, in the United States, other countries or both.
ibm.biz/JoinIBMVIPRewards-Security Other company, product, or service names may be trademarks or service marks of others.
All names and references for organizations and other business institutions used in this
youtube/user/IBMSecuritySupport deliverable’s scenarios are fictional. Any match with real organizations or institutions is
coincidental.
@AskIBMSecurity Statement of Good Security Practices: IT system security involves protecting systems and
information through prevention, detection and response to improper access from within
and outside your enterprise. Improper access can result in information being altered,
ibm.biz/IBMSecurityClientSuccess-LinkedIn destroyed, misappropriated or misused or can result in damage to or misuse of your
systems, including for use in attacks on others. No IT system or product should be
considered completely secure and no single product, service or security measure can be
securityintelligence.com completely effective in preventing improper use or access. IBM systems, products and
services are designed to be part of a lawful, comprehensive security approach, which will
xforce.ibmcloud.com necessarily involve additional operational procedures, and may require other systems,
products or services to be most effective. IBM does not warrant that any systems,
products or services are immune from, or will make your enterprise immune from, the
ibm.com/security/community malicious or illegal conduct of any party.