Code Monkey home page Code Monkey logo

mozdef's Introduction

Tests Documentation Status

MozDef: LOGO

⚠️ Deprecation Notice ⚠️

Mozilla is no longer maintaining the Mozilla Enterprise Defense Platform (MozDef) project.

Please fork it to continue development.

Documentation:

https://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

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.

The Mozilla Enterprise Defense Platform (MozDef) seeks to automate the security incident handling process and facilitate the real-time activities of incident handlers.

Goals:

  • Provide a platform for use by defenders to rapidly discover and respond to security incidents
  • Automate interfaces to other systems like bunker, cymon, mig
  • Provide metrics for security events and incidents
  • Facilitate real-time collaboration amongst incident handlers
  • Facilitate repeatable, predictable processes for incident handling
  • Go beyond traditional SIEM systems in automating incident handling, information sharing, workflow, metrics and response automation

Status:

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

mozdef's People

Contributors

2xyo avatar 526avijitgupta avatar abdur-rahmaanj avatar andrewkrug avatar arcrose avatar bjornarnelid avatar caggle avatar cglewis avatar darakian avatar darkprince304 avatar darkspirit avatar densfox avatar dependabot[bot] avatar gdestuynder avatar gene1wood avatar jeffbryner avatar jvehent avatar luciusbono avatar matletix avatar mpurzynski avatar netantho avatar parikshit-hooda avatar phrozyn avatar pwnbus avatar ryandeivert avatar scriptonist avatar segumarc avatar severinrudie avatar timgates42 avatar yashmehrotra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mozdef's Issues

Drag and drop for veris tags

The drop zone for veris tags is buggy. It's hard be drop.
Also, tags are not saved when we click to the save button (or without clicking on it).

Installation Document needs improvements for Web and Workers nodes install.

Process only described for yum based systems.
apt-get command should be:
sudo apt-get install make zlib1g-dev libbz2-dev libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev tk-dev libpcre3-dev libpcre++-dev build-essential g++

Command for unpacking python is incorrect:
Is currently tar "xvzf http://python.org/ftp/python/2.7.6/Python-2.7.6.tgz" but should be
"tar xvzf Python-2.7.6.tgz"

File paths inconcistent throughout description: Configured as: " ./configure --prefix=/home/mozdef/python2.7 --enable-shared"
But LD_LIBRARYPATH set to: "export LD_LIBRARY_PATH=/home/netantho/python2.7/lib/"
And later start virtualenv is started by "~/python2.7/bin/virtualenv mozdef" (which would only be true if you are user mozdef in this case)

WebUI: d3 visualization plugins

  • Could have setup an ldap->mongo cron job to count password changes left/% left and done a D3 visualization

Need to be a easy python framework or webui configuration wizards, lot of snippets

WebUI: links for supporting docs

Be able to reference external web documents used for an incident:

  • google docs (writer, spreadsheet, slides)
  • etherpad
  • dropbox
  • pastebin
  • kibana
  • bugzilla
  • other links

Verify the docker config for docker 0.10.0

The current docker config is tested against docker 0.9 and not the new 0.10. It would be nice to test. Boot2docker is already updated for 0.10 (docker-compatible distro).

MozDef bot is missing Dependency

MozDef bot requires KitnIRC, but the dependency is not described or included in the install process.

Seems like MozDef boz libraries should be installed along with the other python libraries?

WebUI: more health info in the about page

We want to have Health/status of the whole stack.

Examples:

  • node cpu/jvm stats
  • load average
  • disk free

We should also be able to configure links to external monitoring webpages (Kibana health dashboard and marvel for instance).

ElasticSearch 'ip' field doesn't support ipv6

Tossing in ipv6 data into a field templated as 'ip' results in this error:

Caused by: org.elasticsearch.ElasticsearchIllegalArgumentException: failed to parse ip [2a02:d28:666::69], not full ip address (4 dots)

