diff --git a/docs/configuration.rst b/docs/configuration.rst index fb17779ed..01bfc8781 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -23,7 +23,7 @@ SecurityMonkeyInstanceProfile is the IAM role you will launch your instance with Here is are example polices for the SecurityMonkeyInstanceProfile: -SES-SendEmail +SES-SendEmail .. code-block:: python @@ -193,7 +193,7 @@ Below is an example policy: .. code-block:: python { - "Version": "2008-10-17", + "Version": "2012-10-17", "Statement": [ { "Sid": "", diff --git a/docs/misc.rst b/docs/misc.rst index 176ef43e0..5628f1ef2 100644 --- a/docs/misc.rst +++ b/docs/misc.rst @@ -50,7 +50,9 @@ Edit ``security_monkey/scheduler.py`` to change daily check schedule:: scheduler.add_cron_job(_audit_changes, hour=10, day_of_week="mon-fri", args=[account, auditors, True]) -Edit ``security_monkey/watcher.py`` to change check interval from every 15 minutes +Edit ``security_monkey/watcher.py`` to change check interval from every 15 minutes:: + + self.interval = 15 Overriding and Disabling Audit Checks diff --git a/docs/quickstart.rst b/docs/quickstart.rst index f8d35ed2c..520d14cce 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -371,18 +371,14 @@ Add this to /etc/hosts: (Use nano if you're not familiar with vi.):: Create the logging folders:: sudo mkdir /var/log/security_monkey - sudo chown www-data /var/log/security_monkey sudo mkdir /var/www + sudo chown www-data /var/log/security_monkey sudo chown www-data /var/www - sudo touch /var/log/security_monkey/security_monkey.error.log - sudo touch /var/log/security_monkey/security_monkey.access.log - sudo touch /var/log/security_monkey/security_monkey-deploy.log - sudo chown www-data /var/log/security_monkey/security_monkey-deploy.log Let's install the tools we need for Security Monkey:: $ sudo apt-get update - $ sudo apt-get -y install python-pip python-dev python-psycopg2 postgresql postgresql-contrib libpq-dev nginx supervisor git libffi-dev + $ sudo apt-get -y install python-pip python-dev python-psycopg2 postgresql postgresql-contrib libpq-dev nginx supervisor git libffi-dev gcc Setup Postgres -------------- @@ -430,6 +426,11 @@ Next we'll clone and install the package:: cd security_monkey sudo python setup.py install +Fix ownership for python modules:: + + sudo usermod -a -G staff www-data + sudo chgrp staff /usr/local/lib/python2.7/dist-packages/*.egg + **New in 0.2.0** - Compile the web-app from the Dart code:: # Get the Google Linux package signing key. @@ -448,8 +449,9 @@ Next we'll clone and install the package:: sudo /usr/lib/dart/bin/pub build # Copy the compiled Web UI to the appropriate destination - sudo /bin/mkdir -p /usr/local/src/security_monkey/security_monkey/static/ + sudo mkdir -p /usr/local/src/security_monkey/security_monkey/static/ sudo /bin/cp -R /usr/local/src/security_monkey/dart/build/web/* /usr/local/src/security_monkey/security_monkey/static/ + sudo chgrp -R www-data /usr/local/src/security_monkey Configure the Application ------------------------- @@ -751,18 +753,18 @@ it were to crash. environment=PYTHONPATH='/usr/local/src/security_monkey/',SECURITY_MONKEY_SETTINGS="/usr/local/src/security_monkey/env-config/config-deploy.py" command=python /usr/local/src/security_monkey/manage.py start_scheduler +Copy supervisor config:: -Copy /usr/local/src/security_monkey/supervisor/security_monkey.conf to /etc/supervisor/conf.d/security_monkey.conf and make sure it points to the locations where you cloned the security monkey repo.:: - + sudo cp /usr/local/src/security_monkey/supervisor/security_monkey.conf /etc/supervisor/conf.d/security_monkey.conf sudo service supervisor restart - sudo supervisorctl & + sudo supervisorctl status Supervisor will attempt to start two python jobs and make sure they are running. The first job, securitymonkey, is gunicorn, which it launches by calling manage.py run_api_server. The second job supervisor runs is the scheduler, which looks for changes every 15 minutes. **The scheduler will fail to start at this time because there are no accounts for it to monitor** Later, we will add an account and start the scheduler. -You can track progress by tailing security_monkey-deploy.log. +You can track progress by tailing /var/log/security_monkey/securitymonkey.log. Create an SSL Certificate ========================= diff --git a/env-config/config-deploy.py b/env-config/config-deploy.py index c016cde57..583c7d483 100644 --- a/env-config/config-deploy.py +++ b/env-config/config-deploy.py @@ -52,7 +52,7 @@ } } -SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:securitymonkeypassword@localhost:5432/secmonkey' +SQLALCHEMY_DATABASE_URI = 'postgresql://securitymonkeyuser:securitymonkeypassword@localhost:5432/secmonkey' SQLALCHEMY_POOL_SIZE = 50 SQLALCHEMY_MAX_OVERFLOW = 15