diff --git a/timesketch.conf b/timesketch.conf index 47190a81b1..a5d9072a37 100644 --- a/timesketch.conf +++ b/timesketch.conf @@ -6,30 +6,37 @@ # # $ tsctl -c /path/to/this/timesketch.conf runserver -# Turn off debugging. -# It is a security risk to have this enabled in production. +# Show debug information. +# +# Note: It is a security risk to have this enabled in production. DEBUG = False +# Key for signing cookies and for CSRF protection. +# # This should be a unique random string. Don't share this with anyone. -# The key is used for signing cookies and for CSRF protection. # To generate a key, you can for example use openssl: # $ openssl rand -base64 32 -# If the key is not set the server will not start. SECRET_KEY = u'' -# Setup the database. For more options, see the official documentation: +# Setup the database. +# +# For more options, see the official documentation: # https://pythonhosted.org/Flask-SQLAlchemy/config.html # By default sqlite is used. SQLALCHEMY_DATABASE_URI = u'sqlite:////tmp/database.db' # Configure where your Elasticsearch server is located. +# # Make sure that the Elasticsearch server is properly secured and not accessible # from the internet. See the following link for more information: # http://www.elasticsearch.org/blog/scripting-security/ ELASTIC_HOST = u'127.0.0.1' ELASTIC_PORT = 9200 +#------------------------------------------------------------------------------- + # Single Sign On (SSO) configuration. +# # Your web server can handle authentication for you by setting a environment # variable when the user is successfully authenticated. The standard environment # variable is REMOTE_USER and this is the default, but if your SSO system uses @@ -37,14 +44,20 @@ ELASTIC_PORT = 9200 SSO_ENABLED = False SSO_USER_ENV_VARIABLE = u'REMOTE_USER' -# Upload Plaso storage file feature. +#------------------------------------------------------------------------------- + +# Upload and processing of Plaso storage files. +# # To enable this feature you need to configure an upload directory and -# how to reach the Redis database used by the distributed task queue Celery. +# how to reach the Redis database used by the distributed task queue. + +UPLOAD_ENABLED = False # Folder for temporarily storage of Plaso dump files before being processed and # inserted into the datastore. -#UPLOAD_FOLDER = u'/tmp/' +UPLOAD_FOLDER = u'/tmp' -# Celery broker configuration. -#CELERY_BROKER_URL='redis://ip:port', -#CELERY_RESULT_BACKEND='redis://ip:port' +# Celery broker configuration. You need to change ip/port to where your Redis +# server is running. +CELERY_BROKER_URL='redis://ip:port', +CELERY_RESULT_BACKEND='redis://ip:port' diff --git a/timesketch/api/v1/resources.py b/timesketch/api/v1/resources.py index 30e0cfd9b0..8424e910c5 100644 --- a/timesketch/api/v1/resources.py +++ b/timesketch/api/v1/resources.py @@ -497,10 +497,11 @@ def post(self): Raises: ApiHTTPError """ + UPLOAD_ENABLED = current_app.config[u'UPLOAD_ENABLED'] UPLOAD_FOLDER = current_app.config[u'UPLOAD_FOLDER'] form = UploadFileForm() - if form.validate_on_submit() and UPLOAD_FOLDER: + if form.validate_on_submit() and UPLOAD_ENABLED: from timesketch.lib.tasks import run_plaso file_storage = form.file.data timeline_name = form.name.data diff --git a/timesketch/lib/testlib.py b/timesketch/lib/testlib.py index 57961171ff..5cb9916e5d 100644 --- a/timesketch/lib/testlib.py +++ b/timesketch/lib/testlib.py @@ -37,6 +37,7 @@ class TestConfig(object): WTF_CSRF_ENABLED = False ELASTIC_HOST = None ELASTIC_PORT = None + UPLOAD_ENABLED = False class MockDataStore(datastore.DataStore): diff --git a/timesketch/ui/static/css/ts.css b/timesketch/ui/static/css/ts.css index 85e3da0630..10279f78b2 100644 --- a/timesketch/ui/static/css/ts.css +++ b/timesketch/ui/static/css/ts.css @@ -20,13 +20,13 @@ body { header { width: 100%; - height: 65px; + height: 55px; background: #428bca; position: fixed; top:0; z-index:9998; padding:11px 21px 11px 11px; - box-shadow: 0 -3px 30px rgba(0, 0, 0, 0.3) + box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.3) } table { @@ -35,18 +35,19 @@ table { } #main { - margin:100px 35px 35px 235px; + margin:90px 35px 35px 245px; } #logo { - width:200px; - height:65px; + width:210px; + height:55px; padding:20px; + padding-top:15px; background: #428bca; position: fixed; top:0; z-index:9999; - box-shadow: 0 -3px 30px rgba(0, 0, 0, 0.3) + box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3) } #logo img { @@ -56,13 +57,13 @@ table { } #navigation { - width: 200px; + width: 210px; overflow: hidden; position: fixed; left: 0; height: 100%; background: #f1f1f1; - top:65px; + top:55px; z-index:9998; box-shadow: 0 0 15px rgba(0, 0, 0, 0.3) } @@ -290,6 +291,7 @@ table { .btn-uppercase { text-transform: uppercase; font-size: 0.9em; + letter-spacing: 1.0px; } .comment-wrapper { diff --git a/timesketch/ui/templates/base.html b/timesketch/ui/templates/base.html index a2da6abab7..9f0fc50db5 100644 --- a/timesketch/ui/templates/base.html +++ b/timesketch/ui/templates/base.html @@ -50,7 +50,7 @@
Loading..
-
+
{% block header_left %}{% endblock %} {{ current_user.username }} Logout diff --git a/timesketch/ui/templates/home/home.html b/timesketch/ui/templates/home/home.html index a4c16fac21..f73ba4df5e 100644 --- a/timesketch/ui/templates/home/home.html +++ b/timesketch/ui/templates/home/home.html @@ -16,61 +16,73 @@ --> {% block header_left %} - {% if upload_enabled %} - - {% endif %} + {% if upload_enabled %} + + {% endif %} {% endblock %} {% block sidenav %} - + {% endblock %} {% block main %} -
- {% if upload_enabled %} - - {% endif %} -
-
-
-
- -
+
+
+
+ + {% if upload_enabled %} + + {% endif %} + +
+
+ +
+
+ +
+ {% if not sketches.all() %} +
+ {{ form.name }} + {{ form.description }} +

