From dec31cb94d3aa08c55a7f178076b50b58946f852 Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Tue, 23 Apr 2019 15:07:21 -0700 Subject: [PATCH 01/44] update jquery ( meteor npm audit fix --force) --- meteor/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meteor/package.json b/meteor/package.json index 56227733f..67518731d 100644 --- a/meteor/package.json +++ b/meteor/package.json @@ -11,7 +11,7 @@ "@babel/runtime": "^7.1.2", "bcrypt": "^3.0.1", "dc": "^2.1.10", - "jquery": "^1.12.3", + "jquery": "^3.4.0", "jquery-ui": "^1.12.1", "meteor-node-stubs": "^0.4.1", "pivottable": "^2.22.0", From 6f00f5bebcc4bd4a7e56bc9d687775ff75a52e9c Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Tue, 23 Apr 2019 15:07:55 -0700 Subject: [PATCH 02/44] update jquery (package lock) --- meteor/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meteor/package-lock.json b/meteor/package-lock.json index 3b1c4ab2d..2f59c3e14 100644 --- a/meteor/package-lock.json +++ b/meteor/package-lock.json @@ -464,9 +464,9 @@ } }, "jquery": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-1.12.3.tgz", - "integrity": "sha512-FzM42/Ew+Hb8ha2OlhHRBLgWIZS32gZ0+NvWTf+ZvVvGaIlJkOiXQyb7VBjv4L6fJfmTrRf3EsAmbfsHDhfemw==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.0.tgz", + "integrity": "sha512-ggRCXln9zEqv6OqAGXFEcshF5dSBvCkzj6Gm2gzuR5fWawaX8t7cxKVkkygKODrDAzKdoYw3l/e3pm3vlT4IbQ==" }, "jquery-ui": { "version": "1.12.1", From 84af2e48ec2e23f4059de540ab923e2462332d75 Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Tue, 23 Apr 2019 15:09:07 -0700 Subject: [PATCH 03/44] revert a version of bootstrap to allow newer jquery --- meteor/.meteor/versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meteor/.meteor/versions b/meteor/.meteor/versions index 8857b1942..12dd02602 100644 --- a/meteor/.meteor/versions +++ b/meteor/.meteor/versions @@ -98,7 +98,7 @@ templating-compiler@1.3.3 templating-runtime@1.3.2 templating-tools@1.1.2 tracker@1.2.0 -twbs:bootstrap@3.3.6 +twbs:bootstrap@3.3.5 ui@1.0.13 underscore@1.0.10 url@1.2.0 From f4be6392c8fca1fd60b0030a93a6cb10d8b26257 Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Sat, 27 Apr 2019 16:53:19 -0700 Subject: [PATCH 04/44] formatting --- meteor/client/menu.js | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/meteor/client/menu.js b/meteor/client/menu.js index 02d688c7b..5ad611a7e 100644 --- a/meteor/client/menu.js +++ b/meteor/client/menu.js @@ -2,31 +2,36 @@ import { Meteor } from 'meteor/meteor'; import { Template } from 'meteor/templating'; import { Tracker } from 'meteor/tracker' -Template.menu.rendered = function () { - Tracker.autorun(function() { - Meteor.subscribe("features"); - }); +Template.menu.rendered = function() { + Tracker.autorun( function() { + Meteor.subscribe( "features" ); + } ); }; -Template.menu.helpers({ - haveFeatures: function(){ +Template.menu.helpers( { + haveFeatures: function() { //subscription has records? - return features.find().count() >0; + return features.find().count() > 0; }, - resolveKibanaURL: function(url){ + resolveKibanaURL: function( url ) { // special function just for the menu // to adjust the kibana URL if we are told to make it 'relative' // to whatever DNS name we are running on // i.e. pass in http://relative:9090/app/kibana // when the running dns is something.com // and we will set the hostname to something.com instead of 'relative' - var kibanaURL = new URL(url); - if ( kibanaURL.hostname == 'relative' ){ + var kibanaURL = new URL( url ); + if ( kibanaURL.hostname == 'relative' ) { // we were passed something like OPTIONS_METEOR_KIBANAURL=http://relative:9090/app/kibana // so lets figure out where we should be - dnsURL=new URL(document.URL); + dnsURL = new URL( document.URL ); kibanaURL.hostname = dnsURL.hostname; } return kibanaURL; + }, + // loads kibana dashboards + kibanadashboards: function() { + Meteor.call( 'loadKibanaDashboards' ); + return kibanadashboards.find(); } - }); +} ); From f2dcd2e21024b5be22c7d8ea44e1e13a269ea965 Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Sat, 27 Apr 2019 16:53:45 -0700 Subject: [PATCH 05/44] require at the end, when functions are available --- meteor/client/mozdef.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/meteor/client/mozdef.js b/meteor/client/mozdef.js index ffa742bf5..b9bd7d040 100644 --- a/meteor/client/mozdef.js +++ b/meteor/client/mozdef.js @@ -14,8 +14,7 @@ import '/client/js/jquery.highlight.js'; import PNotify from 'pnotify'; import 'pnotify/dist/pnotify.css'; import './mozdef.html'; -import './menu.html'; -import './menu.js'; +// import './menu.js'; import '/client/layout.js'; import '/public/css/dropdowns.css'; @@ -36,8 +35,6 @@ if ( Meteor.isClient ) { Session.set( 'blockFQDN', '' ); Session.set( 'watchItemwatchcontent', '' ); getAllPlugins(); - // use a default theme, overridden later by login per user - require( '/imports/themes/classic/mozdef.css' ); } ); prefs = function() { @@ -185,14 +182,6 @@ if ( Meteor.isClient ) { } } ); - // loads kibana dashboards - Template.menu.helpers( { - kibanadashboards: function() { - Meteor.call( 'loadKibanaDashboards' ); - return kibanadashboards.find(); - } - } ); - UI.registerHelper( 'isFeature', function( featureName ) { return isFeature( featureName ); } ); @@ -504,6 +493,8 @@ if ( Meteor.isClient ) { require( '/imports/themes/dark/mozdef.css' ); } else if ( preferenceRecord.theme == 'Light' ) { require( '/imports/themes/light/mozdef.css' ) + } else if ( preferenceRecord.theme == 'Dark Side Nav' ) { + require( '/imports/themes/side_nav_dark/mozdef.css' ) } else { require( '/imports/themes/classic/mozdef.css' ); } @@ -511,4 +502,10 @@ if ( Meteor.isClient ) { } ); } ); + + // finally, load the default starting point + // use a default theme, overridden later by login per user + require( '/imports/themes/none/mozdef.css' ); + require( '/imports/themes/none/menu.html' ); + require( './menu.js' ); } \ No newline at end of file From 0ffbbed5711ae04bfa3c8e171f398c84a49867ec Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Wed, 1 May 2019 16:22:42 -0700 Subject: [PATCH 06/44] separate out greeting, etc --- meteor/client/greeting.html | 8 +++++++ meteor/client/greeting.js | 17 ++++++++++++++ meteor/client/loading.html | 3 +++ meteor/client/main.js | 10 ++++++-- meteor/client/mozdef.html | 47 +++++++++---------------------------- 5 files changed, 47 insertions(+), 38 deletions(-) create mode 100644 meteor/client/greeting.html create mode 100644 meteor/client/greeting.js create mode 100644 meteor/client/loading.html diff --git a/meteor/client/greeting.html b/meteor/client/greeting.html new file mode 100644 index 000000000..bf2e5d48c --- /dev/null +++ b/meteor/client/greeting.html @@ -0,0 +1,8 @@ + + \ No newline at end of file diff --git a/meteor/client/greeting.js b/meteor/client/greeting.js new file mode 100644 index 000000000..e8343074d --- /dev/null +++ b/meteor/client/greeting.js @@ -0,0 +1,17 @@ +if ( Meteor.isClient ) { + + Template.hello.helpers( { + greeting: function() { + if ( typeof console !== 'undefined' ) + console.log( "mozdef starting" ); + return "MozDef: The Mozilla Defense Platform"; + } + } ); + + Template.hello.events( { + 'click': function() { + // template data, if any, is available in 'this' + Session.set( 'displayMessage', 'Welcome & to mozdef.' ) + } + } ); +}; \ No newline at end of file diff --git a/meteor/client/loading.html b/meteor/client/loading.html new file mode 100644 index 000000000..0368bee4d --- /dev/null +++ b/meteor/client/loading.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/meteor/client/main.js b/meteor/client/main.js index 22061f018..b36205834 100644 --- a/meteor/client/main.js +++ b/meteor/client/main.js @@ -5,11 +5,16 @@ import { Mongo } from 'meteor/mongo'; import { Session } from 'meteor/session'; import { _ } from 'meteor/underscore'; import { Blaze } from 'meteor/blaze'; +import '/client/loading.html'; +import '/client/greeting.html'; +import '/client/greeting.js'; import '/imports/settings.js'; import '/imports/collections.js'; import '/imports/helpers.js'; import '/imports/models.js'; -import '/client/about.html'; +import '/client/mozdef.html'; +import '/client/layout.js'; +import '/client/router.js'; import '/client/alertdetails.html'; import '/client/alertdetails.js'; import '/client/alertssummary.html'; @@ -54,11 +59,12 @@ import '/client/logincounts.html'; import '/client/logincounts.js'; import '/client/mozdefhealth.html'; import '/client/mozdefhealth.js'; +import '/client/about.html'; import '/client/nameplate.html'; import '/client/nameplate.js'; import '/client/verisTags.html'; import '/client/preferences.html'; import '/client/preferences.js' -import '/client/router.js'; +import '/public/css/dropdowns.css'; import '/client/mozdef.js'; diff --git a/meteor/client/mozdef.html b/meteor/client/mozdef.html index 1812b1628..dd13a3893 100644 --- a/meteor/client/mozdef.html +++ b/meteor/client/mozdef.html @@ -17,52 +17,27 @@ - - - \ No newline at end of file + From 43d7877dc0be8b4aaee6c3c91e5e95a81ccba94e Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Wed, 1 May 2019 16:23:16 -0700 Subject: [PATCH 07/44] formatting --- meteor/client/mozdefhealth.js | 136 +++++++++++++++++----------------- 1 file changed, 67 insertions(+), 69 deletions(-) diff --git a/meteor/client/mozdefhealth.js b/meteor/client/mozdefhealth.js index d444e6da0..a28dead13 100644 --- a/meteor/client/mozdefhealth.js +++ b/meteor/client/mozdefhealth.js @@ -5,119 +5,117 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. Copyright (c) 2014 Mozilla Corporation */ import { Template } from 'meteor/templating'; -import '/imports/collections.js'; -import '/imports/settings.js'; -import '/imports/helpers.js'; -import '/client/router.js'; -import '/client/mozdef.js'; import crossfilter from 'crossfilter2'; import dc from 'dc'; import 'dc/dc.css'; import { tooltip } from 'meteor/twbs:bootstrap'; -if (Meteor.isClient) { +if ( Meteor.isClient ) { //elastic search cluster template functions //return es health items - Template.mozdefhealth.helpers({ + Template.mozdefhealth.helpers( { - esclusterhealthitems: function () { + esclusterhealthitems: function() { return healthescluster.find(); }, - frontendhealthitems: function () { - return healthfrontend.find({}, - {fields:{}, - sort: {hostname: 1} - }); + frontendhealthitems: function() { + return healthfrontend.find( {}, + { + fields: {}, + sort: { hostname: 1 } + } ); }, - sqsstatsitems: function () { - return sqsstats.find({}, - {fields:{}, - sort: {hostname: 1} - }); + sqsstatsitems: function() { + return sqsstats.find( {}, + { + fields: {}, + sort: { hostname: 1 } + } ); }, - esnodeshealthitems: function () { - return healthesnodes.find({}, - {fields:{}, - sort: {hostname: 1} - }); + esnodeshealthitems: function() { + return healthesnodes.find( {}, + { + fields: {}, + sort: { hostname: 1 } + } ); }, - eshotthreadshealthitems: function () { + eshotthreadshealthitems: function() { return healtheshotthreads.find(); } - }); + } ); - Template.mozdefhealth.rendered = function () { - var ringChartEPS = dc.pieChart("#ringChart-EPS"); - var totalEPS = dc.numberDisplay("#total-EPS"); - var ringChartLoadAverage = dc.pieChart("#ringChart-LoadAverage"); + Template.mozdefhealth.rendered = function() { + var ringChartEPS = dc.pieChart( "#ringChart-EPS" ); + var totalEPS = dc.numberDisplay( "#total-EPS" ); + var ringChartLoadAverage = dc.pieChart( "#ringChart-LoadAverage" ); - refreshChartData=function(){ - var frontEndData=healthfrontend.find({}).fetch(); - var ndx = crossfilter(frontEndData); + refreshChartData = function() { + var frontEndData = healthfrontend.find( {} ).fetch(); + var ndx = crossfilter( frontEndData ); - if ( frontEndData.length === 0 && ndx.size()>0){ - debugLog('clearing ndx/dc.js'); + if ( frontEndData.length === 0 && ndx.size() > 0 ) { + debugLog( 'clearing ndx/dc.js' ); dc.filterAll(); ndx.remove(); dc.redrawAll(); } else { - ndx = crossfilter(frontEndData); + ndx = crossfilter( frontEndData ); } - if ( ndx.size() >0){ - var hostDim = ndx.dimension(function(d) {return d.hostname;}); - var hostEPS = hostDim.group().reduceSum(function(d) {return d.details.total_deliver_eps.toFixed(2);}); - var hostLoadAverage = hostDim.group().reduceSum(function(d) {return d.details.loadaverage[0];}); - var epsTotal = ndx.groupAll().reduceSum(function(d) {return d.details.total_deliver_eps;}); + if ( ndx.size() > 0 ) { + var hostDim = ndx.dimension( function( d ) { return d.hostname; } ); + var hostEPS = hostDim.group().reduceSum( function( d ) { return d.details.total_deliver_eps.toFixed( 2 ); } ); + var hostLoadAverage = hostDim.group().reduceSum( function( d ) { return d.details.loadaverage[0]; } ); + var epsTotal = ndx.groupAll().reduceSum( function( d ) { return d.details.total_deliver_eps; } ); totalEPS - .valueAccessor(function(d){return d;}) - .group(epsTotal); + .valueAccessor( function( d ) { return d; } ) + .group( epsTotal ); ringChartEPS - .width(150).height(150) - .dimension(hostDim) - .group(hostEPS) - .label(function(d) {return d.value ||''; }) - .innerRadius(30) - .filter = function() {}; + .width( 150 ).height( 150 ) + .dimension( hostDim ) + .group( hostEPS ) + .label( function( d ) { return d.value || ''; } ) + .innerRadius( 30 ) + .filter = function() { }; ringChartLoadAverage - .width(150).height(150) - .dimension(hostDim) - .group(hostLoadAverage) - .label(function(d) {return d.value ||''; }) - .innerRadius(30) - .filter = function() {}; + .width( 150 ).height( 150 ) + .dimension( hostDim ) + .group( hostLoadAverage ) + .label( function( d ) { return d.value || ''; } ) + .innerRadius( 30 ) + .filter = function() { }; dc.renderAll(); } } - Deps.autorun(function() { - Meteor.subscribe("healthfrontend",onReady=function(){ + Deps.autorun( function() { + Meteor.subscribe( "healthfrontend", onReady = function() { refreshChartData(); - }); - Meteor.subscribe("sqsstats"); - Meteor.subscribe("healthescluster"); - Meteor.subscribe("healthesnodes"); - Meteor.subscribe("healtheshotthreads"); + } ); + Meteor.subscribe( "sqsstats" ); + Meteor.subscribe( "healthescluster" ); + Meteor.subscribe( "healthesnodes" ); + Meteor.subscribe( "healtheshotthreads" ); //using dc.js doesn't trigger the reactive update //so update a UI object and refresh dc.js so both get data when it updates. var obj = healthfrontend.findOne(); - if (obj) { - $('.lastupdate').text('Last Update: ' + obj.utctimestamp); - refreshChartData(); + if ( obj ) { + $( '.lastupdate' ).text( 'Last Update: ' + obj.utctimestamp ); + refreshChartData(); } - }); //end deps.autorun + } ); //end deps.autorun - this.$('[data-toggle="tooltip"]').tooltip({ + this.$( '[data-toggle="tooltip"]' ).tooltip( { 'placement': 'top' - }); - }; + } ); + }; - Template.mozdefhealth.destroyed = function () { + Template.mozdefhealth.destroyed = function() { dc.deregisterAllCharts(); }; } \ No newline at end of file From 1a529eddbf81c4d8c71a1bb6b2412b1fca9a221f Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Wed, 1 May 2019 16:23:30 -0700 Subject: [PATCH 08/44] fix imports, dynamic menu option --- meteor/client/mozdef.js | 53 +++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/meteor/client/mozdef.js b/meteor/client/mozdef.js index b9bd7d040..bb6e42001 100644 --- a/meteor/client/mozdef.js +++ b/meteor/client/mozdef.js @@ -5,18 +5,13 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. Copyright (c) 2014 Mozilla Corporation */ import { Meteor } from 'meteor/meteor'; -import { Template } from 'meteor/templating'; import validator from 'validator'; -import '/imports/collections.js'; -import '/imports/settings.js'; -import '/imports/helpers.js'; -import '/client/js/jquery.highlight.js'; -import PNotify from 'pnotify'; import 'pnotify/dist/pnotify.css'; -import './mozdef.html'; +import PNotify from 'pnotify'; +// import './mozdef.html'; // import './menu.js'; -import '/client/layout.js'; -import '/public/css/dropdowns.css'; +//import '/client/layout.js'; + @@ -34,7 +29,9 @@ if ( Meteor.isClient ) { Session.set( 'blockIPipaddress', '' ); Session.set( 'blockFQDN', '' ); Session.set( 'watchItemwatchcontent', '' ); + Session.set( 'menuname', 'menu' ); getAllPlugins(); + } ); prefs = function() { @@ -167,21 +164,6 @@ if ( Meteor.isClient ) { return result }; - Template.hello.helpers( { - greeting: function() { - if ( typeof console !== 'undefined' ) - console.log( "mozdef starting" ); - return "MozDef: The Mozilla Defense Platform"; - } - } ); - - Template.hello.events( { - 'click': function() { - // template data, if any, is available in 'this' - Session.set( 'displayMessage', 'Welcome & to mozdef.' ) - } - } ); - UI.registerHelper( 'isFeature', function( featureName ) { return isFeature( featureName ); } ); @@ -369,6 +351,10 @@ if ( Meteor.isClient ) { } } ) + UI.registerHelper( 'menuName', function() { + return Session.get( 'menuname' ); + } ) + //Notify messages for the UI Deps.autorun( function() { //set Session.set('displayMessage','title&text') @@ -487,14 +473,18 @@ if ( Meteor.isClient ) { } else { //console.log( 'client found preferences', preferenceRecord ); - // import the preferred theme elements + // html must be 'imported' from somewhere other than the 'import' + // directory (hence the duplicate themes directory) if ( preferenceRecord.theme == 'Dark' ) { require( '/imports/themes/dark/mozdef.css' ); } else if ( preferenceRecord.theme == 'Light' ) { require( '/imports/themes/light/mozdef.css' ) } else if ( preferenceRecord.theme == 'Dark Side Nav' ) { - require( '/imports/themes/side_nav_dark/mozdef.css' ) + require( '/client/themes/side_nav_dark/menu.html' ) + require( '/imports/themes/side_nav_dark/menu.js' ) + Session.set( 'menuname', 'side_nav_menu' ); + require( '/imports/themes/side_nav_dark/mozdef.css' ); } else { require( '/imports/themes/classic/mozdef.css' ); } @@ -503,9 +493,10 @@ if ( Meteor.isClient ) { } ); - // finally, load the default starting point - // use a default theme, overridden later by login per user - require( '/imports/themes/none/mozdef.css' ); - require( '/imports/themes/none/menu.html' ); - require( './menu.js' ); + // finally,load the default starting point + // use a default theme and menu, overridden later by login per user preference + require( '/client/themes/none/menu-start.html' ); + require( '/client/themes/none/menu-start.css' ); + require( '/client/menu.html' ); + require( '/client/menu.js' ); } \ No newline at end of file From b7159f943a2e29de8e2ba19fb6a9487af1da3644 Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Wed, 1 May 2019 16:24:03 -0700 Subject: [PATCH 09/44] add theme and menu/css logic --- meteor/client/preferences.html | 1 + meteor/client/themes/classic/menu.html | 100 +++ meteor/client/themes/none/menu-start.css | 25 + meteor/client/themes/none/menu-start.html | 16 + meteor/client/themes/side_nav_dark/menu.html | 187 +++++ meteor/imports/themes/classic/mozdef.css | 2 +- meteor/imports/themes/light/mozdef.css | 71 +- meteor/imports/themes/side_nav_dark/menu.js | 37 + .../imports/themes/side_nav_dark/mozdef.css | 700 ++++++++++++++++++ 9 files changed, 1135 insertions(+), 4 deletions(-) create mode 100644 meteor/client/themes/classic/menu.html create mode 100644 meteor/client/themes/none/menu-start.css create mode 100644 meteor/client/themes/none/menu-start.html create mode 100644 meteor/client/themes/side_nav_dark/menu.html create mode 100644 meteor/imports/themes/side_nav_dark/menu.js create mode 100644 meteor/imports/themes/side_nav_dark/mozdef.css diff --git a/meteor/client/preferences.html b/meteor/client/preferences.html index 66353f581..9b532b144 100644 --- a/meteor/client/preferences.html +++ b/meteor/client/preferences.html @@ -35,6 +35,7 @@ + diff --git a/meteor/client/themes/classic/menu.html b/meteor/client/themes/classic/menu.html new file mode 100644 index 000000000..f789edbc2 --- /dev/null +++ b/meteor/client/themes/classic/menu.html @@ -0,0 +1,100 @@ + + + + + + diff --git a/meteor/client/themes/none/menu-start.css b/meteor/client/themes/none/menu-start.css new file mode 100644 index 000000000..1006ac398 --- /dev/null +++ b/meteor/client/themes/none/menu-start.css @@ -0,0 +1,25 @@ +/* default start/login css */ +:root { + --bg-primary-color: rgb(32,87,153); + --bg-secondary-color: #444444; + --txt-primary-color: #fff; + --txt-secondary-color: #000; + --txt-shadow-color: #000; + --txt-highlight-color: rgba(165, 170, 172, 0.904); + --a-link-color: rgb(245, 222, 179); + --row-color-odd: rgba(30,87,153,.7); + --row-color-even: #636c85; + } + +html{ + background: none; + min-height: 100%; +} + +body{ + background: var(--bg-primary-color); + padding: 0; + color: var(--txt-primary-color); + line-height: normal; + text-align: left; +} \ No newline at end of file diff --git a/meteor/client/themes/none/menu-start.html b/meteor/client/themes/none/menu-start.html new file mode 100644 index 000000000..b3fe0cb8c --- /dev/null +++ b/meteor/client/themes/none/menu-start.html @@ -0,0 +1,16 @@ + + + + diff --git a/meteor/client/themes/side_nav_dark/menu.html b/meteor/client/themes/side_nav_dark/menu.html new file mode 100644 index 000000000..15de6b0b4 --- /dev/null +++ b/meteor/client/themes/side_nav_dark/menu.html @@ -0,0 +1,187 @@ + + + + + diff --git a/meteor/imports/themes/classic/mozdef.css b/meteor/imports/themes/classic/mozdef.css index c1cd3c0be..e50df66c0 100644 --- a/meteor/imports/themes/classic/mozdef.css +++ b/meteor/imports/themes/classic/mozdef.css @@ -5,7 +5,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. Copyright (c) 2014 Mozilla Corporation */ -/* variables */ +/* classic theme variables */ :root { --bg-primary-color: rgb(32,87,153); --bg-secondary-color: #444444; diff --git a/meteor/imports/themes/light/mozdef.css b/meteor/imports/themes/light/mozdef.css index c8cfd8aa5..02e1e81a3 100644 --- a/meteor/imports/themes/light/mozdef.css +++ b/meteor/imports/themes/light/mozdef.css @@ -5,7 +5,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. Copyright (c) 2014 Mozilla Corporation */ -/* variables */ +/* light theme variables */ :root { --bg-primary-color: rgba(255,255,255,.5); --bg-secondary-color: #444444; @@ -608,6 +608,17 @@ sidenav /* Second-level Menu Items */ +#nav-main li:hover ul, +.js #nav-main li.hover ul { + margin-top: 2.5em; + left: 0; + opacity: 1; + -moz-transition: opacity 0.2s ease-in-out; + -webkit-transition: opacity 0.2s ease-in-out; + -o-transition: opacity 0.2s ease-in-out; + transition: opacity 0.2s ease-in-out; +} + #nav-main ul ul, #nav-main ul ul li { height: auto; @@ -641,7 +652,7 @@ sidenav #nav-main ul ul a:link, #nav-main ul ul a:visited { overflow: hidden; - color: #fff; + color: #000; padding: 3px 10px; margin: 0px; height: auto; @@ -656,11 +667,65 @@ sidenav #nav-main ul ul a:hover, #nav-main ul ul a:focus, #nav-main ul ul a:active { - color: #fff; + color: #000; background: rgb(227,235,244); background: rgba(241,248,254,0.2); } +/* Currently active menu items */ +#nav-main ul li.current span, +#nav-main ul li.current a, +#nav-main ul li.current a:link, +#nav-main ul li.current a:visited { + border-bottom-width: 1px; + -moz-border-radius: 0 0 4px 4px; + -webkit-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; + background: #fbfdff; + background: -moz-linear-gradient(top, rgba(255,255,255,0.4) 0%, + rgba(255,255,255,0.8) 100%); + box-shadow: + rgba(152,178,201,0.2) 0 0px 0px, + inset rgba(152,178,201,0.3) 0 -2px 0, + inset rgba(255,255,255,0.8) 0 -6px 6px 4px; + -moz-box-shadow: + rgba(152,178,201,0.2) 0 0px 0px, + inset rgba(152,178,201,0.3) 0 -2px 0, + inset rgba(255,255,255,0.8) 0 -6px 6px 4px; + -webkit-box-shadow: + rgba(152,178,201,0.2) 0 0px 0px, + inset rgba(152,178,201,0.3) 0 -2px 0, + inset rgba(255,255,255,0.8) 0 -6px 6px 4px; + padding-right: 30px; + padding-bottom: 15px; +} + +#nav-main ul li.current:hover a, +#nav-main ul li.current.hover a, +#nav-main ul li.current a:hover, +#nav-main ul li.current a:focus, +#nav-main ul li.current a:active, +.js #nav-main ul li.current a:focus { + box-shadow: none; + -moz-box-shadow: none; + -webbkit-box-shadow: none; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + border-bottom: 0; +} + +#nav-main ul li.current ul span, +#nav-main ul li.current ul a, +#nav-main ul li.current ul a:link, +#nav-main ul li.current ul a:visited { + background: none; + height: auto; + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + padding: 8px 10px; +} .mousepointer { diff --git a/meteor/imports/themes/side_nav_dark/menu.js b/meteor/imports/themes/side_nav_dark/menu.js new file mode 100644 index 000000000..bb3b80d72 --- /dev/null +++ b/meteor/imports/themes/side_nav_dark/menu.js @@ -0,0 +1,37 @@ +import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; +import { Tracker } from 'meteor/tracker' + +Template.side_nav_menu.rendered = function() { + Tracker.autorun( function() { + Meteor.subscribe( "features" ); + } ); +}; + +Template.side_nav_menu.helpers( { + haveFeatures: function() { + //subscription has records? + return features.find().count() > 0; + }, + resolveKibanaURL: function( url ) { + // special function just for the menu + // to adjust the kibana URL if we are told to make it 'relative' + // to whatever DNS name we are running on + // i.e. pass in http://relative:9090/app/kibana + // when the running dns is something.com + // and we will set the hostname to something.com instead of 'relative' + var kibanaURL = new URL( url ); + if ( kibanaURL.hostname == 'relative' ) { + // we were passed something like OPTIONS_METEOR_KIBANAURL=http://relative:9090/app/kibana + // so lets figure out where we should be + dnsURL = new URL( document.URL ); + kibanaURL.hostname = dnsURL.hostname; + } + return kibanaURL; + }, + // loads kibana dashboards + kibanadashboards: function() { + Meteor.call( 'loadKibanaDashboards' ); + return kibanadashboards.find(); + } +} ); diff --git a/meteor/imports/themes/side_nav_dark/mozdef.css b/meteor/imports/themes/side_nav_dark/mozdef.css new file mode 100644 index 000000000..4f29ca1b9 --- /dev/null +++ b/meteor/imports/themes/side_nav_dark/mozdef.css @@ -0,0 +1,700 @@ +/* +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, You can obtain one at http://mozilla.org/MPL/2.0/. +Copyright (c) 2014 Mozilla Corporation +*/ + +/*side-nav-dark css */ +@import url('https://fonts.googleapis.com/css?family=Zilla+Slab+Highlight'); +@import url('https://fonts.googleapis.com/css?family=Zilla+Slab'); +@import url('https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css'); + +:root { + --primary-bg-color: #2a2f35; + --secondary-focus-color: #3b89ee; + --secondary-color: #2d5fa0; + --row-color-odd: #2a2f35; + --row-color-even: #636c85; + --ack-edit-color: #a2a9b2; + --ack-edit-border-color: #adadad; + --ack-edit-focus-color: #557750; + --ack-edit-disabled-color: #557750; + --arm-color: #e69006; + --arm-focus-color: #d58512; + --font-main: #fff; + --font-focus: #000; + --a-link-color: #a2a9b2; +} + +html{ + background: none; + min-height: 100%; +} + +body{ + /*gradient*/ + + background: rgb(42, 47, 53); /* Old browsers */ + background: -moz-radial-gradient(ellipse, rgb(99, 108, 118) 0%, rgb(42, 47, 53) 100%); /* FF3.6+ */ + background: -webkit-radial-gradient(ellipse, rgb(99, 108, 118) 0%, rgb(42, 47, 53) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-radial-gradient(ellipse, rgba(99, 108, 118, 1) 0%, rgb(42, 47, 53) 100%); /* Opera 11.10+ */ + background: radial-gradient(ellipse, rgb(99, 108, 118) 0%, rgb(42, 47, 53) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#636c76",endColorstr="#2a2f35",GradientType=1); /* IE6-9 fallback on horizontal gradient */ + + font-size: 14px; + /*margin: 0;*/ + /*min-width: 990px;*/ + padding: 0; + color: var(--font-main); + line-height: normal; + text-align: left; +} + +.container { + margin-top: 1%; +} + +/*mozdef custom */ +.upperwhite { + color: var(--font-main); + text-transform: uppercase; +} + +caption, legend { + color: var(--font-main); +} + +.shadow { + text-shadow: #000 .7px .7px .7px; +} + +.ipaddress { + color: var(--font-main); + font-style: normal; + font-weight: normal; + +} + +.headercontainer { + display: flex; + align-items: center; + justify-content: center; +} + +#header a.mozilla { + position: relative; + float: right; + display: block; + height: 40px; + width: 100px; + overflow: visible; +} + +#bottom-toolbar { + background: #636c76; + width: 100%; + height: 40px; + padding-left: 5px; + padding-top: 5px; + position: fixed; + bottom: 0; + opacity: .3; + z-index: 2; + font-size: 13px; + color: var(--font-main); +} + +#bottom-toolbar:hover { + opacity: 1; +} + +#bottom-toolbar .button { + margin: 3px 3px 3px 0; + padding: 2px 3px 2px 5px; + height: 13px; + line-height: 13px; +} + + +.attackshoverboard { + /*width: 500px;*/ + /*height: 500px;*/ + /*background-color: green;*/ + -moz-transform: scaleY(-1); + -webkit-transform: scaleY(-1); + -o-transform: scaleY(-1); + transform: scaleY(-1); + display: none; +} + +.dropdown-submenu{position:relative;} +.dropdown-submenu>.dropdown-menu{top:0;left:100%;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;} +.dropdown-submenu:active>.dropdown-menu, .dropdown-submenu:hover>.dropdown-menu { + display: block; + right:162px; +} +.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;} +.dropdown-submenu:active>a:after{border-left-color:#ffffff;} +.dropdown-submenu.pull-left{float:none;}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;} + + + +.attackercallout { + width: 120px; + height: 160px; + box-shadow: 0px 0px 12px rgba(0,255,255,0.5); + opacity: .5; + background: black; + border: 1px solid rgba(127,255,255,0.25); + text-align: center; + cursor: default; + z-index: 99; +} + + + +.attackercallout .id { + font-size: 12px; + color: rgba(127,255,255,0.75); +} + +.attackercallout .details { + text-align: left; + left: 2px; + font-size: 12px; + color: rgba(127,255,255,0.75); +} + +.attackercallout .blockip{ + color: #FFF; + text-transform: uppercase; + margin-top: 20px; +} +.attackercallout ul{ + list-style: none; + float: left; + left: auto; + margin: 0px; + padding: 0px; +} + +.attackercallout .indicator{ + color: yellow; +} +.attackercallout a{ + color: yellow; +} + +.veris-wrapper td{ + color: black +} + +.veris-wrapper { + background-color: rgba(245,245,245,.7) +} + +/*alerts screen alert color scheme*/ +.alert.alert-NOTICE { + --alert-bg-color: #4a6785; + --alert-color: white; +} +.alert.alert-WARNING { + --alert-bg-color: #ffd351; + --alert-color: black; +} +.alert.alert-CRITICAL { + --alert-bg-color: #d04437; + --alert-color: white; +} +.alert.alert-INFO { + --alert-bg-color: #cccccc; + --alert-color: black; +} +.alert.alert-ERROR { + --alert-bg-color: #d04437; + --alert-color: white; +} + +.alert { + color: var(--alert-color); + background-color: var(--alert-bg-color); + text-transform: uppercase; + display: table-cell; + font-weight: bold; +} + +.alert-row a{ + color: var(--a-link-color); +} + +.row { + color: white; +} + +.modal-body .row { + color: black; +} +/*bootstrap overrides*/ + +.btn { + border: 1px outset; + border-radius: 4px; + color: var(--font-main); + background-color: var(--arm-color); +} + +.btn-warning.active, +.btn-warning:active, +.btn-warning:hover, +.open > .dropdown-toggle.btn-warning { + color: var(--font-focus); + background-color: var(--arm-focus-color); + border-color: var(--arm-color); +} + +.btn-notice { + border: 1px outset; + border-radius: 4px; + color: var(--font-focus); + background-color: var(--ack-edit-color); +} + +.btn-notice.active, +.btn-notice:active, +.btn-notice:hover, +.open > .dropdown-toggle.btn-notice { + color: var(--font-main); + background-color: var(--ack-edit-focus-color); + border-color: var(--ack-edit-border-color); +} + +.btn-notice:disabled, button[disabled] { + color: var(--font-main); + background-color: var(--ack-edit-disabled-color); + border-color: var(--ack-edit-border-color); +} + +.btn-generic { + border: 1px outset; + border-radius: 4px; + color: var(--font-focus); + background-color: var(--ack-edit-color); +} + +.btn-generic:focus { + color: var(--font-main); + background-color: #286090; + border-color: #204d74; +} + +.btn-generic.active, +.btn-generic:active, +.btn-genric:hover, +.open > .dropdown-toggle.btn-generic { + color: var(--font-focus); + background-color: var(--ack-edit-focus-color); + border-color: var(--ack-edit-border-color); +} + +.btn-primary { + height: 30px; +} + +input[type="search"] { + border-radius: 15px; +} + +[class*="span"].centerspan { + margin: 0 auto; + float: none; +} + +.center { + margin: 0 auto; + float: none; +} + +.table-striped tbody > tr:nth-child(odd) > td, +.table-striped tbody > tr:nth-child(odd) > th { + background-color: var(--row-color-odd); +} + +.table-striped > tbody > tr:nth-of-type(2n+1) { + background-color: var(--row-color-even); +} + +.table-hover tbody tr:hover > td, +.table-hover tbody tr:hover > th, +.table-hover > tbody > tr:hover { + background-color: #9a9ea5; + color: var(--font-focus); +} + +td{ + color: var(--font-main); +} + +.welcome { + text-align: center; +} + +.tabcontent{ + margin-top: 20px; +} + +.tabnav a{ + color: #5f6e81; +} + +/* uncomment this login ui css to hide the local account/password signup options +.logins-wrapper .svgtextlabel { + font-size: 20px; + color: white; +} + +.loginButtons { + text-align: right; + color:white; +} + +.login-password-form{ + display:none; +} + +.or { + display: none; +} +*/ +/* don't float the 'create account' link*/ +#login-buttons #signup-link{ + float: none; +} + +/* d3 circle styles */ +.successcircle{ + /* + fill: rgb(217,206,178); + + fill: rgb(60,179,113); + */ + /*fill: rgba(0,150,221,.8);*/ + fill: rgba(0,255,0,.5); +} + +.failurecircle{ + /*fill: rgb(213,222,217);*/ + /*fill: #BD2C00;*/ + /*fill: #f93;*/ + /*fill: rgba(193, 56, 50, .8);*/ + fill: rgba(255,0,0,.5); +} + +circle:hover{ + fill: var(--font-main); +} + +.node { + stroke: var(--font-focus); + stroke-width: 1.5px; +} + +.textlabel{ + stroke-width: .2px; + stroke: var(--font-focus); +} + +.vtagholders { + padding-left: 1px; + padding-right: 0px; +} + +#header:after { + content: ""; + display: none; +} + +#header a.mozdef{ + color: var(--font-main); + text-shadow: #000 5px 3px 3px; + text-align: center; + font-size: large; + margin-top: -.25em; +} + +.mozillalogo{ + width: 90px; +} + +#header label{ + display: inherit; + cursor: auto; + margin:.5em; +} + +.mousepointer { + cursor: pointer; +} + +.fa-xs { + font-size: .75em; +} + +.fa-lg { + position: relative; + display: table-cell; + width: 60px; + height: 36px; + text-align: center; + vertical-align: middle; + font-size: 1.33333em; +} + +.moz { + position: relative; + display: table-cell; + width: 60px; + height: 36px; + text-align: center; + vertical-align: middle; + font-size: 20px; +} + +.main-menu:hover, +nav.main-menu.expanded { + width: 225px; + overflow: visible; +} + +.main-menu { + background: var(--primary-bg-color); + border-right: 1px solid var(--secondary-color); + position: fixed; + top: 0; + bottom: 0; + height: 100%; + left: 0; + width: 60px; + overflow: hidden; + -webkit-transition: width .05s linear; + transition: width .05s linear; + -webkit-transform: translateZ(0) scale(1, 1); + z-index: 1000; +} + +.main-menu>ul { + margin: 7px 0; +} + +.main-menu li { + position: relative; + display: block; + width: 225px; +} + +.main-menu li:hover>a, +nav.main-menu li.active>a, +.dropdown-menu>li>a:hover, +.dropdown-menu>li>a:focus, +.dropdown-menu>.active>a, +.dropdown-menu>.active>a:hover, +.dropdown-menu>.active>a:focus, +.no-touch .dashboard-page nav.dashboard-menu ul li:hover a, +.dashboard-page nav.dashboard-menu ul li.active a { + color: rgb(0, 0, 0); + text-decoration: none; + background-color: var(--secondary-focus-color); +} + +.main-menu li ul, +.main-menu li ul li ul { + position: absolute; + height: auto; + min-width: 120px; + margin: 0; + background: var(--primary-bg-color); + opacity: 0; + visibility: hidden; + transition: all 300ms linear; + -o-transition: all 300ms linear; + -ms-transition: all 300ms linear; + -moz-transition: all 300ms linear; + -webkit-transition: all 300ms linear; + /*top: 130px;*/ + z-index: 1000; + /* == */ + left:200px; + top: 0px; + border-left: 5px solid var(--secondary-focus-color); + /* == */ +} + +.main-menu li ul:before { + content: ""; + position: absolute; + /*top: -8px; + left: 23%; + border-bottom: 5px solid #97b4b4; + border-left: 5px solid transparent; + border-right: 5px solid transparent;*/ + /* == */ + top: 10px; + left: -9px; + border-right: 5px solid var(--secondary-focus-color); + border-bottom: 5px solid transparent; + border-top: 5px solid transparent; + /* == */ +} + +.main-menu li:hover > ul, +.main-menu li ul li:hover > .main-menu li ul li { + display: block; + opacity: 1; + visibility: visible; + padding: 5px; + /*top: 100px;*/ + /* == */ + left:228px; + text-decoration: none; + /* == */ +} + +/*.main-menu li ul li { + float: none; +}*/ + +.main-menu li ul li a { + padding: 10px; + text-align: left; + border: 0; + border-bottom: 1px solid #EEE; + /* == */ + height: auto; + /* == */ +} + +.main-menu li ul li a i { + font-size: 16px; + display: inline-block; + margin: 0 10px 0 0; +} + +.main-menu li ul li ul { + left: 200px; + top: 0; + border: 0; + border-left: 4px solid var(--secondary-color); +} + +.main-menu li ul li ul:before { + content: ""; + position: absolute; + top: 15px; + /*left: -14px;*/ + /* == */ + left: -9px; + /* == */ + border-right: 5px solid var(--secondary-color); + border-bottom: 5px solid transparent; + border-top: 5px solid transparent; +} + +.main-menu li ul li:hover > ul { + top: 0px; + left: 200px; +} + +.main-menu li>a { + position: relative; + display: table; + border-collapse: collapse; + border-spacing: 0; + color: rgb(255, 255, 255); + font-family: "Zilla Slab",sans-serif; + font-size: 14px; + text-decoration: none; + -webkit-transform: translateZ(0) scale(1, 1); + -webkit-transition: all .1s linear; + transition: all .3s linear; +} + +.main-menu .nav-icon { + position: relative; + display: table-cell; + width: 60px; + height: 36px; + text-align: center; + vertical-align: middle; + font-size: 20px; +} + +.main-menu .nav-text { + position: relative; + display: table-cell; + vertical-align: middle; + width: 163px; + font-family: 'Zilla Slab', serif; +} + +.main-menu>ul.logout { + position: absolute; + left: 0; + bottom: 0; +} + +.no-touch .scrollable.hover { + overflow-y: hidden; +} + +.no-touch .scrollable.hover:hover { + overflow-y: auto; + overflow: visible; +} + +a:hover, +a:focus { + text-decoration: none; +} + +nav { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} + +nav ul, +nav li { + outline: 0; + margin: 0; + padding: 0; +} + +@font-face { + font-family: 'Zilla Slab'; + font-style: normal; + font-weight: 300; + src: local('Zilla Slab'), local('ZillaSlab-Regular'), url(https://fonts.gstatic.com/s/zillaslab/v3/dFa6ZfeM_74wlPZtksIFajQ6_UyI.woff2) format('woff2'); +} + +.Heading { + margin-left: 100px; + margin-top: 0px; + color: #fff; + align-self: center; + font-family: 'Zilla Slab', serif; +} + +h1 { + max-width: 600px; + color: #fff; + min-height: 100%; + background: rgb(0, 0, 0); + font-family: 'Zilla Slab', serif; +} + +div#login-dropdown-list.accounts-dialog { + bottom: -16px; + top: unset; +} From f98fce2b3e870a1a8531a8a7759bbefc7233cacb Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Wed, 1 May 2019 16:24:09 -0700 Subject: [PATCH 10/44] m logo --- meteor/public/images/moz-logo2.png | Bin 0 -> 2563 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 meteor/public/images/moz-logo2.png diff --git a/meteor/public/images/moz-logo2.png b/meteor/public/images/moz-logo2.png new file mode 100644 index 0000000000000000000000000000000000000000..8167faccdfd1bf2b01d0d43f169e199416d0526e GIT binary patch literal 2563 zcmbVO3se(V8XiKb2t{Ru=uz1ngJpd%nM@`LnbCwt;!0X$A+nZst7S4X36Ug|W(El; zEfiUNY>{HE@~B0myKC*kT50hJ$SJnK`Yd{6-POfqIk?@`LMe*X9^E^js zt)}0M`T}oyd4?c(Nfgb_&Q@gO3eM+1F@hjar3zK45P(4V9FIWx5f2|VX2Hbrw9n}k zoSX+1EmAfvOVG;!(~%I|-f^=Yel$%WVW^+-qL@M{hBORh=y9Ak%jX()&d@09V%@Aq z-~kpJ$9gk3f#Wl{A2B_?eV+r6T8m}e$3wZe-QzBJVcB{R#%Mwwisn;uyew*Ec`nOG zv&+^4no(jjUef4eDS`8)a-3_dP|0JIVWUwj3;{2&P_)w{#<6h1Db_>@tX?i65TzPX z;i*_G3BGC!QEEt~as+DO7^gkwhfspVF;auy2L-xeD1rJ}Fhi4e&gZ5;)J`|$U{SBf zA&19vNg6p9=L3!bJAC50*=S7madxK*Z1C3QiLiN@QHv2;EuvCj!*nec((K^{%0she zlU@!oq;NVJQbn*@g2Hu(oz_u^npVXkluoTeG&FQ-LGu#9|k+4+!sJd)?p^Vu0JF!~cJ8S&0@b|IVcu?Y^4yGN5E`ePCB)cT+1 z|7i6bA@)Q54@md_=0BPsI)m~!SkQ1$xfl^Dwx*Htpbu7VcyB@*8-s)1C{D+lGI$wp z>#PTu_JO8NhwalsP~d*EDIwMWx9gXmN=i+c+xj*3VcB1*Cs#a|9NxIMQ?d1C-2qrG znX&GR=ta}_vfQ6#M=*14yqT$UeX(tRR88%IMY&-_#GquR-Zk)dTM1l)^Jk6>oqV%* zsPLZRtG=o`<(c>=OUj|L`0dfM9V@DjFPajy?|77661G`By;oXHK+f25tx#2d?Hk6n_^&fnP_p8k09)IS9F2K+Za zx_a@Z9sQy8ldeftL%%J&EtAa2w_ka&D&E@LGe2>+!#MXIesJdQ>HTSZ!8uvwJxDEy z2)H8)oY^h0hW(=LTtcgXTl=b_wJKETt>3kyc|mJaQFF`2!tS5dR$TwLem_m0i$ZrV^3tUC34@0QJu zn6r)xFLfHbjwe30A9_+>RW0?Ne7Et!s;+rm@XkG2*@c+Nirj0JSLQILO_k+=F6qt6 zX?ev3WO_jhhOgQ3O@XC3;9PdlUtNaI`fL9xK}!wQEgRp7)V)_SXLs=Pr#mit4Eo}L zxRCmaxBFt09Rs&+eA~3^#)+?6E^VK?VNY@XhfMPegBJ&y578-2345MZG)QmFK6v0_ z03F`HB)uzP+nz6rf)BMG;tsQ2DJPa3dm>;%^zWLlM%FGp5!tn3|3@1SxGOcXzQZqt z&u&u{H$5fGJ23b5D^1RF>31>eQuoxnHL|={r{=x+8Pw5pcIeZZ4^HjvOTqFFFBxpC z`}fg*o*inK75~0&uWb`{Ex@2eyTuf$LK8&-*18y8~)J z$J-tsqtGq2_D*5kzt3t2*}pGldFij`-LPzxFbk92YuBV$A`ap$q@nC?+4d9UJEzwA z8WW#1$Azq3M?~e9r(7bJRep$vX!Ry6VqS$A5Ms#EdT%j literal 0 HcmV?d00001 From 8b14c308f4af12843aaf90c0cbd0d70ce76e4587 Mon Sep 17 00:00:00 2001 From: Phrozyn Date: Fri, 3 May 2019 15:54:53 -0500 Subject: [PATCH 11/44] moving imports to the top of css(fix meteor complaint), adding Moz and Kibana logos --- meteor/client/themes/side_nav_dark/menu.html | 2 +- meteor/imports/themes/side_nav_dark/mozdef.css | 6 +++--- meteor/public/images/logo-elastic-kibana-dk.svg | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 meteor/public/images/logo-elastic-kibana-dk.svg diff --git a/meteor/client/themes/side_nav_dark/menu.html b/meteor/client/themes/side_nav_dark/menu.html index 15de6b0b4..fdcdb5c83 100644 --- a/meteor/client/themes/side_nav_dark/menu.html +++ b/meteor/client/themes/side_nav_dark/menu.html @@ -14,7 +14,7 @@
  • - + Mozilla diff --git a/meteor/imports/themes/side_nav_dark/mozdef.css b/meteor/imports/themes/side_nav_dark/mozdef.css index 4f29ca1b9..b3e5c570c 100644 --- a/meteor/imports/themes/side_nav_dark/mozdef.css +++ b/meteor/imports/themes/side_nav_dark/mozdef.css @@ -1,3 +1,6 @@ +@import url('https://fonts.googleapis.com/css?family=Zilla+Slab+Highlight'); +@import url('https://fonts.googleapis.com/css?family=Zilla+Slab'); +@import url('https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css'); /* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this @@ -6,9 +9,6 @@ Copyright (c) 2014 Mozilla Corporation */ /*side-nav-dark css */ -@import url('https://fonts.googleapis.com/css?family=Zilla+Slab+Highlight'); -@import url('https://fonts.googleapis.com/css?family=Zilla+Slab'); -@import url('https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css'); :root { --primary-bg-color: #2a2f35; diff --git a/meteor/public/images/logo-elastic-kibana-dk.svg b/meteor/public/images/logo-elastic-kibana-dk.svg new file mode 100644 index 000000000..e37f0649a --- /dev/null +++ b/meteor/public/images/logo-elastic-kibana-dk.svg @@ -0,0 +1 @@ +Kibana White \ No newline at end of file From eac048390016f0c16bb4e219ac8fb00d52327fba Mon Sep 17 00:00:00 2001 From: Phrozyn Date: Fri, 3 May 2019 16:09:34 -0500 Subject: [PATCH 12/44] Removing documentation link from side-nav as this lives in About as a sub-menu link. --- meteor/client/themes/side_nav_dark/menu.html | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/meteor/client/themes/side_nav_dark/menu.html b/meteor/client/themes/side_nav_dark/menu.html index fdcdb5c83..cc137da77 100644 --- a/meteor/client/themes/side_nav_dark/menu.html +++ b/meteor/client/themes/side_nav_dark/menu.html @@ -138,16 +138,6 @@
  • {{/if}} - {{#if isFeature "Documentation"}} -
  • - - - - Documentation - - -
  • - {{/if}} {{#if isFeature "about"}}
  • From ff293b3db9542270b2f781c5a5bc482edd6f5b0d Mon Sep 17 00:00:00 2001 From: Phrozyn Date: Fri, 3 May 2019 17:01:08 -0500 Subject: [PATCH 13/44] adding in sidenav for attackers and globe changes. attackers not working yet. --- .../imports/themes/side_nav_dark/mozdef.css | 214 ++++++++++++++++++ 1 file changed, 214 insertions(+) diff --git a/meteor/imports/themes/side_nav_dark/mozdef.css b/meteor/imports/themes/side_nav_dark/mozdef.css index b3e5c570c..ded8024c7 100644 --- a/meteor/imports/themes/side_nav_dark/mozdef.css +++ b/meteor/imports/themes/side_nav_dark/mozdef.css @@ -440,6 +440,128 @@ circle:hover{ font-size: .75em; } +/* Attackers sidenav menu */ +.sidenav { + background: var(--primary-bg-color); + border-left: 15px solid var(--secondary-color); + text-align: left; + font-weight: bolder; + position: fixed; + top: 0; + bottom: 0; + height: 100%; + right: -29em; + margin: 0em; + padding-top: 1em; + display: inline-block; + line-height: normal; + -webkit-transform: translateZ(0) scale(1, 1); + z-index: 3; + -webkit-transition: all 400ms ease; + -moz-transition: all 400ms ease; + -ms-transition: all 400ms ease; + -o-transition: all 400ms ease; + transition: all 400ms ease; +} + +/*pull out triangle*/ +.sidenav:after { + position: absolute; + content: ' '; + width: 0; + height: 0; + right: 405px; + top: 45%; + border-top: 45px solid transparent; + border-bottom: 45px solid transparent; + border-right: 45px solid var(--secondary-color); +} +.sidenav ul { + width: 14em; + list-style-type: none; + margin: auto; + padding: 1em; +} +.sidenav div{ + margin:auto; +} +.sidenav:hover { + right: 0; + width: 405px; +} +.sidenav .filters-col .row { + margin-top: 45px; + padding: 0 0.5em; +} +.sidenav .reset-filter { + text-align: center; + margin-top: 20px; +} +.form-horizontal .form-group { + margin-left: 5px; + margin-right: 5px; + padding-top: 5px; +} + +@media screen and (max-width: 1000px) { + .sidenav { + background: var(--primary-bg-color); + border-left: 15px solid var(--secondary-color); + text-align: left; + font-weight: bolder; + position: fixed; + top: 0; + bottom: 0; + height: 100%; + right: -16em; + margin: 0em; + padding-top: 1em; + display: inline-block; + line-height: normal; + -webkit-transform: translateZ(0) scale(1, 1); + z-index: 3; + -webkit-transition: all 400ms ease; + -moz-transition: all 400ms ease; + -ms-transition: all 400ms ease; + -o-transition: all 400ms ease; + transition: all 400ms ease; + } + .sidenav:after { + right: 230px; + border-top: 0; + border-bottom: 0; + border-right: 0; + content: none; + } + .sidenav ul { + width: 14em; + list-style-type: none; + margin: auto; + padding: 1em; + } + .sidenav div{ + margin:auto; + } + .sidenav:hover { + right: 0; + width: 230px; + overflow-y: scroll; + scrollbar-width: inherit; + scrollbar-color: var(--secondary-color) black; + } + .sidenav .filters-col .row { + margin-top: 25px; + padding: 0 1.5em; + } + .sidenav .reset-filter { + text-align: center; + margin-top: 20px; + } + div.dc-chart { + float: none; + } +} + .fa-lg { position: relative; display: table-cell; @@ -450,6 +572,98 @@ circle:hover{ font-size: 1.33333em; } +/* globe styling */ +.globe-container { + background: #000000; + color: #ffffff; +} + +.globe-info { + font-size: 11px; + position: absolute; + bottom: 5px; + background-color: rgba(0, 0, 0, 0.8); + border-radius: 3px; + right: 10px; + padding: 10px; + color: var(--txt-secondary-color); +} + +.globe-container a { + color: #aaa; + text-decoration: none; +} + +.globe-container a:hover { + text-decoration: underline; +} + +.globe-campaigns { + width: 270px; + position: absolute; + right: 280px; + top: 63px; + background-color: rgba(0, 0, 0, 0.2); + border-top: 1px solid rgba(255, 255, 255, 0.4); + padding: 10px; +} + +.globe-time { + width: 400px; + position: absolute; + right: 150px; + top: 103px; + background-color: rgba(0, 0, 0, 0.2); + border-top: 1px solid rgba(255, 255, 255, 0.4); + padding: 10px; +} + +.globe-facts { + width: 300px; + position: absolute; + left: 10px; + bottom: 0px; + background-color: rgba(0, 0, 0, 0.2); + border-top: 1px solid rgba(255, 255, 255, 0.4); + border-right: 1px solid rgba(255, 255, 255, 0.4); + padding: 10px; + font-size: 12px; + color: rgba(255, 255, 255, 0.9); + display: none; +} + +.globe-campaigns .campaign{ + font-size: 12px; + line-height: 26px; + height: 30px; + text-align: center; + float: left; + width: 60px; + color: rgba(255, 255, 255, 0.4); + cursor: pointer; + transition: all 0.1s ease-out; +} + +.globe-time .time{ + font-size: 12px; + line-height: 26px; + height: 30px; + text-align: center; + float: left; + width: 90px; + color: rgba(255, 255, 255, 0.4); + cursor: pointer; + transition: all 0.1s ease-out; +} + +.globe-campaigns .campaign:hover, +.globe-campaigns .campaign.active, +.globe-time .time:hover, +.globe-time .time.active { + font-size: 14px; + color: #fff; +} + .moz { position: relative; display: table-cell; From ae588563b39bce1b176c4f2a446bc41fb6ed3214 Mon Sep 17 00:00:00 2001 From: Phrozyn Date: Fri, 3 May 2019 17:10:02 -0500 Subject: [PATCH 14/44] fixes attackers sidenav --- .../imports/themes/side_nav_dark/mozdef.css | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/meteor/imports/themes/side_nav_dark/mozdef.css b/meteor/imports/themes/side_nav_dark/mozdef.css index ded8024c7..31e56bb11 100644 --- a/meteor/imports/themes/side_nav_dark/mozdef.css +++ b/meteor/imports/themes/side_nav_dark/mozdef.css @@ -441,7 +441,7 @@ circle:hover{ } /* Attackers sidenav menu */ -.sidenav { +sidenav { background: var(--primary-bg-color); border-left: 15px solid var(--secondary-color); text-align: left; @@ -465,7 +465,7 @@ circle:hover{ } /*pull out triangle*/ -.sidenav:after { +sidenav:after { position: absolute; content: ' '; width: 0; @@ -476,24 +476,24 @@ circle:hover{ border-bottom: 45px solid transparent; border-right: 45px solid var(--secondary-color); } -.sidenav ul { +sidenav ul { width: 14em; list-style-type: none; margin: auto; padding: 1em; } -.sidenav div{ +sidenav div{ margin:auto; } -.sidenav:hover { +sidenav:hover { right: 0; width: 405px; } -.sidenav .filters-col .row { +sidenav .filters-col .row { margin-top: 45px; padding: 0 0.5em; } -.sidenav .reset-filter { +sidenav .reset-filter { text-align: center; margin-top: 20px; } @@ -504,7 +504,7 @@ circle:hover{ } @media screen and (max-width: 1000px) { - .sidenav { + sidenav { background: var(--primary-bg-color); border-left: 15px solid var(--secondary-color); text-align: left; @@ -526,34 +526,34 @@ circle:hover{ -o-transition: all 400ms ease; transition: all 400ms ease; } - .sidenav:after { + sidenav:after { right: 230px; border-top: 0; border-bottom: 0; border-right: 0; content: none; } - .sidenav ul { + sidenav ul { width: 14em; list-style-type: none; margin: auto; padding: 1em; } - .sidenav div{ + sidenav div{ margin:auto; } - .sidenav:hover { + sidenav:hover { right: 0; width: 230px; overflow-y: scroll; scrollbar-width: inherit; scrollbar-color: var(--secondary-color) black; } - .sidenav .filters-col .row { + sidenav .filters-col .row { margin-top: 25px; padding: 0 1.5em; } - .sidenav .reset-filter { + sidenav .reset-filter { text-align: center; margin-top: 20px; } From b2e7b1e3a5626d092337b6669ac71a4803157bfb Mon Sep 17 00:00:00 2001 From: Brandon Myers Date: Thu, 9 May 2019 13:51:20 -0500 Subject: [PATCH 15/44] Add alert for cloudtrail s3 public alert --- alerts/cloudtrail_public_bucket.py | 42 ++++++++ tests/alerts/test_cloudtrail_public_bucket.py | 98 +++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 alerts/cloudtrail_public_bucket.py create mode 100644 tests/alerts/test_cloudtrail_public_bucket.py diff --git a/alerts/cloudtrail_public_bucket.py b/alerts/cloudtrail_public_bucket.py new file mode 100644 index 000000000..50e29d097 --- /dev/null +++ b/alerts/cloudtrail_public_bucket.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# Copyright (c) 2014 Mozilla Corporation + + +from lib.alerttask import AlertTask +from mozdef_util.query_models import SearchQuery, TermMatch, ExistsMatch + + +class AlertCloudtrailPublicBucket(AlertTask): + def main(self): + search_query = SearchQuery(minutes=20) + + search_query.add_must([ + TermMatch('source', 'cloudtrail'), + TermMatch('details.eventname', 'PutBucketPolicy'), + ExistsMatch('details.requestparameters.bucketpolicy.statement.principal') + ]) + + self.filtersManual(search_query) + self.searchEventsSimple() + self.walkEvents() + + # Set alert properties + def onEvent(self, event): + request_parameters = event['_source']['details']['requestparameters'] + for statement in request_parameters['bucketpolicy']['statement']: + if statement['principal'] != '*': + return + category = 'access' + tags = ['cloudtrail'] + severity = 'INFO' + + bucket_name = 'Unknown' + if 'bucketname' in request_parameters: + bucket_name = request_parameters['bucketname'] + + summary = "The s3 bucket {0} is listed as public".format(bucket_name) + return self.createAlertDict(summary, category, tags, [event], severity) diff --git a/tests/alerts/test_cloudtrail_public_bucket.py b/tests/alerts/test_cloudtrail_public_bucket.py new file mode 100644 index 000000000..3c8ebebd6 --- /dev/null +++ b/tests/alerts/test_cloudtrail_public_bucket.py @@ -0,0 +1,98 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# Copyright (c) 2017 Mozilla Corporation +from positive_alert_test_case import PositiveAlertTestCase +from negative_alert_test_case import NegativeAlertTestCase +from alert_test_suite import AlertTestSuite + + +class TestCloudtrailPublicBucket(AlertTestSuite): + alert_filename = "cloudtrail_public_bucket" + alert_classname = "AlertCloudtrailPublicBucket" + + default_event = { + "_source": { + "source": "cloudtrail", + "details": { + "requestparameters": { + "bucketpolicy": { + "version": "2012-10-17", + "statement": [{ + "action": "s3:GetObject", + "principal": "*", + "resource": "arn:aws:s3:::testbucket/*", + "effect": "Allow", + "sid": "AllowGetObject" + }] + }, + "bucketname": "testbucket" + }, + "eventname": "PutBucketPolicy", + }, + } + } + + # This alert is the expected result from running this task + default_alert = { + "category": "access", + "tags": ['cloudtrail'], + "severity": "INFO", + "summary": 'The s3 bucket testbucket is listed as public', + } + + test_cases = [] + + test_cases.append( + PositiveAlertTestCase( + description="Positive test with default events and default alert expected", + events=[AlertTestSuite.create_event(default_event)], + expected_alert=default_alert + ) + ) + + event = AlertTestSuite.create_event(default_event) + event['_source']['source'] = 'bad' + test_cases.append( + NegativeAlertTestCase( + description="Negative test case with events with incorrect source", + events=[event], + ) + ) + + event = AlertTestSuite.create_event(default_event) + event['_source']['details']['eventname'] = 'bad' + test_cases.append( + NegativeAlertTestCase( + description="Negative test case with events with incorrect details.eventname", + events=[event], + ) + ) + + event = AlertTestSuite.create_event(default_event) + del(event['_source']['details']['requestparameters']['bucketpolicy']['statement'][0]['principal']) + test_cases.append( + NegativeAlertTestCase( + description="Negative test case with events with missing field", + events=[event], + ) + ) + + event = AlertTestSuite.create_event(default_event) + event['_source']['details']['requestparameters']['bucketpolicy']['statement'][0]['principal'] = 'bad' + test_cases.append( + NegativeAlertTestCase( + description="Negative test case with events with incorrect principal", + events=[event], + ) + ) + + event = AlertTestSuite.create_event(default_event) + event['_source']['utctimestamp'] = AlertTestSuite.subtract_from_timestamp_lambda(date_timedelta={'minutes': 21}) + event['_source']['receivedtimestamp'] = AlertTestSuite.subtract_from_timestamp_lambda(date_timedelta={'minutes': 21}) + test_cases.append( + NegativeAlertTestCase( + description="Negative test case with old timestamp", + events=[event], + ) + ) From dc82a718eb62b08219a3bdd2607133944d1259bf Mon Sep 17 00:00:00 2001 From: Phrozyn Date: Thu, 9 May 2019 18:33:28 -0500 Subject: [PATCH 16/44] css tweaks and logo update for new branding --- meteor/client/greeting.html | 2 +- meteor/client/greeting.js | 4 +- meteor/client/menu.html | 3 +- meteor/client/themes/side_nav_dark/menu.html | 5 +- meteor/imports/themes/classic/mozdef.css | 69 +++-- meteor/imports/themes/dark/mozdef.css | 291 ++++++++++++++++-- meteor/imports/themes/light/mozdef.css | 115 +++---- .../imports/themes/side_nav_dark/mozdef.css | 22 +- .../public/images/moz_defense-platform_01.png | Bin 0 -> 18773 bytes 9 files changed, 391 insertions(+), 120 deletions(-) create mode 100644 meteor/public/images/moz_defense-platform_01.png diff --git a/meteor/client/greeting.html b/meteor/client/greeting.html index bf2e5d48c..5e72d714e 100644 --- a/meteor/client/greeting.html +++ b/meteor/client/greeting.html @@ -2,7 +2,7 @@ \ No newline at end of file diff --git a/meteor/client/greeting.js b/meteor/client/greeting.js index e8343074d..027d799f0 100644 --- a/meteor/client/greeting.js +++ b/meteor/client/greeting.js @@ -4,14 +4,14 @@ if ( Meteor.isClient ) { greeting: function() { if ( typeof console !== 'undefined' ) console.log( "mozdef starting" ); - return "MozDef: The Mozilla Defense Platform"; + return "Hand made by Mozilla"; } } ); Template.hello.events( { 'click': function() { // template data, if any, is available in 'this' - Session.set( 'displayMessage', 'Welcome & to mozdef.' ) + Session.set( 'displayMessage', 'Welcome to mozdef.' ) } } ); }; \ No newline at end of file diff --git a/meteor/client/menu.html b/meteor/client/menu.html index f789edbc2..58f8cf352 100644 --- a/meteor/client/menu.html +++ b/meteor/client/menu.html @@ -9,10 +9,9 @@
    {{#if haveFeatures }}