{% blocktrans %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}
{% blocktrans with viewed_user.userena_signup.email_unconfirmed as email %}You have received an email at {{ email }}.{% endblocktrans %}
9 |
{% blocktrans with viewed_user.username as username %}To associate this email address with your account ({{ username }}) click on the link provided in this email.{% endblocktrans %}
10 | {% endblock %}
11 |
--------------------------------------------------------------------------------
/manati/user_profiles/templates/userena/emails/confirmation_email_message_old.txt:
--------------------------------------------------------------------------------
1 | {% load i18n %}{% autoescape off %}
2 | {% if not without_usernames %}{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %}
3 | {% endif %}
4 | {% blocktrans with site.name as site %}There was a request to change your email address at {{ site }}.{% endblocktrans %}
5 |
6 | {% blocktrans %}An email has been send to {{ new_email }} which contains a verification link. Click on the link in this email to activate it.{% endblocktrans %}
7 |
8 | {% trans "Thanks for using our site!" %}
9 |
10 | {% trans "Sincerely" %},
11 | {{ site.name }}
12 | {% endautoescape %}
13 |
--------------------------------------------------------------------------------
/manati/user_profiles/templates/userena/emails/confirmation_email_message_new.txt:
--------------------------------------------------------------------------------
1 | {% load i18n %}{% autoescape off %}
2 | {% if not without_usernames %}{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %}
3 | {% endif %}
4 | {% blocktrans with site.name as site %}You requested a change of your email address at {{ site }}.{% endblocktrans %}
5 |
6 |
7 | {% trans "Please confirm this email address by clicking on the link below:" %}
8 |
9 | {{ protocol }}://{{ site.domain }}{% url 'userena_email_confirm' confirmation_key %}
10 |
11 |
12 | {% trans "Thanks for using our site!" %}
13 |
14 | {% trans "Sincerely" %},
15 | {{ site.name }}
16 | {% endautoescape %}
17 |
--------------------------------------------------------------------------------
/compose/local/django/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM python:2.7
2 | ENV PYTHONUNBUFFERED 1
3 | RUN groupadd -r manati \
4 | && useradd -r -g manati manati_user
5 |
6 | RUN apt-get update && apt-get install -y gcc
7 | RUN apt-get install -y python python-pip python-dev libpq-dev python-setuptools \
8 | build-essential \
9 | software-properties-common
10 | RUN apt-get install -y libssl-dev libffi-dev
11 | RUN mkdir /code
12 | WORKDIR /code/
13 | ADD ./requirements/base.txt /code/
14 | ADD ./requirements/local.txt /code/
15 | RUN pip install --upgrade pip
16 | RUN pip install --no-cache-dir setuptools
17 | RUN pip install --no-cache-dir -r local.txt
18 | ADD . /code/
19 |
--------------------------------------------------------------------------------
/manati/ip_profiles/views.py:
--------------------------------------------------------------------------------
1 | from django.shortcuts import render
2 | from django.views.decorators.csrf import csrf_exempt
3 | from django.contrib.auth.decorators import login_required
4 | import logging
5 | # Get an instance of a logger
6 | logger = logging.getLogger(__name__)
7 | REDIRECT_TO_LOGIN = "/manati_project/login"
8 |
9 | @login_required(login_url=REDIRECT_TO_LOGIN)
10 | @csrf_exempt
11 | def index(request):
12 | context = {}
13 | return render(request, 'ip_profiles/index.html', context)
14 |
15 | @login_required(login_url=REDIRECT_TO_LOGIN)
16 | @csrf_exempt
17 | def new(request):
18 | context = {}
19 | return render(request, 'ip_profiles/new.html', context)
20 |
21 |
22 |
--------------------------------------------------------------------------------
/manati/user_profiles/templates/userena/activate_retry_success.html:
--------------------------------------------------------------------------------
1 | {% extends 'userena/base_userena.html' %}
2 | {% load i18n %}
3 |
4 |
5 | {% block title %}{% trans "Account re-activation succeeded." %}{% endblock %}
6 | {% block content_title %}
{% trans "Account re-activation" %}
{% endblock %}
7 |
8 | {% block content %}
9 |
{% blocktrans %}You requested a new activation of your account..{% endblocktrans %}
10 |
{% blocktrans %}You have been sent an e-mail with an activation link to the supplied email.{% endblocktrans %}
11 |
{% blocktrans %}We will store your signup information for {{ userena_activation_days }} days on our server. {% endblocktrans %}
12 | {% endblock %}
13 |
--------------------------------------------------------------------------------
/compose/production/django/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM python:2.7
2 | ENV PYTHONUNBUFFERED 1
3 | RUN groupadd -r manati \
4 | && useradd -r -g manati manati_user
5 |
6 | RUN apt-get update && apt-get install -y gcc
7 | RUN apt-get install -y python python-pip python-dev libpq-dev python-setuptools \
8 | build-essential \
9 | software-properties-common
10 | RUN apt-get install -y libssl-dev libffi-dev
11 | RUN mkdir /code
12 | WORKDIR /code/
13 | ADD ./requirements/base.txt /code/
14 | ADD ./requirements/production.txt /code/
15 | RUN pip install --upgrade pip
16 | RUN pip install --no-cache-dir setuptools
17 | RUN pip install --no-cache-dir -r production.txt
18 | ADD . /code/
19 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/models/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2016-2018 Stratosphere Lab
2 | # This file is part of ManaTI Project - https://stratosphereips.org
3 | # See the file 'docs/LICENSE' for copying permission.
4 | # Created by Raul B. Netto on 8/25/18.
5 | from .models import get_anonymous_user_instance, MESSAGE_TAGS
6 | from .base import TimeStampedModel
7 | from .app_parameter import AppParameter
8 | from .comment import Comment
9 | from .consult import VTConsult, WhoisConsult
10 | from .metric import Metric
11 | from .models import User, IOC, Weblog, WeblogHistory, ModuleAuxWeblog, AnalysisSession, AnalysisSessionUsers, \
12 | WHOISRelatedIOC
13 | from .models import RegisterStatus
14 |
--------------------------------------------------------------------------------
/utility/redis_worker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | function checkIt()
3 | {
4 | number=$(ps aux | grep $1 | wc -l)
5 |
6 | if [ $number -gt 1 ]; then
7 | return=true
8 | else
9 | return=false
10 | fi;
11 | }
12 |
13 | checkIt "redis-server"
14 | echo "Redis Server running:"
15 | echo $return
16 | if [ "$return" != "true" ]; then
17 | echo "Run redis"
18 | redis-server /usr/local/etc/redis.conf &
19 | fi;
20 |
21 | checkIt "rqworker"
22 | echo "RQ Worker running:"
23 | echo $return
24 | if [ "$return" != "true" ]; then
25 | echo "Run rqworker"
26 | python ./manage.py rqworker high default low &
27 | fi;
28 |
29 |
30 | echo "Check new external modules"
31 | python ./manage.py check_external_modules
32 |
--------------------------------------------------------------------------------
/manati/api_manager/migrations/0007_auto_20171128_1156.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Generated by Django 1.9.7 on 2017-11-28 10:56
3 | from __future__ import unicode_literals
4 |
5 | from django.db import migrations, models
6 | import django.db.models.deletion
7 |
8 |
9 | class Migration(migrations.Migration):
10 |
11 | dependencies = [
12 | ('api_manager', '0006_auto_20171019_0043'),
13 | ]
14 |
15 | operations = [
16 | migrations.AlterField(
17 | model_name='ioc_whois_relatedexecuted',
18 | name='ioc',
19 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='whois_relation_executions', to='analysis_sessions.IOC'),
20 | ),
21 | ]
22 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/models/app_parameter.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2016-2018 Stratosphere Lab
2 | # This file is part of ManaTI Project - https://stratosphereips.org
3 | # See the file 'docs/LICENSE' for copying permission.
4 | # Created by Raul B. Netto on 8/26/18.
5 | from django.db import models
6 | from .base import TimeStampedModel
7 | from model_utils import Choices
8 |
9 |
10 | class AppParameter(TimeStampedModel):
11 | KEY_OPTIONS = Choices(('virus_total_key_api', 'Virus Total Key API'))
12 | key = models.CharField(choices=KEY_OPTIONS, default='', max_length=20, null=False)
13 | value = models.CharField(null=False, default='', max_length=255)
14 |
15 | class Meta:
16 | db_table = 'manati_app_parameters'
17 |
--------------------------------------------------------------------------------
/utility/production_settings/ubuntu/uwsgi_params:
--------------------------------------------------------------------------------
1 |
2 | uwsgi_param QUERY_STRING $query_string;
3 | uwsgi_param REQUEST_METHOD $request_method;
4 | uwsgi_param CONTENT_TYPE $content_type;
5 | uwsgi_param CONTENT_LENGTH $content_length;
6 |
7 | uwsgi_param REQUEST_URI $request_uri;
8 | uwsgi_param PATH_INFO $document_uri;
9 | uwsgi_param DOCUMENT_ROOT $document_root;
10 | uwsgi_param SERVER_PROTOCOL $server_protocol;
11 | uwsgi_param REQUEST_SCHEME $scheme;
12 | uwsgi_param HTTPS $https if_not_empty;
13 |
14 | uwsgi_param REMOTE_ADDR $remote_addr;
15 | uwsgi_param REMOTE_PORT $remote_port;
16 | uwsgi_param SERVER_PORT $server_port;
17 | uwsgi_param SERVER_NAME $server_name;
--------------------------------------------------------------------------------
/manati/user_profiles/templates/userena/emails/password_reset_message.txt:
--------------------------------------------------------------------------------
1 | {% load i18n %}{% autoescape off %}
2 | {% blocktrans %}You're receiving this e-mail because you requested a password reset
3 | for your user account at {{ site_name }}{% endblocktrans %}.
4 |
5 | {% trans "Please go to the following page and choose a new password:" %}
6 | {% block reset_link %}
7 | {{ protocol }}://{{ domain }}{% url 'userena_password_reset_confirm' uid token %}
8 | {% endblock %}
9 |
10 | {% if not without_usernames %}{% blocktrans with user.username as username %}
11 | Your username, in case you've forgotten: {{ username }}
12 | {% endblocktrans %}
13 | {% endif %}
14 | {% trans "Thanks for using our site!" %}
15 |
16 | {% trans "Sincerely" %},
17 | {{ site_name }}
18 | {% endautoescape %}
19 |
--------------------------------------------------------------------------------
/utility/local.yml.example:
--------------------------------------------------------------------------------
1 | version: '2'
2 |
3 | volumes:
4 | postgres_data_local: {}
5 | postgres_backup_local: {}
6 |
7 | services:
8 | django:
9 | build:
10 | context: .
11 | dockerfile: ./compose/local/django/Dockerfile
12 | depends_on:
13 | - postgres
14 | volumes:
15 | - .:/app
16 | environment:
17 | - POSTGRES_USER=manati
18 | - USE_DOCKER=yes
19 | ports:
20 | - "8000:8000"
21 | command: /start.sh
22 |
23 | postgres:
24 | build:
25 | context: .
26 | dockerfile: ./compose/production/postgres/Dockerfile
27 | volumes:
28 | - postgres_data_local:/var/lib/postgresql/data
29 | - postgres_backup_local:/backups
30 | environment:
31 | - POSTGRES_USER=manati
32 |
33 |
34 |
--------------------------------------------------------------------------------
/manati/user_profiles/templates/userena/emails/activation_email_message.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}{% autoescape off %}
2 |
3 |
4 | {% if not without_usernames %}
{% blocktrans with user.username as username %}Dear {{ username }},
{% endblocktrans %}{% endif %}
5 | {% blocktrans with site.name as site %}
Thank you for signing up at {{ site }}.
{% endblocktrans %}
6 |
7 | {% trans "To activate your account you should click on the link below:" %}
8 | {{ protocol }}://{{ site.domain }}{% url 'userena_activate' activation_key %}
9 |
10 |
11 | {% trans "Thanks for using our site!" %}
12 | {% trans "Sincerely" %},
13 | {{ site.name }}
14 |
15 |
16 |
17 | {% endautoescape %}
18 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/models/base.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2016-2018 Stratosphere Lab
2 | # This file is part of ManaTI Project - https://stratosphereips.org
3 | # See the file 'docs/LICENSE' for copying permission.
4 | # Created by Raul B. Netto on 8/25/18.
5 | from django.db import models
6 | from model_utils.fields import AutoCreatedField, AutoLastModifiedField
7 | from django.utils.translation import ugettext_lazy as _
8 |
9 |
10 | class TimeStampedModel(models.Model):
11 | """
12 | An abstract base class model that provides self-updating
13 | ``created`` and ``modified`` fields.
14 |
15 | """
16 | created_at = AutoCreatedField(_('created_at'))
17 | updated_at = AutoLastModifiedField(_('updated_at'))
18 |
19 | class Meta:
20 | abstract = True
21 |
--------------------------------------------------------------------------------
/manati/templates/account/signup.html:
--------------------------------------------------------------------------------
1 | {% extends "account/base.html" %}
2 |
3 | {% load i18n %}
4 | {% load crispy_forms_tags %}
5 |
6 | {% block head_title %}{% trans "Signup" %}{% endblock %}
7 |
8 | {% block inner %}
9 |
{% trans "Sign Up" %}
10 |
11 |
{% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %}
{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %}
{% endif %}
5 |
6 | {% blocktrans with site.name as site %}There was a request to change your email address at {{ site }}.{% endblocktrans %}
7 |
8 |
9 |
10 | {% blocktrans %}An email has been send to {{ new_email }} which contains a verification link. Click on the link in this email to activate it.{% endblocktrans %}
11 |
19 |
20 |
21 | {% endautoescape %}
22 |
--------------------------------------------------------------------------------
/utility/production_settings/ubuntu/manati_uwsgi.ini:
--------------------------------------------------------------------------------
1 |
2 | # manati_uwsgi.ini file
3 | [uwsgi]
4 | # Django-related settings
5 | # the base directory (full path)
6 | chdir = /var/www/manati
7 | # Django's wsgi file
8 | module = config.wsgi:application
9 | # the virtualenv (full path)
10 | home = /var/www/manati/.vmanati
11 | # process-related settings
12 | # master
13 | master = true
14 | # maximum number of worker processes
15 | processes = 4
16 | # the socket (use the full path to be safe)
17 | socket = /var/run/manati.sock
18 | # ... with appropriate permissions - may be needed
19 | chmod-socket = 666
20 | # clear environment on exit
21 | vacuum = true
22 | # create a pidfile
23 | pidfile = /var/run/manati.pid
24 | # background the process & log
25 | #daemonize = /code/logs/uwsgi.log
26 |
27 |
--------------------------------------------------------------------------------
/manati/user_profiles/templates/userena/emails/confirmation_email_message_new.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}{% autoescape off %}
2 |
3 |
4 | {% if not without_usernames %}
{% blocktrans with user.username as username %}Dear {{ username }},
{% endblocktrans %}{% endif %}
5 |
6 | {% blocktrans with site.name as site %}You requested a change of your email address at {{ site }}.{% endblocktrans %}
7 |
8 |
9 | {% trans "Please confirm this email address by clicking on the link below:" %}
10 | {{ protocol }}://{{ site.domain }}{% url 'userena_email_confirm' confirmation_key %}
11 |
12 |
13 | {% trans "Thanks for using our site!" %}
14 | {% trans "Sincerely" %},
15 | {{ site_name }}
16 |
17 |
18 |
19 | {% endautoescape %}
20 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/static/manati_ui/css/libs/metisMenu.min.css:
--------------------------------------------------------------------------------
1 | /*
2 | * metismenu - v1.1.3
3 | * Easy menu jQuery plugin for Twitter Bootstrap 3
4 | * https://github.com/onokumus/metisMenu
5 | *
6 | * Made by Osman Nuri Okumus
7 | * Under MIT License
8 | */
9 |
10 | .arrow{float:right;line-height:1.42857}.glyphicon.arrow:before{content:"\e079"}.active>a>.glyphicon.arrow:before{content:"\e114"}.fa.arrow:before{content:"\f104"}.active>a>.fa.arrow:before{content:"\f107"}.plus-times{float:right}.fa.plus-times:before{content:"\f067"}.active>a>.fa.plus-times{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.plus-minus{float:right}.fa.plus-minus:before{content:"\f067"}.active>a>.fa.plus-minus:before{content:"\f068"}
--------------------------------------------------------------------------------
/manati/api_manager/modules/bulk_labeling_whois_relation.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2016-2018 Stratosphere Lab
2 | # This file is part of ManaTI Project - https://stratosphereips.org
3 | # See the file 'docs/LICENSE' for copying permission.
4 | # Created by Raul B. Netto on 1/28/18.
5 | from api_manager.core.modules_manager import ModulesManager
6 | from api_manager.common.abstracts import Module
7 |
8 |
9 | class BulklabelingWhoisrelation(Module):
10 |
11 | module_name = 'bulk_labeling_whois_relation'
12 | description = 'FAKE MODULE FOR BULK WHOIS LABELING. THIS PROCESS IS IMPLEMENTED IN modules_manage.py'
13 | version = 'v0.1'
14 | authors = ['Raul B. Netto']
15 | events = [ModulesManager.MODULES_RUN_EVENTS.by_request]
16 |
17 | def run(self, **kwargs):
18 | pass
19 |
20 |
21 | module_obj = BulklabelingWhoisrelation()
22 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/static/manati_ui/js/modules/helpers/alert_message_helper.js:
--------------------------------------------------------------------------------
1 | var updateAlertBox = function(html){
2 | var container = $("#flash-messages-container");
3 | (html != "") ? container.html(html).show().delay(5000).fadeOut(3000) : container.html(html).hide();
4 | }
5 | var eventAlertBox = function (){
6 | var container = $("#flash-messages-container");
7 | if(container.html().length > 0){
8 | container.show().delay(5000).fadeOut(3000);
9 | }else{
10 | container.hide();
11 | }
12 | }
13 | var updateAlertBoxText = function (msg, state){
14 | var temp_html = "
{% blocktrans %}This part of the site requires us to verify that
13 | you are who you claim to be. For this purpose, we require that you
14 | verify ownership of your e-mail address. {% endblocktrans %}
15 |
16 |
{% blocktrans %}We have sent an e-mail to you for
17 | verification. Please click on the link inside this e-mail. Please
18 | contact us if you do not receive it within a few minutes.{% endblocktrans %}
5 | {% blocktrans %}You're receiving this e-mail because you requested a password reset
6 | for your user account at {{ site_name }}{% endblocktrans %}.
7 |
8 |
9 | {% trans "Please go to the following page and choose a new password:" %}
10 | {% block reset_link %}
11 | {{ protocol }}://{{ domain }}{% url 'userena_password_reset_confirm' uid token %}
12 | {% endblock %}
13 |
14 | {% if not without_usernames %}
15 |
{% blocktrans with user.username as username %}Your username, in case you've forgotten: {{ username }}{% endblocktrans %}
16 | {% endif %}
17 |
18 | {% trans "Thanks for using our site!" %}
19 | {% trans "Sincerely" %},
20 | {{ site_name }}
21 |
22 |
23 |
24 | {% endautoescape %}
25 |
--------------------------------------------------------------------------------
/utility/production.yml.example:
--------------------------------------------------------------------------------
1 | version: '2'
2 |
3 | volumes:
4 | postgres_data: {}
5 | postgres_backup: {}
6 | caddy: {}
7 |
8 | services:
9 | django:
10 | build:
11 | context: .
12 | dockerfile: ./compose/production/django/Dockerfile
13 | depends_on:
14 | - postgres
15 | - redis
16 | env_file: .env
17 | command: /gunicorn.sh
18 |
19 | postgres:
20 | build:
21 | context: .
22 | dockerfile: ./compose/production/postgres/Dockerfile
23 | volumes:
24 | - postgres_data:/var/lib/postgresql/data
25 | - postgres_backup:/backups
26 | env_file: .env
27 |
28 | caddy:
29 | build:
30 | context: .
31 | dockerfile: ./compose/production/caddy/Dockerfile
32 | depends_on:
33 | - django
34 | volumes:
35 | - caddy:/root/.caddy
36 | env_file: .env
37 | ports:
38 | - "0.0.0.0:80:80"
39 | - "0.0.0.0:443:443"
40 |
41 | redis:
42 | image: redis:3.0
43 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/static/manati_ui/css/libs/fluid-labels.css:
--------------------------------------------------------------------------------
1 |
2 | body {
3 | font-family: 'Helvetica';
4 | }
5 | .fluid-label {
6 | position: relative;
7 | border: 1px solid lightgray;
8 | }
9 |
10 | .fluid-label input,
11 | .fluid-label textarea {
12 | font-size: 16px;
13 | border: none;
14 | outline: none;
15 | /*background-color:#fafafa;*/
16 | }
17 |
18 |
19 | .fluid-label label {
20 | font-size: 10px;
21 | top: 5px;
22 | }
23 |
24 | .fluid-label.focused {
25 | /*border-color: #298eea;*/
26 | }
27 |
28 | .fluid-label.focused label {
29 | color: #298eea;
30 | }
31 | .fluid-label {
32 | position: relative;
33 | padding: 10px;
34 | border-radius: 2px;
35 | display: inline-block;
36 | }
37 |
38 | .fluid-label input, .fluid-label textarea {
39 | border: none;
40 | outline: none;
41 | position: relative;
42 | }
43 |
44 | .fluid-label label {
45 | position: absolute;
46 | top: 5px;
47 | font-weight: 400 !important;
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/manati/login/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 |
--------------------------------------------------------------------------------
/manati/api_manager/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/models/comment.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2016-2018 Stratosphere Lab
2 | # This file is part of ManaTI Project - https://stratosphereips.org
3 | # See the file 'docs/LICENSE' for copying permission.
4 | # Created by Raul B. Netto on 8/26/18.
5 |
6 | from django.db import models
7 | from .base import TimeStampedModel
8 | from django.contrib.contenttypes.models import ContentType
9 | from django.contrib.contenttypes.fields import GenericForeignKey
10 | from django.contrib.auth.models import User
11 |
12 |
13 | class Comment(TimeStampedModel):
14 | user = models.ForeignKey(User, on_delete=models.CASCADE, default=1)
15 | content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) # Weblog or AnalysisSession
16 | object_id = models.CharField(max_length=20)
17 | content_object = GenericForeignKey('content_type', 'object_id')
18 | text = models.CharField(max_length=255)
19 |
20 | class Meta:
21 | db_table = 'manati_comments'
22 |
--------------------------------------------------------------------------------
/manati/api_manager/common/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 |
--------------------------------------------------------------------------------
/manati/api_manager/core/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 |
--------------------------------------------------------------------------------
/manati/api_manager/modules/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 |
--------------------------------------------------------------------------------
/manati/login/migrations/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 |
--------------------------------------------------------------------------------
/manati/api_manager/migrations/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 |
--------------------------------------------------------------------------------
/manati/templates/account/password_reset.html:
--------------------------------------------------------------------------------
1 | {% extends "account/base.html" %}
2 |
3 | {% load i18n %}
4 | {% load account %}
5 | {% load crispy_forms_tags %}
6 |
7 | {% block head_title %}{% trans "Password Reset" %}{% endblock %}
8 |
9 | {% block inner %}
10 |
11 |
{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}
17 |
18 |
23 |
24 |
{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}
25 | {% endblock %}
26 |
27 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/management/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/templates/manati_ui/analysis_session/table_options.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/templatetags/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/management/commands/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/management/commands/_private.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 |
--------------------------------------------------------------------------------
/manati/user_profiles/templates/userena/profile_form.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load crispy_forms_tags %}
3 |
4 | {% load i18n %}
5 |
6 | {% block title %}{% trans "Account setup" %}{% endblock %}
7 |
8 | {% block content_title %}
{% blocktrans with profile.user.username as username %}Account » {{ username }}{% endblocktrans %}
--------------------------------------------------------------------------------
/manati/user_profiles/models.py:
--------------------------------------------------------------------------------
1 | from __future__ import unicode_literals
2 |
3 | from django.db import models
4 | from django.contrib.auth.models import User
5 | from django.utils.translation import ugettext as _
6 | from userena.models import UserenaBaseProfile
7 | from encrypted_fields import EncryptedTextField, EncryptedEmailField
8 | from model_utils.fields import AutoCreatedField, AutoLastModifiedField
9 |
10 |
11 | class UserProfile(UserenaBaseProfile):
12 | user = models.OneToOneField(User, unique=True, related_name='profile')
13 | passivetotal_key_api = EncryptedTextField(null=True, max_length=255)
14 | passivetotal_user = EncryptedEmailField(null=True, max_length=60)
15 | virustotal_key_api = EncryptedTextField(null=True, max_length=255)
16 | threshold_whois_distance = models.IntegerField(default=75, null=True)
17 | created_at = AutoCreatedField(_('created_at'))
18 | updated_at = AutoLastModifiedField(_('updated_at'))
19 |
20 | class Meta:
21 | db_table = 'manati_users_profiles'
22 |
23 |
--------------------------------------------------------------------------------
/manati/login/tests.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from django.test import TestCase
22 |
23 | # Create your tests here.
24 |
--------------------------------------------------------------------------------
/manati/api_manager/tests.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from django.test import TestCase
22 |
23 | # Create your tests here.
24 |
--------------------------------------------------------------------------------
/manati/login/admin.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from django.contrib import admin
22 |
23 | # Register your models here.
24 |
--------------------------------------------------------------------------------
/manati/api_manager/admin.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from django.contrib import admin
22 |
23 | # Register your models here.
24 |
--------------------------------------------------------------------------------
/manati/api_manager/views.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from django.shortcuts import render
22 |
23 | # Create your views here.
24 |
--------------------------------------------------------------------------------
/utility/production_settings/ubuntu/manati_nginx.conf:
--------------------------------------------------------------------------------
1 | # manati_nginx.conf
2 |
3 | # the upstream component nginx needs to connect to
4 | upstream manati {
5 | # server 127.0.0.1:8001;
6 | server unix:///var/run/manati.sock; # for a file socket, more effective
7 | }
8 |
9 | # configuration of the server
10 | server {
11 | # the port your site will be served on
12 | listen 80;
13 | server_name .manatiproject.com;
14 | charset utf-8;
15 | # max upload size
16 | client_max_body_size 75M; # adjust to taste
17 | # Django media
18 | location /media {
19 | alias /var/www/manati/media; # your Django project's media files - amend as required
20 | }
21 | location /static {
22 | alias /var/www/manati/staticfiles; # your Django project's static files - amend as required
23 | }
24 | # Finally, send all non-media requests to the Django server.
25 | location / {
26 | uwsgi_pass manati;
27 | include /var/www/manati/uwsgi_params; # the uwsgi_params file you installed
28 | }
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/manati/user_profiles/templates/userena/email_form.html:
--------------------------------------------------------------------------------
1 | {% extends 'userena/base_userena.html' %}
2 | {% load i18n %}
3 |
4 | {% block content_title %}
{% blocktrans with user.username as username %}Account » {{ username }}{% endblocktrans %}
{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}
9 |
10 | {% if token_fail %}
11 | {% url 'account_reset_password' as passwd_reset_url %}
12 |
{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktrans %}
13 | {% else %}
14 | {% if form %}
15 |
20 | {% else %}
21 |
{% trans 'Your password is now changed.' %}
22 | {% endif %}
23 | {% endif %}
24 | {% endblock %}
25 |
26 |
--------------------------------------------------------------------------------
/manati/login/models.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from __future__ import unicode_literals
22 |
23 | from django.db import models
24 |
25 | # Create your models here.
26 |
--------------------------------------------------------------------------------
/manati/templates/account/email_confirm.html:
--------------------------------------------------------------------------------
1 | {% extends "account/base.html" %}
2 |
3 | {% load i18n %}
4 | {% load account %}
5 |
6 | {% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %}
7 |
8 |
9 | {% block inner %}
10 |
{% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}
28 |
29 | {% endif %}
30 |
31 | {% endblock %}
32 |
33 |
--------------------------------------------------------------------------------
/manati/login/apps.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from __future__ import unicode_literals
22 |
23 | from django.apps import AppConfig
24 |
25 |
26 | class LoginConfig(AppConfig):
27 | name = 'manati.login'
28 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | # PostgreSQL
2 | POSTGRES_PASSWORD=password
3 | POSTGRES_USER=manati_db_user
4 | POSTGRES_DB=manati_db
5 | POSTGRES_HOST=localhost
6 | POSTGRES_PORT=5432
7 | DATABASE_URL=postgres://manati_db_user:password@localhost:5432/manati_db
8 | CONN_MAX_AGE=
9 |
10 | # Domain name, used by caddy
11 | DOMAIN_NAME=manatiproject.com
12 |
13 | # General settings
14 | # DJANGO_READ_DOT_ENV_FILE=True
15 | DJANGO_ADMIN_URL=
16 | DJANGO_SETTINGS_MODULE=config.settings.local
17 | DJANGO_SECRET_KEY=ZkZas*1kYc0@xyGC4oh8_+/%EEyUVkrpR2=dq1eyh62zgledwH
18 | DJANGO_ALLOWED_HOSTS=.manatiproject.com
19 |
20 |
21 | # AWS Settings
22 | DJANGO_AWS_ACCESS_KEY_ID=
23 | DJANGO_AWS_SECRET_ACCESS_KEY=
24 | DJANGO_AWS_STORAGE_BUCKET_NAME=
25 |
26 | # Used with email
27 | DJANGO_MAILGUN_API_KEY=
28 | DJANGO_SERVER_EMAIL=
29 | MAILGUN_SENDER_DOMAIN=
30 |
31 | # Security! Better to use DNS for this task, but you can use redirect
32 | DJANGO_SECURE_SSL_REDIRECT=False
33 |
34 | # django-allauth
35 | DJANGO_ACCOUNT_ALLOW_REGISTRATION=True
36 |
37 | # django debug
38 | DJANGO_DEBUG=True
39 |
40 | # Redis Settings
41 | REDIS_URL=redis://127.0.0.1:6379
42 | REDIS_PASSWORD=
43 |
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import os
3 | import sys
4 |
5 | if __name__ == '__main__':
6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local')
7 |
8 | try:
9 | from django.core.management import execute_from_command_line
10 | except ImportError:
11 | # The above import may fail for some other reason. Ensure that the
12 | # issue is really that Django is missing to avoid masking other
13 | # exceptions on Python 2.
14 | try:
15 | import django # noqa
16 | except ImportError:
17 | raise ImportError(
18 | "Couldn't import Django. Are you sure it's installed and "
19 | "available on your PYTHONPATH environment variable? Did you "
20 | "forget to activate a virtual environment?"
21 | )
22 | raise
23 |
24 | # This allows easy placement of apps within the interior
25 | # manati directory.
26 | current_path = os.path.dirname(os.path.abspath(__file__))
27 | sys.path.append(os.path.join(current_path, 'manati'))
28 |
29 | execute_from_command_line(sys.argv)
30 |
--------------------------------------------------------------------------------
/manati/user_profiles/templates/userena/signin_form.html:
--------------------------------------------------------------------------------
1 | {% extends 'userena/base_userena.html' %}
2 | {% load i18n %}
3 |
4 | {% block title %}{% trans "Signin" %}{% endblock %}
5 |
6 | {% block content %}
7 |
31 | {% endblock %}
32 |
--------------------------------------------------------------------------------
/manati/user_profiles/templates/userena/password_form.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load i18n %}
3 | {% load crispy_forms_tags %}
4 | {% block title %}
5 | {% trans "Change password" %}
6 | {% endblock %}
7 | {% block content_title %}
{% blocktrans with user.username as username %}Account » {{ username }}{% endblocktrans %}
{% endblock %}
8 | {% block content %}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | {% endblock %}
27 |
--------------------------------------------------------------------------------
/manati/login/urls.py:
--------------------------------------------------------------------------------
1 | #!python
2 | #
3 | # Copyright (c) 2017 Stratosphere Laboratory.
4 | #
5 | # This file is part of ManaTI Project
6 | # (see ). It was created by 'Raul B. Netto '
7 | #
8 | # This program is free software: you can redistribute it and/or modify
9 | # it under the terms of the GNU Affero General Public License as
10 | # published by the Free Software Foundation, either version 3 of the
11 | # License, or (at your option) any later version.
12 | #
13 | # This program is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | # GNU Affero General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Affero General Public License
19 | # along with this program. See the file 'docs/LICENSE' or see
20 | # for copying permission.
21 | #
22 | from django.conf.urls import url
23 | from . import views
24 |
25 | # We are adding a URL called /home
26 | urlpatterns = [
27 | url(r'^$', views.home, name='home'),
28 | ]
29 |
--------------------------------------------------------------------------------
/manati/static/sass/project.scss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | // project specific CSS goes here
6 |
7 | ////////////////////////////////
8 | //Variables//
9 | ////////////////////////////////
10 |
11 | // Alert colors
12 |
13 | $white: #fff;
14 | $mint-green: #d6e9c6;
15 | $black: #000;
16 | $pink: #f2dede;
17 | $dark-pink: #eed3d7;
18 | $red: #b94a48;
19 |
20 | ////////////////////////////////
21 | //Alerts//
22 | ////////////////////////////////
23 |
24 | // bootstrap alert CSS, translated to the django-standard levels of
25 | // debug, info, success, warning, error
26 |
27 | .alert-debug {
28 | background-color: $white;
29 | border-color: $mint-green;
30 | color: $black;
31 | }
32 |
33 | .alert-error {
34 | background-color: $pink;
35 | border-color: $dark-pink;
36 | color: $red;
37 | }
38 |
39 | ////////////////////////////////
40 | //Django Toolbar//
41 | ////////////////////////////////
42 |
43 | // Display django-debug-toolbar.
44 | // See https://github.com/django-debug-toolbar/django-debug-toolbar/issues/742
45 | // and https://github.com/pydanny/cookiecutter-django/issues/317
46 |
47 | [hidden][style="display: block;"] {
48 | display: block !important;
49 | }
50 |
--------------------------------------------------------------------------------
/manati/api_manager/apps.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from __future__ import unicode_literals
22 |
23 | from django.apps import AppConfig
24 |
25 |
26 | class ApiManagerConfig(AppConfig):
27 | name = 'manati.api_manager'
28 | verbose_name = "API Manager"
29 |
--------------------------------------------------------------------------------
/utility/.env.pro:
--------------------------------------------------------------------------------
1 | # PostgreSQL
2 | POSTGRES_PASSWORD=password
3 | POSTGRES_USER=manati_db_user
4 | POSTGRES_DB=manati_db
5 | POSTGRES_HOST=postgres
6 | POSTGRES_PORT=5432
7 | DATABASE_URL=postgres://manati_db_user:password@postgres:5432/manati_db
8 | DATABASE_TEST_URL=postgres://manati_db_user:password@postgres:5432/manati_db_test
9 | CONN_MAX_AGE=60
10 |
11 | # Domain name, used by caddy
12 | DOMAIN_NAME=manatiproject.com
13 |
14 | # General settings
15 | # DJANGO_READ_DOT_ENV_FILE=True
16 | DJANGO_ADMIN_URL=
17 | DJANGO_SETTINGS_MODULE=config.settings.production
18 | DJANGO_SECRET_KEY=ZkZas*1kYc0@xyGC4oh8_+/%EEyUVkrpR2=dq1eyh62zgledwH
19 | DJANGO_ALLOWED_HOSTS=*
20 |
21 |
22 | # AWS Settings
23 | DJANGO_AWS_ACCESS_KEY_ID=
24 | DJANGO_AWS_SECRET_ACCESS_KEY=
25 | DJANGO_AWS_STORAGE_BUCKET_NAME=
26 |
27 | # Used with email
28 | DJANGO_MAILGUN_API_KEY=
29 | DJANGO_SERVER_EMAIL=
30 | MAILGUN_SENDER_DOMAIN=
31 |
32 | # Security! Better to use DNS for this task, but you can use redirect
33 | DJANGO_SECURE_SSL_REDIRECT=False
34 |
35 | # django-allauth
36 | DJANGO_ACCOUNT_ALLOW_REGISTRATION=True
37 |
38 | # django debug
39 | DJANGO_DEBUG=True
40 |
41 | # Redis Settings
42 | REDIS_URL=redis://redis:6379
43 |
--------------------------------------------------------------------------------
/manati/share_modules/constants.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from model_utils import Choices
22 |
23 | class Constant:
24 | URL_ATTRIBUTES_AVAILABLE = ["http.url", "http_url", "host"]
25 | IP_DEST_ATTRIBUTES_AVAILABLE = ["endpoints.server", "endpoints_server", "id.resp_h"]
--------------------------------------------------------------------------------
/manati/ip_profiles/urls.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from django.conf.urls import url
22 | from manati.ip_profiles import views
23 |
24 | app_name = 'ip_profiles'
25 |
26 | urlpatterns = [
27 | url(r'^$', views.index, name='index'),
28 | url(r'^new$', views.new, name='new'),
29 | ]
30 |
--------------------------------------------------------------------------------
/compose/production/django/Dockerfile.example:
--------------------------------------------------------------------------------
1 | FROM python:3.5
2 |
3 | ENV PYTHONUNBUFFERED 1
4 |
5 | RUN groupadd -r django \
6 | && useradd -r -g django django
7 |
8 | # Requirements have to be pulled and installed here, otherwise caching won't work
9 | COPY ./requirements /requirements
10 | RUN pip install --no-cache-dir -r /requirements/production.txt \
11 | && rm -rf /requirements
12 |
13 | COPY ./compose/production/django/gunicorn.sh /gunicorn.sh
14 | RUN sed -i 's/\r//' /gunicorn.sh
15 | RUN chmod +x /gunicorn.sh
16 | RUN chown django /gunicorn.sh
17 |
18 | COPY ./compose/production/django/entrypoint.sh /entrypoint.sh
19 | RUN sed -i 's/\r//' /entrypoint.sh
20 | RUN chmod +x /entrypoint.sh
21 | RUN chown django /entrypoint.sh
22 |
23 | COPY ./compose/production/django/celery/worker/start.sh /start-celeryworker.sh
24 | RUN sed -i 's/\r//' /start-celeryworker.sh
25 | RUN chmod +x /start-celeryworker.sh
26 |
27 | COPY ./compose/production/django/celery/beat/start.sh /start-celerybeat.sh
28 | RUN sed -i 's/\r//' /start-celerybeat.sh
29 | RUN chmod +x /start-celerybeat.sh
30 |
31 | COPY . /app
32 |
33 | RUN chown -R django /app
34 |
35 | USER django
36 |
37 | WORKDIR /app
38 |
39 | ENTRYPOINT ["/entrypoint.sh"]
40 |
--------------------------------------------------------------------------------
/manati/user_profiles/migrations/0002_auto_20171101_1828.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Generated by Django 1.9.7 on 2017-11-01 17:28
3 | from __future__ import unicode_literals
4 |
5 | from django.db import migrations, models
6 | import encrypted_fields.fields
7 |
8 |
9 | class Migration(migrations.Migration):
10 |
11 | dependencies = [
12 | ('user_profiles', '0001_initial'),
13 | ]
14 |
15 | operations = [
16 | migrations.AddField(
17 | model_name='userprofile',
18 | name='threshold_whois_distance',
19 | field=models.IntegerField(default=75, null=True),
20 | ),
21 | migrations.AlterField(
22 | model_name='userprofile',
23 | name='passivetotal_user',
24 | field=encrypted_fields.fields.EncryptedEmailField(max_length=60, null=True),
25 | ),
26 | migrations.AlterField(
27 | model_name='userprofile',
28 | name='privacy',
29 | field=models.CharField(choices=[(b'open', 'Open'), (b'registered', 'Registered'), (b'closed', 'Closed')], default=b'closed', help_text='Designates who can view your profile.', max_length=15, verbose_name='privacy'),
30 | ),
31 | ]
32 |
--------------------------------------------------------------------------------
/manati/contrib/sites/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | import django.contrib.sites.models
2 | from django.contrib.sites.models import _simple_domain_name_validator
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = []
9 |
10 | operations = [
11 | migrations.CreateModel(
12 | name='Site',
13 | fields=[
14 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
15 | ('domain', models.CharField(
16 | max_length=100, verbose_name='domain name', validators=[_simple_domain_name_validator]
17 | )),
18 | ('name', models.CharField(max_length=50, verbose_name='display name')),
19 | ],
20 | options={
21 | 'ordering': ('domain',),
22 | 'db_table': 'django_site',
23 | 'verbose_name': 'site',
24 | 'verbose_name_plural': 'sites',
25 | },
26 | bases=(models.Model,),
27 | managers=[
28 | ('objects', django.contrib.sites.models.SiteManager()),
29 | ],
30 | ),
31 | ]
32 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/templates/manati_ui/analysis_session/modal_vt.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | {% load staticfiles %}
12 |
13 |
14 |
15 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/manati/contrib/sites/migrations/0003_set_site_domain_and_name.py:
--------------------------------------------------------------------------------
1 | """
2 | To understand why this file is here, please read:
3 |
4 | http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
5 | """
6 | from django.conf import settings
7 | from django.db import migrations
8 |
9 |
10 | def update_site_forward(apps, schema_editor):
11 | """Set site domain and name."""
12 | Site = apps.get_model('sites', 'Site')
13 | Site.objects.update_or_create(
14 | id=settings.SITE_ID,
15 | defaults={
16 | 'domain': 'manatiproject.com',
17 | 'name': 'ManaTI Project'
18 | }
19 | )
20 |
21 |
22 | def update_site_backward(apps, schema_editor):
23 | """Revert site domain and name to default."""
24 | Site = apps.get_model('sites', 'Site')
25 | Site.objects.update_or_create(
26 | id=settings.SITE_ID,
27 | defaults={
28 | 'domain': 'example.com',
29 | 'name': 'example.com'
30 | }
31 | )
32 |
33 |
34 | class Migration(migrations.Migration):
35 |
36 | dependencies = [
37 | ('sites', '0002_alter_domain_unique'),
38 | ]
39 |
40 | operations = [
41 | migrations.RunPython(update_site_forward, update_site_backward),
42 | ]
43 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/migrations/0025_whoisconsult_deleting.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from __future__ import unicode_literals
22 | from django.db import migrations, models
23 |
24 | class Migration(migrations.Migration):
25 |
26 | dependencies = [("analysis_sessions", "0024_analysissession_status")]
27 |
28 | operations = [
29 | migrations.DeleteModel("WhoisConsult"),
30 | ]
31 |
--------------------------------------------------------------------------------
/compose/production/django/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -o errexit
4 | set -o pipefail
5 |
6 | # todo: turn on after #1295
7 | # set -o nounset
8 |
9 |
10 | cmd="$@"
11 |
12 | # This entrypoint is used to play nicely with the current cookiecutter configuration.
13 | # Since docker-compose relies heavily on environment variables itself for configuration, we'd have to define multiple
14 | # environment variables just to support cookiecutter out of the box. That makes no sense, so this little entrypoint
15 | # does all this for us.
16 | export REDIS_URL=redis://redis:6379
17 |
18 | # the official postgres image uses 'postgres' as default user if not set explictly.
19 | if [ -z "$POSTGRES_USER" ]; then
20 | export POSTGRES_USER=postgres
21 | fi
22 |
23 | export DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$POSTGRES_USER
24 |
25 |
26 | function postgres_ready(){
27 | python << END
28 | import sys
29 | import psycopg2
30 | try:
31 | conn = psycopg2.connect(dbname="$POSTGRES_USER", user="$POSTGRES_USER", password="$POSTGRES_PASSWORD", host="postgres")
32 | except psycopg2.OperationalError:
33 | sys.exit(-1)
34 | sys.exit(0)
35 | END
36 | }
37 |
38 | until postgres_ready; do
39 | >&2 echo "Postgres is unavailable - sleeping"
40 | sleep 1
41 | done
42 |
43 | >&2 echo "Postgres is up - continuing..."
44 | exec $cmd
45 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/static/manati_ui/js/sb-admin-2.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 |
3 | // $('#side-menu').metisMenu();
4 |
5 | });
6 |
7 | //Loads the correct sidebar on window load,
8 | //collapses the sidebar on window resize.
9 | // Sets the min-height of #page-wrapper to window size
10 | $(function() {
11 | $(window).bind("load resize", function() {
12 | topOffset = 50;
13 | width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
14 | if (width < 768) {
15 | $('div.navbar-collapse').addClass('collapse');
16 | topOffset = 100; // 2-row-menu
17 | } else {
18 | $('div.navbar-collapse').removeClass('collapse');
19 | }
20 |
21 | height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
22 | height = height - topOffset;
23 | if (height < 1) height = 1;
24 | if (height > topOffset) {
25 | $("#page-wrapper").css("min-height", (height) + "px");
26 | }
27 | });
28 |
29 | var url = window.location;
30 | var element = $('ul.nav a').filter(function() {
31 | return this.href == url || url.href.indexOf(this.href) == 0;
32 | }).addClass('active').parent().parent().addClass('in').parent();
33 | if (element.is('li')) {
34 | element.addClass('active');
35 | }
36 | });
37 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/templates/manati_ui/user/edit.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% block title %}
3 | User Profile - {{ user.username }}
4 | {% endblock %}
5 | {% block content %}
6 |
7 |
8 |
9 |
10 |
11 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | {% endblock %}
31 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/management/commands/createsuperuser2.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2016-2018 Stratosphere Lab
2 | # This file is part of ManaTI Project - https://stratosphereips.org
3 | # See the file 'docs/LICENSE' for copying permission.
4 | # Created by Raul B. Netto on 1/28/18.
5 | from django.contrib.auth.management.commands import createsuperuser
6 | from django.core.management import CommandError
7 |
8 |
9 | class Command(createsuperuser.Command):
10 | help = 'Crate a superuser, and allow password to be provided'
11 |
12 | def add_arguments(self, parser):
13 | super(Command, self).add_arguments(parser)
14 | parser.add_argument(
15 | '--password', dest='password', default=None,
16 | help='Specifies the password for the superuser.',
17 | )
18 |
19 | def handle(self, *args, **options):
20 | password = options.get('password')
21 | username = options.get('username')
22 | database = options.get('database')
23 |
24 | if password and not username:
25 | raise CommandError("--username is required if specifying --password")
26 |
27 | super(Command, self).handle(*args, **options)
28 |
29 | if password:
30 | user = self.UserModel._default_manager.db_manager(database).get(username=username)
31 | user.set_password(password)
32 | user.save()
33 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/serializers.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from rest_framework import serializers
22 |
23 |
24 | class WeblogSerializer(serializers.Serializer):
25 | id = serializers.CharField(read_only=True)
26 | attributes = serializers.JSONField(required=True)
27 | verdict = serializers.CharField(read_only=True)
28 | register_status = serializers.IntegerField(read_only=True)
29 | analysis_session_id = serializers.IntegerField(read_only=True)
30 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/forms.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from django import forms
22 | from django.contrib.auth.models import User
23 |
24 |
25 | class UserProfileForm(forms.Form):
26 | username = forms.CharField(max_length=20)
27 | first_name = forms.CharField(max_length=50)
28 | last_name = forms.CharField(max_length=50)
29 | email = forms.EmailField(max_length=50)
30 |
31 | class Meta:
32 | model = User
33 | fields = ['first_name', 'last_name', 'username', 'email']
34 |
35 |
--------------------------------------------------------------------------------
/manati/templates/errors/maintenance-page.html:
--------------------------------------------------------------------------------
1 | {% extends 'base_error.html' %}
2 | {% block content %}
3 |
4 |
5 |
6 |
7 |
Temporary Maintenance
8 |
The web server for is currently undergoing some maintenance.
Servers and websites need regular maintnance just like a car to keep them up and running smoothly.
19 |
20 |
21 |
What can I do?
22 |
If you're a site vistor
23 |
If you need immediate assistance, please send us an email instead. We apologize for any inconvenience.
24 |
If you're the site owner
25 |
The maintenance period will mostly likely be very brief, the best thing to do is to check back in a few minutes and everything will probably be working normal agian.
26 |
27 |
28 |
29 |
30 |
31 | {% endblock %}
--------------------------------------------------------------------------------
/manati/analysis_sessions/migrations/0008_auto_20160927_1243.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2016-09-27 12:43
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations
26 |
27 |
28 | class Migration(migrations.Migration):
29 |
30 | dependencies = [
31 | ('analysis_sessions','0007_auto_20160923_1716'),
32 | ]
33 |
34 | operations = [
35 | migrations.RenameModel(
36 | old_name='Comments',
37 | new_name='Comment',
38 | ),
39 | ]
40 |
--------------------------------------------------------------------------------
/manati/api_manager/migrations/0003_remove_externalmodule_acronym.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2016-11-09 20:49
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations
26 |
27 |
28 | class Migration(migrations.Migration):
29 |
30 | dependencies = [
31 | ('api_manager', '0002_externalmodule_status'),
32 | ]
33 |
34 | operations = [
35 | migrations.RemoveField(
36 | model_name='externalmodule',
37 | name='acronym',
38 | ),
39 | ]
40 |
--------------------------------------------------------------------------------
/manati/templates/errors/503.html:
--------------------------------------------------------------------------------
1 | {% extends 'base_error.html' %}
2 | {% block content %}
3 |
4 |
5 |
6 |
7 |
503 Service Unavailable
8 |
The web server is returning an unexpected temporary error for .
A 503 error status implies that this is a temporary condition due to a temporary overloading or maintenance of the server. This error is normally a brief temporary interuption.
18 |
19 |
20 |
What can I do?
21 |
If you're a site vistor
22 |
If you need immediate assistance, please send us an email instead. We apologize for any inconvenience.
23 |
If you're the site owner
24 |
This error is mostly likely very brief, the best thing to do is to check back in a few minutes and everything will probably be working normal agian.
25 |
26 |
27 |
28 |
29 |
30 | {% endblock %}
--------------------------------------------------------------------------------
/manati/api_manager/migrations/0006_auto_20171019_0043.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2017-10-18 22:43
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations, models
26 |
27 |
28 | class Migration(migrations.Migration):
29 |
30 | dependencies = [
31 | ('api_manager', '0005_ioc_whois_relatedexecuted'),
32 | ]
33 |
34 | operations = [
35 | migrations.AlterField(
36 | model_name='externalmodule',
37 | name='description',
38 | field=models.TextField(),
39 | ),
40 | ]
41 |
--------------------------------------------------------------------------------
/manati/login/forms.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from django.contrib.auth.forms import AuthenticationForm
22 | from django import forms
23 |
24 | class LoginForm(AuthenticationForm):
25 | username = forms.CharField(label="Username", max_length=30,
26 | widget=forms.TextInput(attrs={"placeholder": "Username", 'class': 'form-control', 'name': 'username', "autofocus": True}))
27 | password = forms.CharField(label="Password", max_length=30,
28 | widget=forms.TextInput(attrs={'type': 'password', "placeholder": "Password",'class': 'form-control', 'name': 'password'}))
--------------------------------------------------------------------------------
/manati/analysis_sessions/migrations/0009_auto_20160927_1438.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2016-09-27 14:38
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations, models
26 |
27 |
28 | class Migration(migrations.Migration):
29 |
30 | dependencies = [
31 | ('analysis_sessions','0008_auto_20160927_1243'),
32 | ]
33 |
34 | operations = [
35 | migrations.AlterField(
36 | model_name='metric',
37 | name='event_name',
38 | field=models.CharField(max_length=200),
39 | ),
40 | ]
41 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/migrations/0022_weblog_was_whois_related.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2017-03-03 12:52
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations, models
26 |
27 |
28 | class Migration(migrations.Migration):
29 |
30 | dependencies = [
31 | ('analysis_sessions','0021_fixing_whois_related_attribute'),
32 | ]
33 |
34 | operations = [
35 | migrations.AddField(
36 | model_name='weblog',
37 | name='was_whois_related',
38 | field=models.BooleanField(default=False),
39 | ),
40 | ]
41 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/migrations/0023_analysissession_uuid.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2017-04-06 10:02
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations, models
26 |
27 |
28 | class Migration(migrations.Migration):
29 |
30 | dependencies = [
31 | ('analysis_sessions','0022_weblog_was_whois_related'),
32 | ]
33 |
34 | operations = [
35 | migrations.AddField(
36 | model_name='analysissession',
37 | name='uuid',
38 | field=models.CharField(default='', max_length=40, null=True),
39 | ),
40 | ]
41 |
--------------------------------------------------------------------------------
/manati/login/views.py:
--------------------------------------------------------------------------------
1 | #!python
2 | #
3 | # Copyright (c) 2017 Stratosphere Laboratory.
4 | #
5 | # This file is part of ManaTI Project
6 | # (see ). It was created by 'Raul B. Netto '
7 | #
8 | # This program is free software: you can redistribute it and/or modify
9 | # it under the terms of the GNU Affero General Public License as
10 | # published by the Free Software Foundation, either version 3 of the
11 | # License, or (at your option) any later version.
12 | #
13 | # This program is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | # GNU Affero General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Affero General Public License
19 | # along with this program. See the file 'docs/LICENSE' or see
20 | # for copying permission.
21 | #
22 | from django.contrib.auth.decorators import login_required
23 | from django.core.urlresolvers import reverse
24 | from django.http import HttpResponseRedirect
25 |
26 | # Create your views here.
27 | # this login required decorator is to not allow to any
28 | # view without authenticating
29 | @login_required(login_url="/manati_project/login/")
30 | def home(request):
31 | redirect = request.GET.get('redirect_to','')
32 | if redirect == '':
33 | return HttpResponseRedirect(reverse('manati_ui:new_analysis_session'))
34 | else:
35 | return HttpResponseRedirect(str(redirect))
36 |
--------------------------------------------------------------------------------
/manati/templates/base_login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | {% load staticfiles %}
12 | {% load bootstrap3 %}
13 |
14 | ManaTI Project
15 |
16 |
17 | {% bootstrap_css %}
18 |
19 | {% bootstrap_javascript %}
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
33 |
34 |
35 |
36 |
37 |
38 |
A 500 error status implies there is a problem with the web server's software causing it
20 | to malfunction.
21 |
22 |
23 |
What can I do?
24 |
If you're a site vistor
25 |
Nothing you can do at the moment. If you need immediate assistance, please send us an email instead.
26 | We apologize for any inconvenience.
27 |
If you're the site owner
28 |
This error can only be fixed by server admins, please contact your website provider.
29 |
30 |
31 |
32 |
33 | {% endblock %}
--------------------------------------------------------------------------------
/manati/analysis_sessions/migrations/0030_auto_20170926_1740.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2017-09-26 15:40
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations
26 |
27 |
28 | class Migration(migrations.Migration):
29 |
30 | dependencies = [
31 | ('analysis_sessions','0029_auto_20170627_0944'),
32 | ]
33 |
34 | operations = [
35 | migrations.RemoveField(
36 | model_name='ioc',
37 | name='whois_related_iocs',
38 | ),
39 | migrations.RunSQL('DROP TABLE IF EXISTS manati_indicators_of_compromise_whois_related_iocs;'),
40 |
41 | ]
42 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/migrations/0024_analysissession_status.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2017-04-06 15:01
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations, models
26 |
27 |
28 | class Migration(migrations.Migration):
29 |
30 | dependencies = [
31 | ('analysis_sessions','0023_analysissession_uuid'),
32 | ]
33 |
34 | operations = [
35 | migrations.AddField(
36 | model_name='analysissession',
37 | name='status',
38 | field=models.CharField(choices=[('open', 'Open'), ('closed', 'Closed')], default='open', max_length=30),
39 | ),
40 | ]
41 |
--------------------------------------------------------------------------------
/manati/templates/errors/404.html:
--------------------------------------------------------------------------------
1 | {% extends 'base_error.html' %}
2 | {% block content %}
3 |
4 |
5 |
12 |
13 | {% get_providers as socialaccount_providers %}
14 |
15 | {% if socialaccount_providers %}
16 |
{% blocktrans with site.name as site_name %}Please sign in with one
17 | of your existing third party accounts. Or, sign up
18 | for a {{ site_name }} account and sign in below:{% endblocktrans %}
19 |
20 |
21 |
22 |
23 | {% include "socialaccount/snippets/provider_list.html" with process="login" %}
24 |
{% blocktrans %}If you have not created an account yet, then please
34 | sign up first.{% endblocktrans %}
35 | {% endif %}
36 |
37 |
46 |
47 | {% endblock %}
48 |
49 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/migrations/0002_auto_20160817_1047.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2016-08-17 10:47
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations, models
26 |
27 |
28 | class Migration(migrations.Migration):
29 |
30 | dependencies = [
31 | ('analysis_sessions','0001_initial'),
32 | ]
33 |
34 | operations = [
35 | migrations.AlterField(
36 | model_name='weblog',
37 | name='verdict',
38 | field=models.CharField(choices=[('malicious', 'malicious'), ('legitimate', 'legitimate'), ('suspicious', 'suspicious'), ('false_positive', 'False Positive')], default='legitimate', max_length=20),
39 | ),
40 | ]
41 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/static/manati_ui/css/libs/bootstrap-toggle.min.css:
--------------------------------------------------------------------------------
1 | /*! ========================================================================
2 | * Bootstrap Toggle: bootstrap-toggle.css v2.2.0
3 | * http://www.bootstraptoggle.com
4 | * ========================================================================
5 | * Copyright 2014 Min Hur, The New York Times Company
6 | * Licensed under MIT
7 | * ======================================================================== */
8 | .checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px}
9 | .toggle{position:relative;overflow:hidden}
10 | .toggle input[type=checkbox]{display:none}
11 | .toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none}
12 | .toggle.off .toggle-group{left:-100%}
13 | .toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0}
14 | .toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0}
15 | .toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px}
16 | .toggle.btn{min-width:59px;min-height:34px}
17 | .toggle-on.btn{padding-right:24px}
18 | .toggle-off.btn{padding-left:24px}
19 | .toggle.btn-lg{min-width:79px;min-height:45px}
20 | .toggle-on.btn-lg{padding-right:31px}
21 | .toggle-off.btn-lg{padding-left:31px}
22 | .toggle-handle.btn-lg{width:40px}
23 | .toggle.btn-sm{min-width:50px;min-height:30px}
24 | .toggle-on.btn-sm{padding-right:20px}
25 | .toggle-off.btn-sm{padding-left:20px}
26 | .toggle.btn-xs{min-width:35px;min-height:22px}
27 | .toggle-on.btn-xs{padding-right:12px}
28 | .toggle-off.btn-xs{padding-left:12px}
--------------------------------------------------------------------------------
/manati/templates/errors/403.html:
--------------------------------------------------------------------------------
1 | {% extends 'base_error.html' %}
2 | {% block content %}
3 |
4 |
5 |
6 |
403 Forbidden
7 |
Sorry! You don't have access permissions for that on .
8 |
A 403 error status indicates that you don't have permission to access the file or page.
19 | In general, web servers and websites have directories and files that are not open to the public web
20 | for security reasons.
21 |
22 |
23 |
What can I do?
24 |
If you're a site vistor
25 |
Please use your browsers back button and check that you're in the right place. If you need immediate
26 | assistance, please send us an email instead.
27 |
If you're the site owner
28 |
Please check that you're in the right place and get in touch with your website provider if you
29 | believe this to be an error.
This error means you have exceeded the request rate limit for the the web server you are accessing.
19 |
Rate Limit Thersholds are set higher than a human browsing this site should be able to reach and mostly for protection against automated requests and attacks.
20 |
21 |
22 |
What can I do?
23 |
If you're a site vistor
24 |
The best thing to do is to slow down with your requests and try again in a few minutes. We apologize for any inconvenience.
25 |
If you're the site owner
26 |
This error is mostly likely very brief, the best thing to do is to check back in a few minutes and everything will probably be working normal agian. If the error persists, contact your website host.
27 |
28 |
29 |
30 |
31 |
32 | {% endblock %}
--------------------------------------------------------------------------------
/manati/analysis_sessions/helpers.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from django.http import Http404, HttpResponseRedirect, HttpResponse, JsonResponse
22 | from django.template.loader import render_to_string, get_template
23 | from django.template import Context, Template
24 | from django.contrib import messages
25 |
26 | # `data` is a python dictionary
27 | def render_to_json(request, data):
28 | # return HttpResponse(
29 | # json.dumps(data, ensure_ascii=False),
30 | # mimetype=request.is_ajax() and "application/json" or "text/html"
31 | # )
32 | temp = get_template('messages.html')
33 | c = {"stooges": ["Larry", "Curly", "Moe"]}
34 | msg = render_to_string('manati_ui/messages.html', {messages: messages})
35 | # msg = temp.render(c)
36 | return JsonResponse(dict(data=data, msg=msg ))
37 |
38 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/migrations/0017_comment_user.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2016-11-07 23:23
23 | from __future__ import unicode_literals
24 |
25 | from django.conf import settings
26 | from django.db import migrations, models
27 | import django.db.models.deletion
28 |
29 |
30 | class Migration(migrations.Migration):
31 |
32 | dependencies = [
33 | migrations.swappable_dependency(settings.AUTH_USER_MODEL),
34 | ('analysis_sessions','0016_whoisconsult'),
35 | ]
36 |
37 | operations = [
38 | migrations.AddField(
39 | model_name='comment',
40 | name='user',
41 | field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
42 | ),
43 | ]
44 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/static/manati_ui/css/libs/buttons.bootstrap.min.css:
--------------------------------------------------------------------------------
1 | div.dt-button-info{position:fixed;top:50%;left:50%;width:400px;margin-top:-100px;margin-left:-200px;background-color:white;border:2px solid #111;box-shadow:3px 3px 8px rgba(0,0,0,0.3);border-radius:3px;text-align:center;z-index:21}div.dt-button-info h2{padding:0.5em;margin:0;font-weight:normal;border-bottom:1px solid #ddd;background-color:#f3f3f3}div.dt-button-info>div{padding:1em}ul.dt-button-collection.dropdown-menu{display:block;z-index:2002;-webkit-column-gap:8px;-moz-column-gap:8px;-ms-column-gap:8px;-o-column-gap:8px;column-gap:8px}ul.dt-button-collection.dropdown-menu.fixed{position:fixed;top:50%;left:50%;margin-left:-75px;border-radius:0}ul.dt-button-collection.dropdown-menu.fixed.two-column{margin-left:-150px}ul.dt-button-collection.dropdown-menu.fixed.three-column{margin-left:-225px}ul.dt-button-collection.dropdown-menu.fixed.four-column{margin-left:-300px}ul.dt-button-collection.dropdown-menu>*{-webkit-column-break-inside:avoid;break-inside:avoid}ul.dt-button-collection.dropdown-menu.two-column{width:300px;padding-bottom:1px;-webkit-column-count:2;-moz-column-count:2;-ms-column-count:2;-o-column-count:2;column-count:2}ul.dt-button-collection.dropdown-menu.three-column{width:450px;padding-bottom:1px;-webkit-column-count:3;-moz-column-count:3;-ms-column-count:3;-o-column-count:3;column-count:3}ul.dt-button-collection.dropdown-menu.four-column{width:600px;padding-bottom:1px;-webkit-column-count:4;-moz-column-count:4;-ms-column-count:4;-o-column-count:4;column-count:4}div.dt-button-background{position:fixed;top:0;left:0;width:100%;height:100%;z-index:2001}@media screen and (max-width: 767px){div.dt-buttons{float:none;width:100%;text-align:center;margin-bottom:0.5em}div.dt-buttons a.btn{float:none}}
2 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/signals.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from django.db.models.signals import post_save,pre_save,pre_delete
22 | from django.dispatch import receiver
23 | from manati.analysis_sessions.models import Weblog
24 |
25 |
26 | @receiver(pre_save, sender=Weblog)
27 | def check_id(sender, **kwargs):
28 | instance = kwargs.get('instance')
29 | if len(instance.id.split(':')) <= 1:
30 | instance.id = str(instance.analysis_session_id)+":"+str(instance.id)
31 |
32 |
33 | @receiver(post_save, sender=Weblog)
34 | def create_ioc(sender, **kwargs):
35 | instance = kwargs.get('instance')
36 | created = kwargs.get('created')
37 | if created:
38 | instance.create_IOCs()
39 |
40 |
41 | @receiver(pre_delete, sender=Weblog)
42 | def pre_delete_story(sender, instance, **kwargs):
43 | instance.ioc_set.clear()
44 |
--------------------------------------------------------------------------------
/config/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for ManaTI Project project.
3 |
4 | This module contains the WSGI application used by Django's development server
5 | and any production WSGI deployments. It should expose a module-level variable
6 | named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
7 | this application via the ``WSGI_APPLICATION`` setting.
8 |
9 | Usually you will have the standard Django WSGI application here, but it also
10 | might make sense to replace the whole Django WSGI application with a custom one
11 | that later delegates to the Django one. For example, you could introduce WSGI
12 | middleware here, or combine a Django application with an application of another
13 | framework.
14 |
15 | """
16 | import os
17 | import sys
18 |
19 | from django.core.wsgi import get_wsgi_application
20 | from whitenoise.django import DjangoWhiteNoise
21 |
22 | # This allows easy placement of apps within the interior
23 | # manati directory.
24 | app_path = os.path.dirname(os.path.abspath(__file__)).replace('/config', '')
25 | sys.path.append(os.path.join(app_path, 'manati'))
26 |
27 |
28 |
29 | # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
30 | # if running multiple sites in the same mod_wsgi process. To fix this, use
31 | # mod_wsgi daemon mode with each site in its own daemon process, or use
32 | # os.environ["DJANGO_SETTINGS_MODULE"] = "config.settings.production"
33 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
34 |
35 | # This application object is used by any WSGI server configured to use this
36 | # file. This includes Django's development server, if the WSGI_APPLICATION
37 | # setting points here.
38 | application = get_wsgi_application()
39 |
40 | application = DjangoWhiteNoise(application)
41 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/templates/manati_ui/analysis_session/hotkeys_list.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% block title %}
3 | List of Active Hotkey
4 | {% endblock %}
5 | {% block content %}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
#
15 |
Description Function
16 |
Command
17 |
18 |
19 |
20 | {% if hotkeys %}
21 | {% for hotkey in hotkeys %}
22 |
23 |
{{ forloop.counter }}
24 |
{{ hotkey.description }}
25 |
{{ hotkey.command }}
26 |
27 | {% endfor %}
28 | {% else %}
29 |
No Hotkey available.
30 | {% endif %}
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | {% endblock %}
42 |
--------------------------------------------------------------------------------
/manati/api_manager/common/abstracts.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | from abc import ABCMeta, abstractmethod
22 |
23 |
24 | class Module(object):
25 |
26 | __metaclass__ = ABCMeta
27 | module_name = ''
28 | description = ''
29 | version = ''
30 | authors = []
31 | events = []
32 |
33 | def __init__(self):
34 | pass
35 |
36 | @abstractmethod
37 | def run(self, *args):
38 | # try:
39 | # self.args = self.parser.parse_args(self.command_line)
40 | # except ArgumentErrorCallback as e:
41 | # self.log(*e.get())
42 | pass
43 |
44 | def module_key(self):
45 | return self.module_name + "_" + self.version
46 |
47 | def __str__(self):
48 | return "; ".join([self.module_name, ", ".join(self.authors), self.description])
49 |
50 | def __getitem__(self, key):
51 | return self.module_name
52 |
--------------------------------------------------------------------------------
/utility/production_settings/ubuntu/supervisor-manati.conf:
--------------------------------------------------------------------------------
1 | [supervisord]
2 | logfile = /var/log/supervisor/supervisord.log
3 | user = root
4 |
5 | [unix_http_server]
6 | file = /var/run/supervisor.sock
7 | chmod = 0700
8 |
9 | [supervisorctl]
10 | serverurl = unix:///var/run/supervisor.sock
11 |
12 | [program:manati_uwsgi]
13 | command = /var/www/manati/.vmanati/bin/uwsgi --ini /var/www/manati/manati_uwsgi.ini --enable-threads --logto /tmp/manati_uwsgi.log
14 | stopsignal=QUIT
15 | autostart=true
16 | autorestart=true
17 | redirect_stderr=true
18 | environment=DJANGO_SETTINGS_MODULE=config.settings.test,DJANGO_READ_DOT_ENV_FILE=True;
19 |
20 | [program:manati_nginx]
21 | command = /usr/sbin/nginx
22 | user = root
23 |
24 | ;[program:manati_gunicorn]
25 | ;command = /var/www/manati/gunicorn_start.bash ; Command to start app
26 | ;user = root ; User to run as
27 | ;stdout_logfile =/tmp/gunicorn_supervisor.log ; Where to write log messages
28 | ;redirect_stderr = true ; Save stderr in the same log
29 | ;environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8;DJANGO_SETTINGS_MODULE=config.settings.test;DJANGO_READ_DOT_ENV_FILE=True; Set UTF-8 as default encoding
30 |
31 | [program:redis]
32 | command = redis-server /etc/redis/redis.conf
33 | stdout_logfile = /tmp/redis_supervisor.log
34 | redirect_stderr = true ; Save stderr in the same log
35 | environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8
36 |
37 | [program:rqworker]
38 | command = /var/www/manati/.vmanati/bin/python /var/www/manati/manage.py rqworker high default low
39 | stdout_logfile = /tmp/rqworker_supervisor.log
40 | redirect_stderr = true ; Save stderr in the same log
41 | environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8,DJANGO_SETTINGS_MODULE=config.settings.test,DJANGO_READ_DOT_ENV_FILE=True;
42 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/migrations/0029_auto_20170627_0944.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2017-06-27 09:44
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations, models
26 |
27 |
28 | class Migration(migrations.Migration):
29 |
30 | dependencies = [
31 | ('analysis_sessions','0028_migrate_weblogs_to_ioc'),
32 | ]
33 |
34 | operations = [
35 | migrations.RemoveField(
36 | model_name='weblog',
37 | name='was_whois_related',
38 | ),
39 | migrations.RemoveField(
40 | model_name='weblog',
41 | name='whois_related_weblogs',
42 | ),
43 | migrations.AddField(
44 | model_name='ioc',
45 | name='whois_related_iocs',
46 | field=models.ManyToManyField(related_name='_ioc_whois_related_iocs_+', to='analysis_sessions.IOC'),
47 | ),
48 | ]
49 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/static/manati_ui/js/libs/metisMenu.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * metismenu - v1.1.3
3 | * Easy menu jQuery plugin for Twitter Bootstrap 3
4 | * https://github.com/onokumus/metisMenu
5 | *
6 | * Made by Osman Nuri Okumus
7 | * Under MIT License
8 | */
9 | !function(a,b,c){function d(b,c){this.element=a(b),this.settings=a.extend({},f,c),this._defaults=f,this._name=e,this.init()}var e="metisMenu",f={toggle:!0,doubleTapToGo:!1};d.prototype={init:function(){var b=this.element,d=this.settings.toggle,f=this;this.isIE()<=9?(b.find("li.active").has("ul").children("ul").collapse("show"),b.find("li").not(".active").has("ul").children("ul").collapse("hide")):(b.find("li.active").has("ul").children("ul").addClass("collapse in"),b.find("li").not(".active").has("ul").children("ul").addClass("collapse")),f.settings.doubleTapToGo&&b.find("li.active").has("ul").children("a").addClass("doubleTapToGo"),b.find("li").has("ul").children("a").on("click."+e,function(b){return b.preventDefault(),f.settings.doubleTapToGo&&f.doubleTapToGo(a(this))&&"#"!==a(this).attr("href")&&""!==a(this).attr("href")?(b.stopPropagation(),void(c.location=a(this).attr("href"))):(a(this).parent("li").toggleClass("active").children("ul").collapse("toggle"),void(d&&a(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide")))})},isIE:function(){for(var a,b=3,d=c.createElement("div"),e=d.getElementsByTagName("i");d.innerHTML="",e[0];)return b>4?b:a},doubleTapToGo:function(a){var b=this.element;return a.hasClass("doubleTapToGo")?(a.removeClass("doubleTapToGo"),!0):a.parent().children("ul").length?(b.find(".doubleTapToGo").removeClass("doubleTapToGo"),a.addClass("doubleTapToGo"),!1):void 0},remove:function(){this.element.off("."+e),this.element.removeData(e)}},a.fn[e]=function(b){return this.each(function(){var c=a(this);c.data(e)&&c.data(e).remove(),c.data(e,new d(this,b))}),this}}(jQuery,window,document);
--------------------------------------------------------------------------------
/manati/api_manager/migrations/0002_externalmodule_status.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2016-10-21 11:47
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations, models
26 | from django.core import management
27 |
28 |
29 | # def run_migrations_background_task(apps, schema_editor):
30 | # management.call_command("makemigrations", "background_task")
31 | # management.call_command("migrate", "background_task")
32 |
33 | class Migration(migrations.Migration):
34 |
35 | dependencies = [
36 | ('api_manager', '0001_initial'),
37 | ]
38 |
39 | operations = [
40 | migrations.AddField(
41 | model_name='externalmodule',
42 | name='status',
43 | field=models.CharField(choices=[('idle', 'idle'), ('running', 'running'), ('removed', 'removed')], default='idle', max_length=20),
44 | ),
45 | # migrations.RunPython(run_migrations_background_task),
46 | ]
47 |
--------------------------------------------------------------------------------
/utility/install_python_dependencies.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | WORK_DIR="$(dirname "$0")"
4 | PROJECT_DIR="$(dirname "$WORK_DIR")"
5 |
6 | pip --version >/dev/null 2>&1 || {
7 | echo >&2 -e "\npip is required but it's not installed."
8 | echo >&2 -e "You can install it by running the following command:\n"
9 | echo >&2 "wget https://bootstrap.pypa.io/get-pip.py --output-document=get-pip.py; chmod +x get-pip.py; sudo -H python3 get-pip.py"
10 | echo >&2 -e "\n"
11 | echo >&2 -e "\nFor more information, see pip documentation: https://pip.pypa.io/en/latest/"
12 | exit 1;
13 | }
14 |
15 | virtualenv --version >/dev/null 2>&1 || {
16 | echo >&2 -e "\nvirtualenv is required but it's not installed."
17 | echo >&2 -e "You can install it by running the following command:\n"
18 | echo >&2 "sudo -H pip3 install virtualenv"
19 | echo >&2 -e "\n"
20 | echo >&2 -e "\nFor more information, see virtualenv documentation: https://virtualenv.pypa.io/en/latest/"
21 | exit 1;
22 | }
23 |
24 | if [ -z "$VIRTUAL_ENV" ]; then
25 | echo >&2 -e "\nYou need activate a virtualenv first"
26 | echo >&2 -e 'If you do not have a virtualenv created, run the following command to create and automatically activate a new virtualenv named "venv" on current folder:\n'
27 | echo >&2 -e "virtualenv venv --python=\`which python3\`"
28 | echo >&2 -e "\nTo leave/disable the currently active virtualenv, run the following command:\n"
29 | echo >&2 "deactivate"
30 | echo >&2 -e "\nTo activate the virtualenv again, run the following command:\n"
31 | echo >&2 "source venv/bin/activate"
32 | echo >&2 -e "\nFor more information, see virtualenv documentation: https://virtualenv.pypa.io/en/latest/"
33 | echo >&2 -e "\n"
34 | exit 1;
35 | else
36 |
37 | pip install -r $PROJECT_DIR/requirements/local.txt
38 | pip install -r $PROJECT_DIR/requirements/test.txt
39 | pip install -r $PROJECT_DIR/requirements.txt
40 | fi
41 |
--------------------------------------------------------------------------------
/manati/templates/errors/504.html:
--------------------------------------------------------------------------------
1 | {% extends 'base_error.html' %}
2 | {% block content %}
3 |
4 |
5 |
6 |
7 |
504 Gateway Timeout
8 |
The web server is returning an unexpected networking error for .
Also, clearing your browser cache and refreshing the page may clear this issue. If the problem persissts and you need immediate assistance, please send us an email instead.
32 |
If you're the site owner
33 |
Clearing your browser cache and refreshing the page may clear this issue. If the problem persissts and you need immediate assistance, please contact your website provider.
34 |
35 |
36 |
37 |
38 | {% endblock %}
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: true
2 | before_install:
3 | - sudo apt-get update -qq
4 | - sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb
5 | - sudo apt-get install -qq libtiff4-dev libjpeg8-dev libfreetype6-dev liblcms1-dev libwebp-dev
6 | - sudo apt-get install -qq graphviz-dev python-setuptools python3-dev python-virtualenv python-pip
7 | - sudo apt-get install -qq firefox automake libtool libreadline6 libreadline6-dev libreadline-dev
8 | - sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm
9 | before_script:
10 | - psql -c "create user manati_db_user with password 'password';" -U postgres
11 | - psql -c 'create database manati_db_test;' -U postgres
12 | - psql -c 'grant all privileges on database manati_db_test to manati_db_user;' -U postgres
13 | - psql -c 'alter role manati_db_user createrole createdb;' -U postgres
14 | - sudo redis-server /etc/redis/redis.conf --port 6379
15 | services:
16 | - postgresql
17 | - redis-server
18 | language: python
19 | python:
20 | - "2.7"
21 | install:
22 | - pip install -r requirements/test.txt
23 | script: # command to run tests
24 | - pytest
25 | cache: pip
26 | notifications:
27 | slack:
28 | secure: EBGiTRO7dPrTJMeNTT8GWx0RTtwmeHPqRS2fYA5Cpz2jgxdE2vNAcO4Mi4Vkc8FvlWvqHzgNrcVmq2/5XaGokiy95bxsQLWXooixFhcHxu8gFKiAqc3jDSSExFQObVBnPiT9MFnR0YiAFvHEqnp0RZPfmGjqwlOp5z07//mYnW6QvvwlYVO7Jh4jHaBRUj8e9d5tUu0H/bd77g98ewjt9i62bcrMN+WrBov/ifAVmzwgmntwn7LhHWSioelja0cGV8n+LWLqz1gF23cmvsNHpf4r9pNKpeQqth3u3L2qfuZWprgJ/GMDDQ8k8UQKHaUrk7ZkhgXcTXtrUgZIGuxAx0jNwmjn/3uRDOTbbP26djEh0xUDa/Eicbv+apbun7VZmAeEmAAfBUgNRFIBeFbdPc2xWQK8i0P3JtCO3YwxD31Shzm7anHte7ftQqyhkrCPSbLXuCBRk2ZyG9h2lTtK4SDjhWwayZXIrYVdQ6aE5kDxTBfKfzXAxECkGuoO/uNmgbU+SPyCxhnluWgJE2Se/s800STpNUuQKIc20eDEiRfavJbDEE6Lfbh8xER6vo+G88FU+8T8gR2UjyUhpWY+8wWnCXFAssecWL5ODdlNCA5PgaHINfqBh9kx0QMd7+hQWdOk+1nwt3RenXQ+WJiuH/KkY4u4ZES1W5igmqcNDk4=
29 | on_success: change # default: always
30 | on_failure: always # default: always
31 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/migrations/0021_fixing_whois_related_attribute.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | # -*- coding: utf-8 -*-
22 | # Generated by Django 1.9.7 on 2017-02-22 09:42
23 | from __future__ import unicode_literals
24 |
25 | from django.db import migrations, models
26 |
27 |
28 | class Migration(migrations.Migration):
29 |
30 | dependencies = [
31 | ('analysis_sessions','0020_type_file_migration'),
32 | ]
33 |
34 | operations = [
35 | migrations.RemoveField(
36 | model_name='weblog',
37 | name='whois_related_weblogs',
38 | ),
39 | migrations.RemoveField(
40 | model_name='whoisrelatedweblog',
41 | name='weblog_domain_a',
42 | ),
43 | migrations.DeleteModel(
44 | name='WhoisRelatedWeblog',
45 | ),
46 | migrations.AddField(
47 | model_name='weblog',
48 | name='whois_related_weblogs',
49 | field=models.ManyToManyField(related_name='_weblog_whois_related_weblogs_+', to='analysis_sessions.Weblog'),
50 | ),
51 |
52 | ]
53 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | # also called local.ymml
2 | version: '3'
3 |
4 | services:
5 | nginx:
6 | build: './compose/local/nginx/.'
7 | ports:
8 | - '8080:80'
9 | depends_on:
10 | - web
11 | web:
12 | build:
13 | context: '.'
14 | dockerfile: './compose/local/django/Dockerfile'
15 | image: 'manati'
16 | env_file:
17 | - '.env'
18 | - '.env-docker'
19 | expose:
20 | - "8000"
21 | ports:
22 | - '127.0.0.1:8000:8000'
23 | command: 'bash -c "python manage.py migrate && python manage.py check_external_modules && python manage.py collectstatic --noinput && gunicorn config.wsgi:application -w 2 -b :8000 --capture-output --enable-stdio-inheritance --log-level=debug --access-logfile=- --log-file=-"'
24 | volumes:
25 | - '.:/code'
26 | - 'manati_cachedata:/cache'
27 | - 'manati_mediadata:/media'
28 | links:
29 | - postgres
30 | - redis
31 | depends_on:
32 | - postgres
33 | - redis
34 |
35 | postgres:
36 | restart: always
37 | container_name: 'postgres'
38 | image: 'postgres:9.6.5'
39 | env_file:
40 | - '.env-docker'
41 | ports:
42 | - '127.0.0.1:5432:5432'
43 | volumes:
44 | - 'manati_pgdata:/var/lib/postgresql/data/'
45 | - 'manati_pglog:/var/log/postgresql'
46 | - 'manati_pgetc:/etc/postgresql'
47 |
48 | redis:
49 | container_name: 'redis'
50 | image: 'redis:3.2.0'
51 | ports:
52 | - '127.0.0.1:6379:6379'
53 | volumes:
54 | - 'manati_redisdata:/data'
55 |
56 | rqworker:
57 | build:
58 | context: .
59 | dockerfile: './compose/local/django/Dockerfile'
60 | env_file:
61 | - '.env-docker'
62 | command: "bash -c 'python manage.py rqworker high default low'"
63 | volumes:
64 | - .:/code
65 | depends_on:
66 | - redis
67 |
68 | volumes:
69 | manati_pgdata:
70 | manati_pglog:
71 | manati_pgetc:
72 | manati_redisdata:
73 | manati_cachedata:
74 | manati_mediadata:
75 |
76 |
77 |
--------------------------------------------------------------------------------
/manati/analysis_sessions/utils.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2017 Stratosphere Laboratory.
3 | #
4 | # This file is part of ManaTI Project
5 | # (see ). It was created by 'Raul B. Netto '
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. See the file 'docs/LICENSE' or see
19 | # for copying permission.
20 | #
21 | import linecache
22 | import sys
23 | import logging
24 | from django_enumfield import enum
25 | from threading import Thread
26 |
27 | # Get an instance of a logger
28 | logger = logging.getLogger(__name__)
29 |
30 |
31 | def print_exception():
32 | logger.error(str(sys.exc_info()))
33 | exc_type, exc_obj, tb = sys.exc_info()
34 | f = tb.tb_frame
35 | lineno = tb.tb_lineno
36 | filename = f.f_code.co_filename
37 | linecache.checkcache(filename)
38 | line = linecache.getline(filename, lineno, f.f_globals)
39 | error = 'EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj)
40 | print(error)
41 | return error
42 |
43 |
44 | def postpone(function):
45 | def decorator(*args, **kwargs):
46 | t = Thread(target = function, args=args, kwargs=kwargs)
47 | t.daemon = True
48 | t.start()
49 | return decorator
50 |
51 |
52 | class RegisterStatus(enum.Enum):
53 | NOT_SAVE = -1
54 | READY = 0
55 | CLIENT_MODIFICATION = 1
56 | MODULE_MODIFICATION = 3
57 | UPGRADING_LOCK = 2
58 |
--------------------------------------------------------------------------------
/compose/production/postgres/restore.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -o errexit
4 | set -o pipefail
5 | set -o nounset
6 |
7 |
8 | # we might run into trouble when using the default `postgres` user, e.g. when dropping the postgres
9 | # database in restore.sh. Check that something else is used here
10 | if [ "$POSTGRES_USER" == "postgres" ]
11 | then
12 | echo "restoring as the postgres user is not supported, make sure to set the POSTGRES_USER environment variable"
13 | exit 1
14 | fi
15 |
16 | # export the postgres password so that subsequent commands don't ask for it
17 | export PGPASSWORD=$POSTGRES_PASSWORD
18 |
19 | # check that we have an argument for a filename candidate
20 | if [[ $# -eq 0 ]] ; then
21 | echo 'usage:'
22 | echo ' docker-compose -f production.yml.example run postgres restore '
23 | echo ''
24 | echo 'to get a list of available backups, run:'
25 | echo ' docker-compose -f production.yml.example run postgres list-backups'
26 | exit 1
27 | fi
28 |
29 | # set the backupfile variable
30 | BACKUPFILE=/backups/$1
31 |
32 | # check that the file exists
33 | if ! [ -f $BACKUPFILE ]; then
34 | echo "backup file not found"
35 | echo 'to get a list of available backups, run:'
36 | echo ' docker-compose -f production.yml.example run postgres list-backups'
37 | exit 1
38 | fi
39 |
40 | echo "beginning restore from $1"
41 | echo "-------------------------"
42 |
43 | # delete the db
44 | # deleting the db can fail. Spit out a comment if this happens but continue since the db
45 | # is created in the next step
46 | echo "deleting old database $POSTGRES_USER"
47 | if dropdb -h postgres -U $POSTGRES_USER $POSTGRES_USER
48 | then echo "deleted $POSTGRES_USER database"
49 | else echo "database $POSTGRES_USER does not exist, continue"
50 | fi
51 |
52 | # create a new database
53 | echo "creating new database $POSTGRES_USER"
54 | createdb -h postgres -U $POSTGRES_USER $POSTGRES_USER -O $POSTGRES_USER
55 |
56 | # restore the database
57 | echo "restoring database $POSTGRES_USER"
58 | gunzip -c $BACKUPFILE | psql -h postgres -U $POSTGRES_USER
59 |
--------------------------------------------------------------------------------