Skip to content

LighthouseNotes/Docker

Repository files navigation


Lighthouse Notes Docker

Lighthouse Notes is a source available digital forensics note taking application
Report Bug · Request Feature · Get Support

About

Lighthouse is a university dissertation project which implements a source available digital forensics note taking application. With the following features:

  • Authentication / Authorization
  • User management
  • Case management
  • Basic exhibit management
  • Timestamped contemporaneous notes
  • Custom tabs
  • Image / Picture uploads
  • Exhibit and user tagging
  • MD5 and SHA256 hashing
  • Storage of notes, tabs and images in a S3 bucket (encrypted using SSE-KMS)
  • Localization settings
  • Audit log

This repository holds a script to generate a docker-compose file, nginx site configurations and a database initialization script. As well as the instructions for how to deploy Lighthouse notes using docker.

Prerequisites

Getting Started

Domain

The following DNS records need to be created for your domain name:

api.example.com        1    IN    A    1.2.3.4
app.example.com        1    IN    A    1.2.3.4
s3.example.com         1    IN    A    1.2.3.4

Note

Replace example.com with your own domain name and 1.2.3.4 with the ip address of the public facing server.

Synfusion

Register for a Synfusion license here.

Tip

Depending on your company size and revenue you may be eligible for a free community license.

After you have create an account and obtained a license, navigate to https://www.syncfusion.com/account/downloads. Click "Get License Key" and chose the following options:

  • Platform - select ASP.NET, ASP.NET Core and Blazor
  • Change version to 24.x.x

Click "Get License Key", copy the license key and when prompted in the gen.py script enter it.

Important

The license key will only be shown once!

Auth0

  1. Create an Auth0 account and tenant following the instructions here.

  2. Navigate to Dashboard > Applications > APIs and create an API. Alt text

Note

Replace example.com with your own domain name.

  1. Navigate to Dashboard > Applications > Applications and create an application. Making sure to select "Regular Web Applications". Alt text

    Configure application Settings as follows

    • Set "Application Login URI" to https://app.example.com/account/login?returnUrl=

Note

Replace example.com with your own domain name.

  • Set "Allowed Callback URLs to https://app.example.com/callback

Note

Replace example.com with your own domain name.

  • Set "Allowed Logout URLS to https://app.example.com/

Note

Replace example.com with your own domain name.

  • Enable "Refresh Token Rotation"
  • Enable "Inactivity Expiration". Alt text
  • Change to the "Organizations" section. Alt text
  • Click "Disable Grants Now".
  • Change "Types of Users" to "Business Users".
  • Change "Login Flow" to "Prompt for Credentials". Alt text
  1. Create another application, this time selecting "Machine to Machine Applications". Alt text

  2. Navigate to Dashboard > User Management > Roles and create the following roles:

    user
    sio
    organization-administrator 
    

Warning

Role names are case senstive

Alt text

  1. Navigate to Dashboard > User Management > Users and create a user. Alt text

  2. Navigate to Dashboard > Organizations and create an organization. Alt text

  3. Change to the "Connections" panel and enable the "Username-Password-Authentication" database connection by clicking "Enable Connections" and then selecting "Username-Password-Authentication" and clicking "Enable Connection". Alt text

  4. Add the user to the organization by changing to the "Members" tab and clicking "Add Members". Alt text

  5. Click the "..." next to the member you just added and click "Assign Roles". Alt text

  6. Assign all the roles we created in step 5 (user, sio, and organization-administrator). Alt text

  7. Navigate to Dashboard > Applications > APIs > API we created in step 2. Then click the "Machine To Machine Applications" tab and enable "Lighthouse Notes".

  8. Navigate to Dashboard > Actions > Flows > Login. Click the + to add an action and choose Build from scratch". Alt text

  • Add the following code inside the exports.onExecutePostLogin function:

    // Id token is the stored by the app
    api.idToken.setCustomClaim(`http://schemas.microsoft.com/ws/2008/06/identity/claims/role`, event.authorization.roles);
    api.idToken.setCustomClaim(`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress`, event.user.email);
    
    // Access token is used to call api
    api.accessToken.setCustomClaim(`http://schemas.microsoft.com/ws/2008/06/identity/claims/role`, event.authorization.roles);

    Alt text

  • Click "Deploy" and then click "Add to flow" in the notification.

  • Then drag the "Custom Claims" into the flow. Alt text

  • Click "Apply".

Script

  1. Clone the Github repository with git clone https://github.com/LighthouseNotes/Docker.git.
  2. Navigate to the repository with cd Docker.
  3. Create a virtual environment with python -m venv env.
  4. Activate the virtual environment with source env/bin/activate on Linux and MacOS or env\Scripts\activate.bat.
  5. Install the requirements with pip install -r requirements.txt.
  6. Run the script with python gen.py.
  7. Follow the instructions.

Usage

  1. Download Synfusion Blink Libraries by visting: https://www.syncfusion.com/account/downloads/studio/licensed/24_1_41 , selecting Linux and scrolling down to the "Add-On" section and then clicking the "Download" button next to "HTML Converter for Linux".

  2. Unzip the file with unzip syncfusionessentialhtmlconverter.zip "BlinkBinaries/*" -d "./BlinkBinaries"

Important

The BlinkBinaries folder must be in the same directory as the docker-compose.yml file

  1. Generate a self signed certificate dotnet dev-certs https -ep lighthousenotes.pfx -p CHANGME.

Note

Replace CHANGEME with the password you specified in the script for the "Certificate Password" prompt

  1. Start SWAG with docker compose up -d swag.

  2. Once you see successfully received certificateand Server ready in the swag container logs, move to step 6.

Tip

Use docker logs swag to view the container logs

  1. Copy the Nginx site configs with mv site-confs/* swag/nginx/site-confs/.

  2. Restart the SWAG container with docker restart swag.

  3. Bring up the rest of the docker containers with docker compose up -d.

  4. Navigate to the S3 console by opening the following in a browser https://s3.example.com:9001

Note

Replace example.com with your own domain name.

  1. Login with minio as the user and the password you specified in the script at the "Minio root password" prompt.

  2. Create a bucket named lighthouse-notes and enable "Versioning". Alt text

  3. Click on the newly created bucket.

  4. Click "Lifecycle", then "Add Lifecycle Rule" and set the lifecycle rule as follows: Alt text

    • Set "Object Version" to "Non-Current Version"

    • Set "After" to 30 days

    • Enable "Expire Delete Marker"

Important

Change "After" to the time period you wish to store edits to tabs for. E.g if you want to store edits to a tab for the past 30 days, set it to 30.

  1. Navigate to the "Access Keys" section in the side menu, and create an access key.

Important

Store the access key and secret key somewhere temporarily as they are only shown once

  1. Open the application in a private web browser, by visiting app.example.com.

Note

Use a private web browser untill you have set the organization settings, this is because it wil cache the incorrect settings on first load.


Note

Replace example.com with your own domain name.

  1. Login with the user you created in the Auth0

  2. Navigate to organization settings and change the "S3 Access Key" and "S3 Secret Key" to ones you created in step 10.

  3. Change the "Meilisearch API key "to the key outputted at the end of the the gen.py script.

  4. Click "Save".

  5. Click the profile icon in top right and click "Profile" on this page click "Submit".

Note

This is to save your user information to Meilisearch so your user is searchable.

  1. Close the private browser window and then use the app as normal.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published