rcbops/abell

Name: abell

Owner: rcbops

Description: Distributed cloud inventory System

Created: 2017-04-20 17:28:38.0

Updated: 2017-05-30 16:22:00.0

Pushed: 2017-07-26 21:30:21.0

Homepage: null

Size: 52

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Abell

Build Status

A distributed dynamic inventory system.

Installing with Docker

Install Docker and Docker Compose.

cd into the top abell directory and run:

sudo docker-compose build
sudo docker-compose up -d

This will launch 2 containers and look something like this:

do docker ps
AINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                      NAMES
e2757ee8        abell_app           "/bin/sh -c 'pytho..."   52 seconds ago      Up 51 seconds                                  abell_app_1
4defee41        mongo:latest        "docker-entrypoint..."   53 seconds ago      Up 51 seconds       0.0.0.0:27017->27017/tcp   abell_db_1
Installing with RPC-O/OSA

For development purposes, it is possible to run Abell on an AIO. This can be done by following the Docker instructions above on the AIO host machine.

Abell will be started on localhost:6000, and will not intefere with the rest of the AIO. However, it is not currently integrated with or managed by RPC-O/OSA's playbooks.

Installing manually

If you would like to run Abell manually, you must first prepare a local MongoDB database with an admin user.

Installing MongoDB is outside the scope of this document, however the user can be created with the bootstrap_mongodb.sh script.

Usage

In order to add an asset to abell, there must be an entry for that asset's “type”. An asset type entry holds information on what fields each asset will contain, along with who has access to them. Here is an example server asset type:


"type": "server"
"system_keys": [
  "cloud",
  "abell_id",
  "owner",
  "type"
],
"managed_keys": [
  "patches",
  "os",
  "cabinet"
],
"unmanaged_keys": [
  "notes",
  "arbitrary_field1"
],


System Keys are variables that must be provided during asset creation and are hard coded into abell, every asset and asset type in abell will have these keys. These fields are mainly for abell to logically map and track each asset, they cannot currently be changed.

Managed and Unmanaged keys are for the abell admin to define, and can be updated and deleted at any time. The idea is that managed keys are fields that don't often change and are only updated by very trustworthy sources, like the asset themselves or auditing automation. On the other hand, unmanaged keys are for the various users of abell who would like to store arbitrary key values specific to each asset. Things like notes or tags for external automation to key off of.


Creating an asset type

Sending a dictionary with the following parameters will create an asset type in abell.

Parameters:
pe": "asset_type",
aged_keys": ["Key1", "Key2", ...],
anaged_keys": ["Key3", ...]}
Example:
 -X POST http://<abell_ip:6000>/api/v1/asset_type \
 'content-type: application/json' \
 '{"type": "server", "managed_keys": ["version", "patches"], "unmanaged_keys": ["notes"]}'
Returns:

ode": 200,
etails": {
"info": "Asset type server created"

ayload": null


Getting asset type info

This request will return all the fields for a given asset type.

Parameters:
=asset_type
Example:
 -X GET 'http://<abell_ip:6000>/api/v1/asset_type?type=server' \
 'content-type: application/json'
Returns:

ode": 200
ayload": {
"unmanaged_keys": [
  "notes"
],
"managed_keys": [
  "version",
  "patches"
],
"type": "server",
"system_keys": [
  "abell_id",
  "owner",
  "cloud",
  "type"
]

etails": {}


Updating asset type fields

This request will add, remove or swap fields for for an asset type.

NOTE: This command will be mirrored for every asset of the provided type i.e. removing a key from either managed or unmanaged will delete that field in all assets of that type. The same goes for adding a new field, all existing assets will have the new field with the value “None”.

Parameters:
pe": "asset_type",            # Required
ove_keys": ["Key1"],          # Optional
aged_keys": ["Key2"],         # Optional
anaged_keys": ["new_key"]}    # Optional
Example:

This call will remove the “version” key from all assets of type server, add the key value pair “os”: “None” to all server assets and swap notes and patches in the server asset type

 -X PUT http://<abell_ip:6000>/api/v1/asset_type \
 'content-type: application/json' \
 '{"type": "server","remove_keys": ["version"], "managed_keys": ["os", "notes], "unmanaged_keys": ["patches"]

Returns:

ode": 200,
ayload": null,
etails": {
"new_keys": ["os"],
"removed_keys": [
  "version"
],
"info": "Asset server updated"



Delete asset type

This will remove an asset type from abell

NOTE: An asset type will only be removed if ALL assets of the given type are deleted from abell prior to this call.

Parameters:
=asset_type
Example:
 -X DELETE 'http://<abell_ip:6000>/api/v1/asset_type?type=server' \
 'content-type: application/json'
Returns:

ode": 200,
ayload": null,
etails": {
"info": "Asset type server deleted"



This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.