Related work on elastic search and lucene:
elastic/elasticsearch#5758
https://issues.apache.org/jira/browse/LUCENE-5596

Not clear whether elastic search will support both ip types in one field, or require differing fields. For now to support searching, mozdef should separate ipv4 from ipv6 data and store in differing fields.

MozDef screencast(s)

Create screencast(s) to show and explain MozDef features.

Be careful not to disclose private information.

Unit testing

We should do unit testing on the project both for python and javascript.
It would be cool to integrate travisCI to run tests.

Fix license stuff

The license should be MPL2.0 with header and contributors in all source files.

Alerts on MozDef errors

Send alerts on MozDef errors (backup problems, ES problems, etc.).

Email and IRC are fine.

Heka with lua snippet for CEF

Create a Heka config to parse CEF logs.
I should be able to handle custom labels as well.

I can provide some sample logs if needed.

WebUI: unique URL to share an alert

We should have a unique URL per alert so that we can share link to have more info about an alert.

  • Add links to scripted Kibana alert dashboard from the alerts page
  • GET /alerts/:alert_id should show the relevant alert

Installation Document needs improvements.

There should be instructions for apt based systems on how to install the different components.
(RabbitMQ, Meteor, Node, Nginx, UWSGI, Kibana)

I will comment or send a pull request as soon as i have time to test and document the proper steps.

WebUI: UI for alert configuration

We should be able to configure alerts in the webUI.

Plan

The goal is to make it super easy and super fast to create new alerts using whenever possible the web UI.
if not possible, it should be possible to create a very short python module.

Scheduling and task management architecture

architecture

  • alert tasks (also do the correlation) are python modules describing Celery tasks (try have a modular/plugin system rather than single file scripts).
  • celery project for celery beats with celerybeat-mongo scheduler
  • mongodb
  • meteor webUI

Alert module

Events in stored ES (use pyes) -> Alert module -> Alert sent to the alert exchange using kombu, add alerttimestamp to the events, update events index with alert for cross reference e['_source']['alerts'].append(dict(index=alertResult['_index'], type=alertResult['_type'], id=alertResult['_id']))

Types:

  • generic modules: correlation/alerting logic that can be used for several alerts, once such a module is coded, alerts on different data can be created using the Web UI.
    • Xevents_in_Ytime: alert when more than X events in last Y mins/hours/days, optional unique field myfield (use method used for AMO for aggregation field)
    • topK: alert for top K events based on an unique field myfield (ES terms), optional n number that is the min number of hits
    • exact_match: alert whenever there's a doc matching the filters in the last Y mins
  • custom modules: not generic, specific to an alert.

Attributes:

  • Id (short name, without space)
  • Name
  • Type = custom|generic
  • Instructions (provides also scripted Kibana dashboard if available)
  • Specific fields (list)

Alerts properties:

  • severity
  • category
  • utctimestamp
  • eventtimestamp
  • summary (should usually include how many docs matched)
  • events
  • tags

Template: TODO

WebUI

  • New alert setup
    1. Select alert setup type (which alert task module to use, list served by the python REST API)
    2. Define parameters and read the alert type instructions
      • Name
      • Description
      • Enabled?
      • Frequency
      • How far back to look
      • Kibana dashboard to use for filters (if generic module), stored in mongo in Kibana dashboard format
      • Custom args fields (if generic module, served by the python REST API)
      • Summary of the alert (using mustache syntax)
    3. Save
    4. Enjoy
  • Edit alert setup
    • Start ^ at step 2
  • Remove alert setups
  • List alert setups

Python REST API

  • GET /alerts/setup/modules
  • GET /alerts/setup/:alertmodule_id

Steps

  1. Test Kibana filters for complex alerts we have to see if it's doable to use them
  2. Have stupid (custom) Celery tasks created and scheduled with the mongodb data
  3. Implement generic alert modules, try with by inject data in the mongodb data
  4. Create the web interface, use mock of json for dynamic forms
  5. Implement rest api part
  6. testing and deployment

