Coder Social home page Coder Social logo

ilo-protocol's Introduction

ilo-protocol

Node.js module to interact with iLO (Integrated Lights-Out) modules in HPE servers. iLO 4 v2.55 (and possibly other versions) are supported.

npm install ilo-protocol

๐Ÿ’ก Examples ย โ€ขย  ๐Ÿ“š API reference

The focus is on implementing the remote console protocol, which allows you to manage the server as if you were sitting at the KVM. You can:

  • See the server's screen
  • Use the keyboard / mouse
  • Virtual media: mount a file / device from your computer that the server will see as a real SCSI device (hard drive, CDROM or floppy disk)
  • Press the power button, trigger a power cycle or system reset

In addition to implementing the protocol itself, the repository also comes with a fully-functional client in its examples, see examples.

Protocol overview

Initiation

First, the /json/rc-info endpoint in the HTTPS webserver is called. Like the whole API, it's authenticated with a 16-byte session key. It returns, among other things:

  • the network ports to connect to
    • remote console port
    • virtual media port
  • the main encryption key to use for the session
  • list of supported extra protocol features

From there the protocol itself starts. The client opens a TCP connection to the remote console port. It initiates a handshake to negotiate a remote console session, where the client authenticates to the server by sending the session key mentioned before, optionally (sort of) XOR-ed with the encryption key.

The server may reject the session because of several reasons (no license, wrong authentication, no free sessions, etc.), or it may accept it. If accepted, but another session is in progress, busy negotiation occurs. There's the option to share the session with the other user, or seize it from them. Seizing requires confirmation from the other user.

After that, another connection is opened to the same port, but a slightly different handshake is used which negotiates a command session. That session doesn't seem to be of much use so we'll focus on the remote console session from now on.

Server data (video stream)

TODO: document protocol

State graph

Client data (user input)

TODO: document protocol

Encryption

Once the handshake is over, the server may choose to switch the remote console session into RC4, AES128 or AES256 encryption. The encryption only applies to the remote console session, to both server and client data. Other sessions, like the command session or virtual media traffic (data read / written) are not encrypted, at least in the implemented version.

The ciphers are always used as stream ciphers, i.e. block cyphers are used in OFB mode.

Virtual media

TODO: document protocol

WebSocket support

Newer versions of the iLO (FIXME: document which) come with an HTML5 client rather than a Java applet.
This client uses exactly the same protocols, but over WebSockets rather than TCP connections.

That's very nice because if the webserver uses HTTPS (which it does by default) those WebSockets will also go over TLS which means we finally got decent security! The iLO doesn't use the in-protocol encryption mentioned above when the remote console session is over WebSockets.

TODO: document websocket endpoints, add support in API, make examples prefer WS when possible.

Usage

This library only has some dependency on Node.js APIs (streams and crypto) but is designed to be relatively easy to run in the browser.

Only the protocol itself is implemented; the user must handle decoded data, render it to the screen, listen to user input, and even network and filesystem I/O. The only exception is the rest module, which uses Got to make HTTPS requests.

The modules are structured as follows (internal APIs omitted):

Examples

The examples directory contains many examples of using the library.

Application screenshot

It's a completely functional GTK-based client, and it shows usage of (almost) all protocol features.
To try it out:

npm install
$(npm bin)/ts-node examples/app.ts <arguments>

Note: It's currently hardcoded to assume Linux (evdev) keycodes, so keyboard input probably won't work correctly on other OSes, or ancient Linux installs.

Note: This example depends on romgrk/node-gtk#252, package.json already installs that branch from my repo, but you need to do npm explore node-gtk -- npm run build:full after npm install to make sure it picks up the changes.

Simple program that mounts the supplied file as a CDROM device.
To try it out:

npm install
$(npm bin)/ts-node examples/vm_cdrom.ts <arguments>

ilo-protocol's People

Contributors

mildsunrise avatar

Stargazers

William Allen avatar Tadeas Minha avatar โ‘† Neveda โ‘ˆ avatar Tom Everett avatar Omega avatar Roy Michelsen avatar  avatar Alexander Birkner avatar Christoph Handel avatar  avatar Bence avatar Miguel Sama avatar

Watchers

James Cloos avatar  avatar Roy Michelsen 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.