Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Adds a dark side navigation theme with Menu templatizing and some css tweaks adds logo to landing page. #1257

Merged
merged 48 commits into from May 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
dec31cb
update jquery ( meteor npm audit fix --force)
jeffbryner Apr 23, 2019
6f00f5b
update jquery (package lock)
jeffbryner Apr 23, 2019
84af2e4
revert a version of bootstrap to allow newer jquery
jeffbryner Apr 23, 2019
f4be639
formatting
jeffbryner Apr 27, 2019
f2dcd2e
require at the end, when functions are available
jeffbryner Apr 27, 2019
0ffbbed
separate out greeting, etc
jeffbryner May 1, 2019
43d7877
formatting
jeffbryner May 1, 2019
1a529ed
fix imports, dynamic menu option
jeffbryner May 1, 2019
b7159f9
add theme and menu/css logic
jeffbryner May 1, 2019
f98fce2
m logo
jeffbryner May 1, 2019
8b14c30
moving imports to the top of css(fix meteor complaint), adding Moz an…
May 3, 2019
eac0483
Removing documentation link from side-nav as this lives in About as a…
May 3, 2019
ff293b3
adding in sidenav for attackers and globe changes. attackers not work…
May 3, 2019
ae58856
fixes attackers sidenav
May 3, 2019
b2e7b1e
Add alert for cloudtrail s3 public alert
pwnbus May 9, 2019
dc82a71
css tweaks and logo update for new branding
May 9, 2019
06ea511
Re-organizes README structure and warns of AWS charges
May 10, 2019
dc0f2e8
Changes Click with Caution to Warning
May 10, 2019
1e2d67d
adding new line to EOF
May 10, 2019
35c2345
changes favicon to a shield.
May 10, 2019
1ea3c0b
Revert "changes favicon to a shield."
May 10, 2019
0efb92b
Option for logo only visible on 'home' page
May 10, 2019
81d42b5
Merge pull request #1255 from mozilla/add_cloudtrail_s3_public_alert
pwnbus May 13, 2019
18e12c4
Merge pull request #1258 from mozilla/readme_update
pwnbus May 13, 2019
ae0ff3e
Merge pull request #1260 from mozilla/logo_option_home
Phrozyn May 14, 2019
1d7498b
removing top nav logo in favor of home option.
May 14, 2019
04c6b89
Removing commented out deprecated layout imports.
May 14, 2019
48b0186
update jquery ( meteor npm audit fix --force)
jeffbryner Apr 23, 2019
b39b667
update jquery (package lock)
jeffbryner Apr 23, 2019
98403ec
revert a version of bootstrap to allow newer jquery
jeffbryner Apr 23, 2019
4b06638
formatting
jeffbryner Apr 27, 2019
833f258
require at the end, when functions are available
jeffbryner Apr 27, 2019
a975ab3
separate out greeting, etc
jeffbryner May 1, 2019
32ba4ca
formatting
jeffbryner May 1, 2019
84e172f
fix imports, dynamic menu option
jeffbryner May 1, 2019
382bc94
add theme and menu/css logic
jeffbryner May 1, 2019
b56590e
m logo
jeffbryner May 1, 2019
bac7cf0
moving imports to the top of css(fix meteor complaint), adding Moz an…
May 3, 2019
6d89b4d
Removing documentation link from side-nav as this lives in About as a…
May 3, 2019
c1e209c
adding in sidenav for attackers and globe changes. attackers not work…
May 3, 2019
a9cd2fe
fixes attackers sidenav
May 3, 2019
1d457f5
css tweaks and logo update for new branding
May 9, 2019
3db9d70
adding new line to EOF
May 10, 2019
41ffc05
changes favicon to a shield.
May 10, 2019
776f2fe
Revert "changes favicon to a shield."
May 10, 2019
ecd5623
removing top nav logo in favor of home option.
May 14, 2019
5b8a74f
Merge branch 'side-nav-theme' of github.com:mozilla/MozDef into side-…
May 14, 2019
b01ec9f
Adding logo to landing page and tweaking 'home' logo placement.
May 15, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 15 additions & 9 deletions README.md
Expand Up @@ -3,6 +3,20 @@

# MozDef: Mozilla Enterprise Defense Platform

## Documentation:

http://mozdef.readthedocs.org/en/latest/


## Give MozDef a Try in AWS:

The following button will launch the Mozilla Enterprise Defense Platform in your AWS account.

**Warning:** Pressing the "Launch Stack" button and following through with the deployment will incur charges to your AWS account.

[![Launch MozDef](docs/source/images/cloudformation-launch-stack.png)][1]


## Why?

The inspiration for MozDef comes from the large arsenal of tools available to attackers. Suites like metasploit, armitage, lair, dradis and others are readily available to help attackers coordinate, share intelligence and finely tune their attacks in real time. Defenders are usually limited to wikis, ticketing systems and manual tracking databases attached to the end of a Security Information Event Management (SIEM) system.
Expand All @@ -22,12 +36,4 @@ The Mozilla Enterprise Defense Platform (MozDef) seeks to automate the security

MozDef is in production at Mozilla where we are using it to process over 300 million events per day.

## Give MozDef a Try in AWS:

[![Launch MozDef](docs/source/images/cloudformation-launch-stack.png)][1]

## Documentation:

http://mozdef.readthedocs.org/en/latest/