Limitations

  • Jeff has started using facets for it but they don't return. It works for FxA but not for Auditd for example. As a result I'm not doing facets in the generic modules (I come with a custom python solution), we plan to try aggregations when they become available in pyes.

Ideas for later

  • Alert preview: being able to manually launch an alert setup and see the result a few secs after without injecting the alert in the prod system

It would be nice to have the same kind of thing for data collection (cloudTrail, mig2mozdef) but it's low priority

Generate sample events, correlations and alerts

Create a script to create sample events, correlations and alerts and send them into the system using loginput.
Because of ES 24h-based indices, we should generate data with date between now - 24h.

Launch the script in the docker configuration and update installation doc.

Front End Log Processing: associate events

Use the esworker plugin system to associate events in a single event when it makes sense.

Examples:

  • switch port
  • bgp up/down

If you are working on this, please document in this bug the events you associate.

WebUI: Attacker visualization in three.js

Have a realtime attacker dashboard using three.js.
It should display the top K attackers and separated them according to tags (bruteforcing, web attacker, etc.).

d3 example too tied to Mozilla infra

We should be able to configure which host to use for d3 figures.

-bash-4.1$ pwd
/home/netantho/MozDef-netantho/meteor/app

-bash-4.1$ grep "mozdef1.private.scl3.mozilla.com" ./ -R
./client/mozdef.js:    d3.json("https://mozdef1.private.scl3.mozilla.com:8444/ldapLogins/", function(error, jsondata) {
./client/mozdef.js:    d3.json("https://mozdef1.private.scl3.mozilla.com:8444/alerts/", function(error, jsondata) {

Front End Log Processing: metadata plugin

Use the esworker plugin system to pull out metadata from events into distinct fields:

  • success/failure
  • event categories (auth, etc.)
  • etc.

If you are working on this please list in this bug which metadata you consider.

Message asking a user to login

It's always confusing for me to have this empty screen when I'm not logged in.
I usually think there's bug somewhere whereas it's because I need to authenticate with Persona.

Front End Log Processing + WebUI: sensitive server list

Use the esworker plugin system to add some info in the event (higher severity for e.g.) if the server attacked is in a sensitive server list (managed by mongodb for storage)

On the webUI, we need to be able to list the content of the sensitive server list and manage it (add, edit, remove servers)

WebUI: theories tab

Theories panel with timestamped history of root cause guesses and evidence. Should also have authors associated to theories.

MozDef screenshot(s)

Publish screenshot(s) of MozDef in action.

Be careful not to disclose private information.

fix loginput index.py: Attribute Error None Type object has no attribute channel on mq timeout

On rabbitmq timeout, kombu/pyamqp goes crazy:

    Traceback (most recent call last):
    File "/home/mozdef/envs/mozdef/lib/python2.7/site-packages/bottle.py", line 764, in _handle
    return route.call(**args)
    File "/home/mozdef/envs/mozdef/lib/python2.7/site-packages/bottle.py", line 1575, in wrapper
    rv = callback(*a, **ka)
    File "/home/mozdef/envs/mozdef/loginput/index.py", line 94, in cefindex
    ensurePublish(cefDict,exchange=eventTaskExchange,routing_key=options.taskexchange)
    File "/home/mozdef/envs/mozdef/lib/python2.7/site-packages/kombu/connection.py", line 462, in _ensured
    new_channel = self.channel()
    File "/home/mozdef/envs/mozdef/lib/python2.7/site-packages/kombu/connection.py", line 246, in channel
    chan = self.transport.create_channel(self.connection)
    File "/home/mozdef/envs/mozdef/lib/python2.7/site-packages/kombu/transport/pyamqp.py", line 87, in create_channel
    return connection.channel()
    AttributeError: 'NoneType' object has no attribute 'channel'

Some people had similar issues with celery:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.