Code Monkey home page Code Monkey logo

pdrest's Introduction

What is pdrest?

pdrest is a utility for IBM Security Access Manager (SAM) appliances. It allows batch processing of multiple "pdadmin" commands through the appliance's REST interface. The "old" pdadmin interface still exists on the SAM appliances when connecting through SSH, however, only one command can be entered at a time (easily). pdrest allows an external file of commands to be feed into the appliance. Additionally, comments and blank lines are supported in the command file.

pdrest is a stand-alone binary that allows for convenient installation. It specifically deals with the pdadmin interface and does not have additional functions for calling other SAM-provided REST calls.

pdrest has been successfully used to run more than 30,000 commands at a time.

Installation

pdrest binaries can be downloaded for specific architectures from releases or can be built from the go source.

To clone and compile a binary from source:

$ git clone https://github.com/triddell/pdrest.git $GOPATH/src/github.com/triddell/pdrest
$ cd $GOPATH/src/github.com/triddell/pdrest
$ go install

The go install command creates the binary at $GOBIN/pdrest.

Alternatively, you can build a binary and copy it wherever you'd like with go build:

$ git clone https://github.com/triddell/pdrest.git $GOPATH/src/github.com/triddell/pdrest
$ cd $GOPATH/src/github.com/triddell/pdrest
$ go build pdrest.go
$ mv pdrest /to/some/directory

##Usage

pdrest -help

> pdrest -help
Usage of pdrest:
  -applianceAdmin="admin": Appliance Admin User Name
  -commands="commands.txt": Commands File Path
  -creds="": Credentials File Path
  -host="localhost": Appliance Hostname
  -runtimeAdmin="sec_master": Runtime Admin User Name

The command defaults to using an appliance admin user name of admin, a runtime admin user name of sec_master, and a commands file name of commands.txt.

The -hostname flag will always be needed since pdrest can't run on the appliance itself.

Passwords can be provided in an external file by using the -credentials flag.

###Sample files for example commands:

commands.txt

server list
# The following line is indented with a tab and this line is a comment.
  server list

credentials.txt

# SAM Appliance Password
appPswd
# SAM Runtime Password
samPswd

Examples

Example 1: Prompting for passwords

> pdrest -host sam01.riddell.us
Appliance Admin User Password:
Runtime Admin User Password:
Status Code:  200
Result:
cmd> server list
    ivmgrd-master
    web01-webseald-sam01.riddell.us
cmd> server list
    ivmgrd-master
    web01-webseald-sam01.riddell.us

Example 2: Passwords stored in external file

> pdrest -host sam01.riddell.us -creds credentials.txt
Status Code:  200
Result:
cmd> server list
    ivmgrd-master
    web01-webseald-sam01.riddell.us
cmd> server list
    ivmgrd-master
    web01-webseald-sam01.riddell.us

pdrest's People

Contributors

triddell avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.