[1]: https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=mozdef-for-aws&templateURL=https://s3-us-west-2.amazonaws.com/public.us-west-2.infosec.mozilla.org/mozdef/cf/v1.38.5/mozdef-parent.yml
[1]: https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=mozdef-for-aws&templateURL=https://s3-us-west-2.amazonaws.com/public.us-west-2.infosec.mozilla.org/mozdef/cf/v1.38.5/mozdef-parent.yml
42 changes: 42 additions & 0 deletions 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)
2 changes: 1 addition & 1 deletion meteor/.meteor/versions
Expand Up @@ -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
Phrozyn marked this conversation as resolved.
Show resolved Hide resolved
ui@1.0.13
underscore@1.0.10
url@1.2.0
Expand Down
8 changes: 8 additions & 0 deletions meteor/client/greeting.html
@@ -0,0 +1,8 @@
<!--a nice greeting-->
<template name="hello">
<div class="container">
<div class="row center">
<p class="welcome"><img class="mozdeflogo" src="/images/moz_defense-platform_01.png"><br/> {{greeting}}</p>
</div>
</div>
</template>
17 changes: 17 additions & 0 deletions 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 "Hand made by Mozilla";
}
} );

Template.hello.events( {
'click': function() {
// template data, if any, is available in 'this'
Session.set( 'displayMessage', 'Welcome to mozdef.' )
}
} );
};
3 changes: 3 additions & 0 deletions meteor/client/loading.html
@@ -0,0 +1,3 @@
<template name='loading'>
loading...
</template>
10 changes: 8 additions & 2 deletions meteor/client/main.js
Expand Up @@ -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';
Expand Down Expand Up @@ -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';

3 changes: 1 addition & 2 deletions meteor/client/menu.html
Expand Up @@ -11,8 +11,7 @@
<div id="header" class="row center">
<span id="nav-main">
<ul>
<li><img class="mozillalogo" src="/images/mozilla.svg"></li>
<li><a class="mozdef" href="/" title="MOZDEF">MOZDEF</a></li>
<li><a href="/">Home</a></li>
{{#if isFeature "kibana"}}
<li> <a target="_blank" href={{ resolveKibanaURL mozdef.kibanaURL }}>Kibana</a>
<ul>
Expand Down
29 changes: 17 additions & 12 deletions meteor/client/menu.js
Expand Up @@ -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();
}
});
} );
49 changes: 12 additions & 37 deletions meteor/client/mozdef.html
Expand Up @@ -8,7 +8,7 @@
<head>
<meta name="viewport" content="width=1024">
<link rel="shortcut icon" type="image/svg" href="/images/favicon.ico" />
<title>mozdef::mozilla defense platform</title>
<title>mozdef::mozilla enterprise defense platform</title>
</head>

<body>
Expand All @@ -17,52 +17,27 @@
<!--begin layout templates-->
<!--the main, simple layout for the router to target-->
<template name="layout">
{{> menu}}

{{#if loggingIn}}
<div class="row center">
<div class="col-xs-5 col-xs-offset-3 alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<div class="col-xs-5 col-xs-offset-3 alert alert-info" role="alert">
<strong>loading</strong>
</div>
</div>
{{else}}
{{#if currentUser}}
{{>yield}}
{{> Template.dynamic template=menuName }}
{{> yield }}
{{> whoismodal}}
{{> dshieldmodal}}
{{> blockIPModal}}
{{> intelmodal}}
{{> blockFQDNModal}}
{{> watchItemModal}}
{{else}}
<div class="row center">
<div class="col-xs-5 col-xs-offset-3 alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<strong>Please login</strong>
</div>
</div>
{{> loginmenu}}
{{/if}}
{{/if}}

{{>whoismodal}}
{{>dshieldmodal}}
{{>blockIPModal}}
{{>intelmodal}}
{{>blockFQDNModal}}
{{>watchItemModal}}

</template>

<!--a nice greeting-->
<template name="hello">
<div class="container">
<div class="row center">
<p class="welcome">{{greeting}}<br>Hand made by Mozilla</p>
</div>
</div>
</template>

<template name='loading'>
loading...
</template>

59 changes: 21 additions & 38 deletions meteor/client/mozdef.js
Expand Up @@ -5,20 +5,9 @@ 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 './menu.html';
import './menu.js';
import '/client/layout.js';
import '/public/css/dropdowns.css';

import PNotify from 'pnotify';


if ( Meteor.isClient ) {
Expand All @@ -35,9 +24,9 @@ if ( Meteor.isClient ) {
Session.set( 'blockIPipaddress', '' );
Session.set( 'blockFQDN', '' );
Session.set( 'watchItemwatchcontent', '' );
Session.set( 'menuname', 'menu' );
getAllPlugins();
// use a default theme, overridden later by login per user
require( '/imports/themes/classic/mozdef.css' );

} );

prefs = function() {
Expand Down Expand Up @@ -170,29 +159,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 &amp; to mozdef.' )
}
} );

// loads kibana dashboards
Template.menu.helpers( {
kibanadashboards: function() {
Meteor.call( 'loadKibanaDashboards' );
return kibanadashboards.find();
}
} );

UI.registerHelper( 'isFeature', function( featureName ) {
return isFeature( featureName );
} );
Expand Down Expand Up @@ -380,6 +346,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')
Expand Down Expand Up @@ -498,17 +468,30 @@ 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( '/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' );
}
}
} );

} );

// 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' );
}