Skip to content

Commit b49d405

Browse files
author
Robin Duda
committed
Prepare for release: fix install issues and updated readme.
1 parent c9f9677 commit b49d405

File tree

5 files changed

+55
-11
lines changed

5 files changed

+55
-11
lines changed

README.md

+49-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,59 @@
11
# kbn-authentication-plugin [![Build Status](https://travis-ci.org/codingchili/kbn-authentication-plugin.svg?branch=master)](https://travis-ci.org/codingchili/kbn-authentication-plugin)
2-
Plugin provides authentication through LDAP with 2-factor OTP authentication.
2+
A plugin adds authentication to Kibana dashboards!
33

4-
To install on a Kibana dashboard instance, move to kibana/installedPlugins/
4+
5+
#### Building the plugin
6+
To check out the sources and build the plugin do the following
57
```
68
git clone https://github.com/codingchili/kbn-authentication-plugin
79
cd kbn-authentication-plugin
8-
mocha test/
10+
npm install --arch=ia32
11+
mocha test --recursive -u tdd
12+
```
13+
Perform the following steps to create an installable zip:
14+
1. Set the kibana version in package.json, must match exactly.
15+
1. move kbn-authentication-plugin into a folder named 'kibana'.
16+
2. Create a zip file that includes the 'kibana' folder.
17+
4. The plugin can then be installed with the kibana-plugin install command, see installing.
18+
19+
##### Dependencies
20+
21+
- NodeJS 6.*
22+
- NPM
23+
- MS Build tools
24+
- Python 2.7
25+
26+
To compile the binary module argon2-ffi build tools are requried, install with
27+
```
28+
npm install --global --production windows-build-tools
29+
```
30+
This installs MS build tools and python 2.7 and is required for node-gyp to work.
31+
32+
#### Installing
33+
To install the plugin use the kibana-plugin utility, example:
34+
```
35+
./kibana-plugin install 'file:///C:/users/downloads/kbn-authentication-plugin.zip'
936
```
1037
Make sure to set the correct version in json.config. The version must match the version of Kibana being used.
1138

12-
If the Kibana instance is already running it may be set to reload all plugins on change, if not then try restarting the instance. The authentication plugin is tested working with Kibana version 5.0.0-alpha1.
39+
#### Features
40+
- two factor authentication with [time based tokens](https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm).
41+
- supports scanning a barcode in the [Google Authenticator](https://www.google.se/search?q=Google+authenticator) app for example.
42+
- supports storing user credentials and keys in a simple json file.
43+
- supports storing user credentials and keys in [MongoDB](https://www.mongodb.com/).
44+
- supports storing user credentials in [LDAP](https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol) and keys in a json file.
45+
- json web token authentication using Kibanas bundled HAPI package.
46+
- uses the password hashing contest winner of 2017 for password hashing!
47+
- See: [Argon2](https://password-hashing.net/)
48+
49+
##### Troubleshooting
50+
If the Kibana instance is already running it may be set to reload all plugins on change, if not then try restarting the instance. The authentication plugin is tested working with Kibana version 5.6.2.
51+
52+
If you have issues installing the plugin,
53+
- make sure that the version in package.json is matching your kibana version.
54+
- make sure to build with --arch=ia32 as kibana ships with a bundled x86 nodejs for windows.
1355

14-
The plugin is not ready for release yet, currently working with two-factor (TOTP RFC 6238, using QR for distribution) and LDAP authentication. All routes are protected by authentication by default.
1556

16-
Multi-user capabilities is not yet working fully, all authenticated users share the same indice and dashboards. Multi-user capabilities is implemented by overriding all the routing present in kibana through a proxy, it is a tedious and fail-prone mission. As such access restriction to only allow access to the proxy server is pointless at this stage, users may as well authenticate directly with the Kibana instance.
57+
##### Known issues
58+
Multi-user capabilities is completed, all authenticated users share the same indice and dashboards.
59+
No plans on implementing this for now.

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Authentication = require('./src/authentication/auth');
1818

1919

2020
module.exports = function (kibana) {
21-
console.log('WHAT UP');
21+
console.log('kibana authentication plugin by codingchili@github init!');
2222

2323
return new kibana.Plugin({
2424

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kbn-authentication-plugin",
3-
"version": "5.4.2",
3+
"version": "5.6.2",
44
"description": "Prevents unauthorized access to kbn dashboards.",
55
"repository": "https://github.com/codingchili/kbn-authentication-plugin",
66
"license": "MIT",

public/login.jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ html(lang="EN")
3131
input(type="button", value="LOGIN", onclick='submit();')#submit.button
3232

3333
div.page-footer
34-
h4.page-footer-text ©2017
34+
h5.page-footer-text ©2017 Robin Duda
3535
script
3636
include script/jquery-2.2.3.min.js
3737
include script/login.js

src/authentication/file.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,22 @@
77
const Config = require('../config').load('file');
88
const Hash = require('./hash');
99
const fs = require('fs');
10+
const filePath = require('path').resolve(__dirname, '../../' + Config.filename);
1011
let users = [];
1112

1213

1314
function load() {
1415
let data = '{}';
1516
try {
16-
data = fs.readFileSync(Config.filename, {});
17+
data = fs.readFileSync(filePath, 'utf-8');
1718
} catch (e) {
1819
throw e;
1920
}
2021
users = JSON.parse(data);
2122
}
2223

2324
function save(callback) {
24-
fs.writeFile(Config.filename, JSON.stringify(users), (err) => {
25+
fs.writeFile(filePath, JSON.stringify(users), (err) => {
2526
if (err) {
2627
throw err;
2728
} else {

0 commit comments

Comments
 (0)