Permalink
Browse files

411 is open source!

  • Loading branch information...
kiwiz committed Aug 12, 2016
0 parents commit fbd43661280f09d3f1865a4911fe66293e57dbf0
Showing 459 changed files with 37,053 additions and 0 deletions.
@@ -0,0 +1,22 @@
+*.swp
+*.db
+bin/r.js
+bin/composer.phar
+htdocs/dist
+htdocs/assets/js/libs
+htdocs/assets/fonts
+htdocs/assets/imgs/favicon.ico
+htdocs/assets/imgs/*
+!htdocs/assets/imgs/load.gif
+!htdocs/assets/imgs/partload.gif
+!htdocs/assets/imgs/nc.gif
+!htdocs/assets/imgs/nca.gif
+!htdocs/assets/imgs/ncs.gif
+htdocs/assets/js/templates.compiled.js
+phpdoc
+extlib
+node_modules
+bower_components
+vendor
+hook.php
+*_
@@ -0,0 +1,15 @@
+<VirtualHost *:80>
+ ServerName HOSTNAME
+
+ php_value include_path ".:/var/www/411/phplib"
+
+ DirectoryIndex index.php index.html index.htm
+ DocumentRoot /var/www/411/htdocs
+ <Directory /var/www/411/htdocs>
+ AllowOverride Indexes FileInfo Options
+ Options -Indexes +FollowSymLinks
+ Order allow,deny
+ Allow from all
+ </Directory>
+
+</VirtualHost>
@@ -0,0 +1,7 @@
+Contributing
+------------
+
+1. Fork the repo and create a topic branch for your change.
+2. Hack on the code!
+3. Rebase your changes against master (as necessary).
+3. Send a pull request.
@@ -0,0 +1,200 @@
+module.exports = function(grunt) {
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+ jshint: {
+ app: {
+ options: {
+ shadow: true, //'inner'
+ unused: false, //'vars'
+ curly: false, //true
+ eqeqeq: false, //true
+
+ freeze: true,
+ futurehostile: true,
+ latedef: true,
+ undef: true,
+ nonbsp: true,
+ sub: true,
+ loopfunc: true,
+ newcap: false,
+ globalstrict: true,
+ browser: true,
+ devel: true,
+ jquery: true,
+ predef: ['require', 'define', 'requirejs', 'Notification']
+ },
+ src: [
+ 'htdocs/assets/js/**/*.js',
+ '!htdocs/assets/js/templates.compiled.js',
+ '!htdocs/assets/js/libs/**/*.js'
+ ],
+ },
+ },
+ requirejs: {
+ js: {
+ options: {
+ baseUrl: 'htdocs/assets/js',
+ removeCombined: true,
+ dir: 'htdocs/dist/js',
+ wrap: true,
+ optimize: 'uglify2',
+ paths: {
+ jquery: 'libs/jquery',
+ uri: 'libs/uri',
+ underscore: 'libs/underscore',
+ backbone: 'libs/backbone',
+ bootstrap: 'libs/bootstrap',
+ routefilter: 'libs/backbone.routefilter',
+ handlebars: 'libs/handlebars',
+ select2: 'libs/select2',
+ tablesorter: 'libs/tablesorter',
+ moment: 'libs/moment',
+ autosize: 'libs/autosize',
+ dragula: 'libs/dragula',
+ mousetrap: 'libs/mousetrap',
+ datetimepicker: 'libs/datetimepicker',
+ chartjs: 'libs/chart',
+ codemirror: 'libs/codemirror',
+ text: 'libs/text',
+ false: 'libs/false',
+
+ templates: 'templates.compiled',
+ data_json: 'empty:',
+ },
+ map: {
+ uri: {
+ punycode: 'libs/false',
+ IPv6: 'libs/false',
+ SecondLevelDomains: 'libs/false',
+ }
+ },
+ modules: [
+ {name: 'main'}
+ ],
+ stubModules: ['punycode', 'IPv6', 'SecondLevelDomains'],
+ preserveLicenseComments: true,
+ generateSourceMaps: false,
+ useStrict: true
+ }
+ },
+ css: {
+ options: {
+ keepBuildDir: false,
+ optimizeCss: "standard",
+ cssIn: "htdocs/assets/css/main.css",
+ out: "htdocs/dist/css/main.css"
+ }
+ }
+ },
+ handlebars: {
+ app: {
+ files: {
+ "htdocs/assets/js/templates.compiled.js": ["htdocs/assets/templates/**/*.html"]
+ },
+ options: {
+ amd: true,
+ processName: function(filePath) {
+ return filePath.replace(/^htdocs\/assets\/templates\//, '').replace(/\.html$/, '');
+ }
+ }
+ }
+ },
+ copy: {
+ deps: {
+ files: [
+ // {nonull: true, src: 'bower_components/bootstrap/dist/css/bootstrap.css', dest: 'htdocs/assets/css/bootstrap.css'},
+ {nonull: true, src: 'bower_components/dragula.js/dist/dragula.css', dest: 'htdocs/assets/css/dragula.css'},
+ {nonull: true, src: 'bower_components/bootswatch/slate/bootstrap.css', dest: 'htdocs/assets/css/bootstrap.css'},
+ {nonull: true, src: 'bower_components/select2/select2.css', dest: 'htdocs/assets/css/select2.css'},
+ {nonull: true, src: 'bower_components/select2-bootstrap3-css/select2-bootstrap.css', dest: 'htdocs/assets/css/select2-bootstrap.css'},
+ {nonull: true, src: 'bower_components/jquery.tablesorter/css/theme.bootstrap.css', dest: 'htdocs/assets/css/tablesorter-bootstrap.css' },
+ {nonull: true, src: 'bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css', dest: 'htdocs/assets/css/datetimepicker.css' },
+ {nonull: true, src: 'bower_components/codemirror/lib/codemirror.css', dest: 'htdocs/assets/css/codemirror.css'},
+
+ {expand: true, cwd: 'bower_components/bootstrap/dist/fonts/', nonull: true, src: '*', dest: 'htdocs/assets/fonts/' },
+
+ {expand: true, cwd: 'bower_components/select2/', nonull: true, src: '*.{png,gif}', dest: 'htdocs/assets/imgs/' },
+
+ {nonull: true, src: 'bower_components/dragula.js/dist/dragula.js', dest: 'htdocs/assets/js/libs/dragula.js'},
+ {nonull: true, src: 'bower_components/autosize/dist/autosize.js', dest: 'htdocs/assets/js/libs/autosize.js' },
+ {nonull: true, src: 'bower_components/bootstrap/dist/js/bootstrap.js', dest: 'htdocs/assets/js/libs/bootstrap.js'},
+ {expand: true, cwd: 'bower_components/handlebars/', nonull: true, src: '{handlebars,handlebars.runtime}.js', dest: 'htdocs/assets/js/libs/'},
+ {nonull: true, src: 'bower_components/codemirror/lib/codemirror.js', dest: 'htdocs/assets/js/libs/codemirror.js'},
+ {nonull: true, src: 'bower_components/Chart.js/dist/Chart.js', dest: 'htdocs/assets/js/libs/chart.js'},
+ {nonull: true, src: 'bower_components/jquery/dist/jquery.js', dest: 'htdocs/assets/js/libs/jquery.js'},
+ {nonull: true, src: 'bower_components/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js', dest: 'htdocs/assets/js/libs/datetimepicker.js'},
+ {nonull: true, src: 'bower_components/select2/select2.js', dest: 'htdocs/assets/js/libs/select2.js'},
+ {nonull: true, src: 'bower_components/jquery.tablesorter/dist/js/jquery.tablesorter.combined.js', dest: 'htdocs/assets/js/libs/tablesorter.js'},
+ {nonull: true, src: 'bower_components/requirejs/require.js', dest: 'htdocs/assets/js/libs/require.js'},
+ {nonull: true, src: 'bower_components/underscore/underscore.js', dest: 'htdocs/assets/js/libs/underscore.js'},
+ {nonull: true, src: 'bower_components/requirejs-text/text.js', dest: 'htdocs/assets/js/libs/text.js'},
+ {nonull: true, src: 'bower_components/mousetrap/mousetrap.js', dest: 'htdocs/assets/js/libs/mousetrap.js'},
+ {nonull: true, src: 'bower_components/uri.js/src/URI.js', dest: 'htdocs/assets/js/libs/uri.js'},
+ {nonull: true, src: 'bower_components/backbone/backbone.js', dest: 'htdocs/assets/js/libs/backbone.js'},
+ {nonull: true, src: 'bower_components/routefilter/dist/backbone.routefilter.js', dest: 'htdocs/assets/js/libs/backbone.routefilter.js'},
+ {nonull: true, src: 'bower_components/moment/moment.js', dest: 'htdocs/assets/js/libs/moment.js'},
+ {nonull: true, src: 'bower_components/false/false.js', dest: 'htdocs/assets/js/libs/false.js'},
+ ],
+ },
+ app: {
+ files: [
+ {expand: true, cwd: 'htdocs/assets', src: ['imgs/**', 'fonts/*'], dest: 'htdocs/dist', filter: 'isFile'},
+ {expand: true, cwd: 'htdocs', src: ['index-src.html'], dest: 'htdocs'},
+ ]
+ },
+ index: {
+ files: [
+ {src: 'htdocs/index-src.html', dest: 'htdocs/index.html'}
+ ]
+ },
+ },
+ sed: {
+ app: {
+ path: 'htdocs/dist/js/main.js',
+ pattern: '/assets/',
+ replacement: '/dist/',
+ },
+ select2: {
+ path: 'htdocs/assets/css/select2.css',
+ pattern: /url\('/g,
+ replacement: "url('../imgs/",
+ },
+ dev: {
+ path: 'htdocs/index.html',
+ pattern: 'ASSET_DIR',
+ replacement: 'assets',
+ },
+ prod: {
+ path: 'htdocs/index.html',
+ pattern: 'ASSET_DIR',
+ replacement: 'dist',
+ }
+ },
+ run: {
+ docs: {
+ cmd: 'vendor/bin/phpdoc',
+ args: ['run', '-d', 'phplib', '-t', 'phpdoc']
+ },
+ tests: {
+ cmd: 'vendor/bin/phpunit',
+ args: ['-c', 'tests/phpunit.xml'],
+ }
+ }
+ });
+
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-contrib-handlebars');
+ grunt.loadNpmTasks('grunt-contrib-requirejs');
+ grunt.loadNpmTasks('grunt-run');
+ grunt.loadNpmTasks('grunt-sed');
+
+ grunt.registerTask('deps', ['copy:deps']);
+ grunt.registerTask('default', ['prod']);
+
+ // Public
+ grunt.registerTask('dev', ['deps', 'sed:select2', 'copy:index', 'sed:dev']);
+ grunt.registerTask('prod', ['deps', 'jshint:app', 'handlebars:app', 'copy:app', 'sed:select2', 'requirejs:js', 'requirejs:css', 'sed:app', 'copy:index', 'sed:prod']);
+ grunt.registerTask('tests', ['run:tests']);
+ grunt.registerTask('docs', ['run:docs']);
+};
21 LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Kai Zhong/Ken Lee/Etsy
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
@@ -0,0 +1,46 @@
+![411](/docs/imgs/logo.png?raw=true)
+
+
+What is 411?
+============
+
+A Search scheduler
+------------------
+
+Configure Searches to periodically run against a variety of data sources. You can define a custom pipeline of Filters to manipulate any generated Alerts and forward them to multiple Targets.
+
+
+An alert management interface
+-----------------------------
+
+Review and manage Alerts through the web interface. You can apply Renderers to alerts to enrich them with additional metadata.
+
+
+Help
+====
+
+Check out the [setup guide](/docs/Setup.md) to quickly configure a 411 instance.
+
+See the [Table of Contents](/docs/README.md) for a list of documentation pages.
+
+If you've any questions on 411, contact us on twitter at [@sixhundredns](https://twitter.com/sixhundredns) and [@kennysan](https://twitter.com/Kennysan)!
+
+
+Links
+=====
+
+- Defcon presentation (Not available yet)
+- [Slides](https://speakerdeck.com/kennysan/411-a-framework-for-managing-security-alerts)
+- [Demo](https://demo.fouroneone.io) (User: user, Pass: user)
+
+
+Contribute
+==========
+
+Check out the contribution [guidelines](/CONTRIBUTING.md).
+
+
+License
+=======
+
+411 is released under the [MIT License](/LICENSE).
@@ -0,0 +1,31 @@
+#!/usr/bin/php
+<?php
+
+/**
+ * Entrypoint for backfilling results.
+ * Useful if 411 fails catastrophically.
+ */
+
+require_once(__DIR__ . '/../phplib/411bootstrap.php');
+
+// Arg parsing.
+if($argc < 3) {
+ print "Usage: backfill.php start_date end_date [max_jobs]\n";
+ exit(0);
+}
+
+$start_date = (int) $argv[1];
+$end_date = (int) $argv[2];
+$max_jobs = 2;
+
+if($argc > 3) {
+ $max_jobs = (int) $argv[3];
+}
+
+if($max_jobs < 1) {
+ print "[-] max_jobs must be at least 1\n";
+ exit(1);
+}
+
+$sch = new FOO\Scheduler;
+$sch->backfill($start_date, $end_date, $max_jobs);
@@ -0,0 +1,30 @@
+#!/usr/bin/php
+<?php
+
+/**
+ * Script to create a new site.
+ */
+require_once(__DIR__ . '/../phplib/411bootstrap.php');
+
+echo "Creating new site\n";
+
+$newsite = new FOO\Site();
+$newsite['name'] = FOO\Util::prompt("Site name");
+$newsite['host'] = FOO\Util::prompt("Hostname");
+$newsite->store();
+
+FOO\SiteFinder::setSite($newsite);
+$cfg = new FOO\DBConfig();
+$cfg['cookie_secret'] = FOO\Random::base64_bytes(24);
+$cfg['cron_enabled'] = 1;
+$cfg['worker_enabled'] = 1;
+$cfg['summary_enabled'] = 1;
+$cfg['last_cron_date'] = 0;
+$cfg['last_rollup_date'] = 0;
+$cfg['error_email_enabled'] = 1;
+$cfg['error_email_throttle'] = 30;
+$cfg['from_email'] = FOO\Util::prompt('From email');
+$cfg['from_error_email'] = FOO\Util::prompt('From Error email');
+$cfg['default_email'] = FOO\Util::prompt('Default To email');
+
+printf("\nSite created! ID: %d\n", $newsite['id']);
Oops, something went wrong.

0 comments on commit fbd4366

Please sign in to comment.