From bdeb1fdf65d2ee2fe24babf859106506ba46e35e Mon Sep 17 00:00:00 2001 From: Georges Bossert Date: Mon, 2 May 2022 23:18:56 +0200 Subject: [PATCH 1/2] feat: add support for custom TIP --- sekoia.io/README/inputs.conf.spec | 1 + sekoia.io/app.manifest | 2 +- .../static/javascript/views/setup_page.js | 8 +-- .../javascript/views/setup_page_template.js | 8 +++ sekoia.io/bin/sekoia_indicators.py | 52 +++++++++++++++---- sekoia.io/default/app.conf | 2 +- sekoia.io/default/data/ui/views/dashboard.xml | 7 ++- 7 files changed, 64 insertions(+), 16 deletions(-) diff --git a/sekoia.io/README/inputs.conf.spec b/sekoia.io/README/inputs.conf.spec index 7292bba..9001995 100644 --- a/sekoia.io/README/inputs.conf.spec +++ b/sekoia.io/README/inputs.conf.spec @@ -3,3 +3,4 @@ python.version = python3 api_key = feed_id = proxy_url = +api_root_url = diff --git a/sekoia.io/app.manifest b/sekoia.io/app.manifest index 8b619cd..a65d583 100644 --- a/sekoia.io/app.manifest +++ b/sekoia.io/app.manifest @@ -5,7 +5,7 @@ "id": { "group": null, "name": "sekoia.io", - "version": "1.1.2" + "version": "1.2.0" }, "author": [ { diff --git a/sekoia.io/appserver/static/javascript/views/setup_page.js b/sekoia.io/appserver/static/javascript/views/setup_page.js index 0067ecf..1a226b6 100644 --- a/sekoia.io/appserver/static/javascript/views/setup_page.js +++ b/sekoia.io/appserver/static/javascript/views/setup_page.js @@ -34,6 +34,7 @@ define(["backbone", "jquery", "splunkjs/splunk"], function (Backbone, jquery, sp jquery("#api_key").val(input["api_key"]); jquery("#feed_id").val(input["feed_id"]); jquery("#proxy_url").val(input["proxy_url"]); + jquery("#api_root_url").val(input["api_root_url"]); } Object.keys(this.current_settings["lookups"]).forEach((name) => { @@ -134,15 +135,16 @@ define(["backbone", "jquery", "splunkjs/splunk"], function (Backbone, jquery, sp const feed_settings = { api_key: "", feed_id: feed_id, - proxy_url: values[2].value.trim(), + api_root_url: values[2].value.trim(), + proxy_url: values[3].value.trim(), }; // Extract Lookups const lookups = new Array(); var i = 0; - while (i * 3 + 3 < values.length) { - const offset = 3 + i * 3; + while (i * 3 + 4 < values.length) { + const offset = 4 + i * 3; lookups.push({ type: values[offset].value.trim(), query: values[offset + 1].value.trim(), diff --git a/sekoia.io/appserver/static/javascript/views/setup_page_template.js b/sekoia.io/appserver/static/javascript/views/setup_page_template.js index ad951ab..06c3195 100644 --- a/sekoia.io/appserver/static/javascript/views/setup_page_template.js +++ b/sekoia.io/appserver/static/javascript/views/setup_page_template.js @@ -52,6 +52,14 @@ function get_template() { You can find more information on feeds in the documentation.

+ +

+ (optional) URL root of your SEKOIA.IO TIP API (e.g. https://api.sekoia.io or https://my.sekoiaio.tip.local/api) +

+