All Projects → pandastrike → panda-panopticon

pandastrike / panda-panopticon

Licence: other
An AWS cloudwatch dashboard written in node.js using the AWS node.js SDK

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
coffeescript
4710 projects

The Panda Panopticon

Copyright (c) 2014 PandaStrike

Contributors:

This software is released under the MIT License.

Overview

Panda Panopticon is a lightweight Amazon Web Services (AWS) CloudWatch dashboard, and it lets you see it all. This app is anchored by a proxy server, implemented in Node.js. The server makes use of the AWS Node SDK to pull data from Amazon and pipe it to the client. The client offers a graphical user interface (GUI) constructed from Polymer elements. Data is processed in-browser using JavaScript and plotted using the HighCharts JavaScript library. User credentials and data are protected through end-to-end encryption.

-> Overview of application structure.

Installing and Running

  • Install Node.js and npm

  • Clone this repository

  • Install all the dependencies

      npm install
    
  • Place a private key and a security certificate in the "security" folder. Get a cert from a CA or create a self signed cert using OpenSSL.

openssl genrsa -out privatekey.pem 1024
openssl req -new -key privatekey.pem -out certrequest.csr
openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem
  • Run the server

      node server.js
    
  • Direct your browser to the IP address of the remote server, or 'localhost' if you are testing this on your personal machine. Panopticon will force an HTTPS connection, and you should see a web page ready to accept your AWS login. Enjoy!!

User Experience

After the website loads, click "AWS Login" and simply enter your credentials

  1. Access Key ID
  2. Secret Access Key
  3. Region (Currently, only one region at a time is supported)

-> Screenshot of Login.

Upon successful login, two new buttons will appear. Let's start with "Options".

This pulls up a dialog box that lets you customize your query to Amazon. The first tab contains time controls. You may request data from as far back as two weeks. You also have control over the reporting time-resolution, however, there are restrictions. Amazon will not accept requests that return greater than 1,440 data points, so make sure Time / Resolution < 1,440. Also, resolutions finer than 5 minutes are only available to those that paid Amazon for this extra service.

-> Screenshot of time tab

The next tab controls the source of the data. All instances and tags currently associated with your account, as of your login, are auto-discovered and displayed here, alphabetically. You may select one or more instances by their ID(s). Or, you may instead select one or more tag name(s), and the appropriate instances will be pulled. This list is currently not updated automatically, so if any new ones are created, you will need to logout and log back in.

-> Screenshot of instance/tag tab

The final tab controls what data is pulled for each instance. You may select one or more of the metrics displayed. Each metric will be plotted separately.

-> Screenshot of metric tab

With your options set, we can finally push the "Pull Metrics" Button. Depending on how many instances are being analyzed, this might take a while. But, you can see your progress displayed as data is pulled down. Each metric gets its own plot, and these plots take up the whole window.

If you hover your cursor over a plot, you will notice a tooltip appears. This helpful feature gives you detailed information on the instance you're examining. You have access to detailed timestamp and tagging information, right there in the plot. So, go forth and see it for yourself!!

-> Screenshot of plot demo

Technologies Used

Details

The Panda Panopticon consists of a user-facing client and proxy server to secure credentials and prevent cross-origin requests.

Proxy Server

This is relatively lightweight and implemented in vanilla Node. The client-to-server connection is secured by forcing HTTPS protocol. When pulling data from Amazon, the 'aws-sdk' module offers SSL protection within its API calls. Basic files for the app use GET requests to the server and are fulfilled with simple static serving, implemented by the 'node-static' module.

Logging in and requesting data are sent as POST requests for more specialized handling. After successful login, the sever will assign a unique random token to the client for identification. Credentials are stored on the server for 24 hours and pulled when presented with the correct token. Credentials are not stored within the client.

Client

This is the main user interface. Buttons and other elements on-screen are powered by Google's Polymer elements. JavaScript for the client page is generated from CoffeeScript. Seek the *.coffee file for annotated code.

After logging in, the credentials are removed from memory and the input fields as a security precaution. The server returns a token that is used for identification in their place. The "Options" dialog is programmatically populated with instance IDs and tag names.

When the "Pull Metrics" button is pressed, the client makes a sequence of calls to the server, making one request per instance per metric. This is done to maximize the number of data points that can be pulled from Amazon. Each response is parsed and sorted. Activity on each metric is displayed to the user using a progress bar.

When all the data for a single metric is collected, the HighCharts library is called to generate a plot. The data must conform to a specific format to display correctly. Special formatting was also employed on the plots' tooltip to display detail timestamp and tag associations.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].