No sketches found

+ + {{ form.csrf_token }} +
+ + {% else %} - {% if not sketches.all() %} - No result - {% else %} - - - {% for sketch in sketches.all() %} - - - - {% endfor %} - -
- {{ sketch.name }} -
- {{ sketch.description }} -
- {% endif %} -
+ + + {% for sketch in sketches.all() %} + + + + {% endfor %} + +
+ {{ sketch.name }} +
+ {{ sketch.description }} +
+ {% endif %} +
+
+
-
-
{% endblock %} diff --git a/timesketch/ui/templates/sketch/explore.html b/timesketch/ui/templates/sketch/explore.html index b38a0ae680..05e970c8a5 100644 --- a/timesketch/ui/templates/sketch/explore.html +++ b/timesketch/ui/templates/sketch/explore.html @@ -15,16 +15,12 @@ limitations under the License. --> -{% block main_no_sidenav %} -
-
- -
-
- -
+{% block main %} +
+
+
+
-
{% endblock %} diff --git a/timesketch/ui/templates/sketch/overview.html b/timesketch/ui/templates/sketch/overview.html index 9b871ec67f..98ba3847e1 100644 --- a/timesketch/ui/templates/sketch/overview.html +++ b/timesketch/ui/templates/sketch/overview.html @@ -213,7 +213,7 @@

{{ sketch.name }} {% else %} -

There is no timeline added to this sketch. Add one to get started.

+

There is no timeline added to this sketch.

{% endif %} {% if sketch.has_permission(current_user, 'write') %}
diff --git a/timesketch/ui/templates/sketch/timelines.html b/timesketch/ui/templates/sketch/timelines.html index d393f269d8..3d10e82ba5 100644 --- a/timesketch/ui/templates/sketch/timelines.html +++ b/timesketch/ui/templates/sketch/timelines.html @@ -22,12 +22,13 @@ {% if sketch.has_permission(current_user, 'write') %}
+
-
+
{% if form.timelines.choices %}
@@ -77,7 +78,7 @@

Timelines in this sketch

{% else %} -

There is no timeline added to this sketch. Add one to get started.

+

There is no timeline added to this sketch.

{% endif %}
diff --git a/timesketch/ui/views/home.py b/timesketch/ui/views/home.py index 1bac9a8c97..2f44a6ff9c 100644 --- a/timesketch/ui/views/home.py +++ b/timesketch/ui/views/home.py @@ -48,7 +48,7 @@ def home(): query_filter = request.args.get(u'filter', u'') query = request.args.get(u'q', u'') # Only render upload button if it is configured. - upload_enabled = u'UPLOAD_FOLDER' in current_app.config + upload_enabled = current_app.config[u'UPLOAD_ENABLED'] if query_filter: if query_filter == u'user':