Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into dev #196

Draft
wants to merge 76 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b120643
v1.2 (#106)
itsojon Mar 1, 2023
206ed25
v1.3 (#108)
jtb6 Mar 15, 2023
aa21778
Update README.md (#111)
jkamdjou Mar 24, 2023
4b6d76b
Update README.md (#112)
jkamdjou Mar 24, 2023
9e970ae
Update README.md (#113)
jkamdjou Apr 16, 2023
846a4f7
Add custom SSL helpers (#114)
madirey Apr 26, 2023
6a20f89
v1.4 (#115)
itsojon May 3, 2023
87afc21
Platform v1.5 (#116)
cameron-dunn-sublime May 11, 2023
e514af1
Scale strelka backends to 2 by default (#117)
rw-access May 22, 2023
07f6b0c
Platform v1.6 (#118)
rw-access May 23, 2023
aa20c80
Bump to v1.7 (#119)
cameron-dunn-sublime Jun 2, 2023
703f207
v1.8 (#120)
cameron-dunn-sublime Jun 8, 2023
208b6f1
v1.9 (#121)
cameron-dunn-sublime Jun 13, 2023
76d4c28
Release 1.10 (#122)
rw-access Jun 14, 2023
996ffb5
Bump BE/FE to 1.11 (#123)
madirey Jun 22, 2023
2e6fdba
Platform v1.12 (#124)
rw-access Jun 23, 2023
17a365b
Platform v1.13 (#125)
hugh-sublime Jun 27, 2023
c569730
Platform v1.14 (#127)
benjamminj Jul 13, 2023
3e08112
Bump to v1.15 (#128)
alexk307 Jul 19, 2023
0250781
Platform v1.16 (#131)
rw-access Aug 9, 2023
7098b15
quotin
cameron-dunn-sublime Aug 15, 2023
f85b96e
Revert "quotin"
cameron-dunn-sublime Aug 15, 2023
cb48ce6
Allow overriding cmd prefix (#132)
cameron-dunn-sublime Aug 17, 2023
c3b7947
Platform v1.17 (#133)
itsojon Aug 22, 2023
430f817
Platform v1.18 (#134)
hugh-sublime Aug 28, 2023
25c4a3b
Platform v1.19 (#135)
cameron-dunn-sublime Sep 27, 2023
3d2da1f
Platform v1.20 (#136)
rw-access Oct 4, 2023
fba527a
Platform v1.21 (#137)
cameron-dunn-sublime Oct 5, 2023
2504580
Platform v1.22 (#138)
cameron-dunn-sublime Oct 17, 2023
36d11c6
Platform v1.23 (#139)
jtb6 Oct 24, 2023
80c7303
Platform v1.24 (#140)
itsojon Oct 30, 2023
10d13e8
Platform v1.25 (#141)
hugh-sublime Nov 2, 2023
4c86d8c
v1.26 (#143)
madirey Nov 29, 2023
754e25a
Platform v1.27 (#145)
cameron-dunn-sublime Dec 13, 2023
dd11c18
v1.30 (#146)
madirey Jan 4, 2024
98a0896
Make error message more verbose (#144)
jkamdjou Jan 4, 2024
e0bae11
Increase the HTTP max request body size (#147)
rw-access Jan 4, 2024
8fefc19
Add inline-messages bucket (#148)
madirey Jan 5, 2024
c3ac517
Platform v1.31 (#149)
hugh-sublime Jan 10, 2024
2b3b245
Platform v1.32 (#150)
benjamminj Jan 17, 2024
81608b8
Platform v1.33 (#151)
hugh-sublime Jan 22, 2024
b8de953
Platform v1.34 (#152)
jtb6 Feb 8, 2024
0e29eca
feat: add mantis host url to FE container in docker-compose (#153)
benjamminj Feb 20, 2024
db777e2
Increase Hydra default timeout to 30s (#155)
rw-access Mar 11, 2024
c838402
bump to 1.35 (#156)
alexk307 Apr 2, 2024
3aca469
bump to v1.36 (#157)
lalalalinna Apr 6, 2024
049b2a1
Bump to v1.37 (#158)
cameron-dunn-sublime Apr 12, 2024
834a18a
Remove inline-messages bucket (#159)
madirey Apr 16, 2024
2de406a
upgrade to version v1.38 (#160)
lalalalinna Apr 18, 2024
01814d4
Upgrade to v1.39 (#161)
benjamminj Apr 30, 2024
b00310c
Freeze Hydra web concurrency (#162)
hugh-sublime Apr 30, 2024
20f08d4
Bump platform to v1.40 (#163)
rw-access May 20, 2024
3953667
Bump max pg connections (#164)
madirey May 21, 2024
7bbcae6
Freeze Hydra timeouts (#165)
hugh-sublime May 22, 2024
8fd15a9
Platform v1.41 (#167)
rw-access Jun 7, 2024
a6af10a
Platform v1.42 (#168)
rw-access Jun 10, 2024
b0c7329
Platform v1.43 (#169)
rw-access Jun 11, 2024
5452c6c
Freeze Hydra keep-alive at 2 seconds (#170)
hugh-sublime Jun 13, 2024
b910e59
v1.44 (#171)
benjamminj Jun 24, 2024
5f24085
Platform v1.45 (#172)
itsojon Jul 16, 2024
37b8b66
Add volume for bora/mantis persistent storage (#174)
rw-access Jul 30, 2024
6a4c23d
Remove S3/MinIO config for screenshot service (#173)
cameron-dunn-sublime Aug 6, 2024
42feaed
Platform v1.46 (#175)
rw-access Aug 29, 2024
906300c
Platform v1.48 (#177)
jtb6 Oct 9, 2024
59dc5a2
Platform v1.49 (#178)
pricejc-sublime Oct 10, 2024
4f4c318
Platform v1.50 (#179)
itsojon Oct 17, 2024
38d7a60
v1.51 (#181)
cameron-dunn-sublime Oct 30, 2024
778377c
v1.52 (#183)
alexk307 Nov 18, 2024
5a93771
v1.53 bump (#184)
alexk307 Nov 25, 2024
9e4a057
bump to 1.54 (#185)
benjamminj Nov 26, 2024
054bc72
Platform v1.55.0 (#186)
rw-access Dec 6, 2024
36f8631
Platform 1.56 (#189)
benjamminj Dec 11, 2024
28ea715
Bump Hydra minor version (#191)
cameron-dunn-sublime Feb 5, 2025
4b9f1ca
Bump to v1.57 (#192)
madirey Feb 12, 2025
b446ab4
Make a few minor improvements to install script (#194)
ab Feb 12, 2025
6f73adb
Merge branch 'main' into dev
ab Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,30 @@ by Sublime Security

Overview
---------
An open, adaptable email security platform for writing, running, and sharing custom detection and response rules to block phishing attacks, hunt for threats, and more.
A free and open platform for detecting and preventing email attacks like BEC, malware, and credential phishing. Gain visibility and control, hunt for advanced threats, and collaborate with the community.

Why?
----------
Traditional email security is a one-size-fits-all black box.
Sublime uses Message Query Language (MQL), a domain-specific language purpose-built for describing behavior in email. MQL is email provider agnostic, enabling defenders to write, run, and share Detections-as-Code.

The Sublime Platform **gives defenders control over their email environment** and uses an intuitive, interoperable, purpose-built domain-specific language (DSL).
Learn more about MQL: [Introduction to Message Query Language](https://sublime.security/blog/introduction-to-message-query-language-mql)

Setup
----------

```console
curl -sL https://sublime.security/install.sh | sh
curl -sL https://raw.githubusercontent.com/sublime-security/sublime-platform/main/install-and-launch.sh | sh
```

[View Docker Quickstart](https://docs.sublimesecurity.com/docs/quickstart-docker)

[View other deployment methods](https://sublime.security/start)

Detection rules
----------
Open-source detection rules are maintained in the [sublime-rules repo](https://github.com/sublime-security/sublime-rules).

Open-source detection rules and links to community Feeds are maintained in the [sublime-rules repo](https://github.com/sublime-security/sublime-rules).

Learn more
----------
- [Sublime overview](https://sublime.security)
- [Docs](https://docs.sublimesecurity.com)
- [Message Query Language (MQL) reference](https://docs.sublimesecurity.com/docs/message-query-language) - Sublime's DSL purpose-built for email analysis
- [API](https://docs.sublimesecurity.com/reference/introduction)
- [Release log](https://new.sublimesecurity.com)
- [Message Query Language (MQL)](https://docs.sublimesecurity.com/docs/message-query-language)
13 changes: 5 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
sublime_postgres:
image: postgres:13.2
command: -c 'max_connections=200'
restart: unless-stopped
container_name: sublime_postgres
environment:
Expand Down Expand Up @@ -82,21 +82,15 @@ services:
networks:
- net
sublime_screenshot_service:
image: sublimesec/render-email-html:0.1
image: sublimesec/render-email-html:0.2
restart: unless-stopped
ports:
- "8100:8100"
environment:
- S3_ENDPOINT=http://sublimes3:8110
- SCREENSHOT_BUCKET=email-screenshots
- AWS_REGION=us-east-1
- DISABLE_DD=true
container_name: sublime_screenshot_service
env_file: sublime.env
networks:
- net
depends_on:
- sublime_create_buckets
# Keep this name as sublimes3 because underscores don't play nice with certain endpoint validation
sublimes3:
container_name: sublimes3
Expand Down Expand Up @@ -145,6 +139,8 @@ services:
WORKERS: 2
WEB_CONCURRENCY: 5
KEEP_ALIVE: 2
WORKER_TIMEOUT: 30
GRACEFUL_WORKER_TIMEOUT: 30

networks:
net:
Expand All @@ -153,3 +149,4 @@ volumes:
postgres:
logs:
s3_data:
persistent_storage:
4 changes: 3 additions & 1 deletion install-and-launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ if [ -z "$interactive" ]; then
# ascii art
# credit: https://patorjk.com/
# font: Cyberlarge
cat <<EOF
cat <<'EOF'

======================================================================
| _______ _ _ ______ _____ _______ _______ |
Expand Down Expand Up @@ -410,6 +410,8 @@ launch_sublime() {
else
echo "Daily update check is already setup"
fi
else
echo "Automatic updates not enabled"
fi

print_info "Launching Sublime Platform..."
Expand Down
10 changes: 10 additions & 0 deletions nginx-custom-ssl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM nginx:1.23.3

COPY conf/nginx.conf /etc/nginx/nginx.conf
COPY conf/ssl-params.conf /etc/nginx/ssl-params.conf

COPY certs/nginx.crt /etc/ssl/certs/nginx.crt
COPY certs/nginx.key /etc/ssl/private/nginx.key
COPY certs/dhparam.pem /etc/ssl/certs/dhparam.pem

CMD nginx -g "daemon off;"
13 changes: 13 additions & 0 deletions nginx-custom-ssl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# nginx-custom-ssl

SSL support with custom cert.

To enable SSL with your custom certificate, follow the steps below:

1. Copy your certificate and key to certs/nginx.crt and certs/nginx.key
2. Copy your dhparam file to certs/dhparam.pem
3. Edit conf/nginx.conf to update `__server_names__` to your domain or IP address
4. Perform any other configuration edits that you might need
5. Run `docker build -t sublime_nginx_custom_ssl .`
6. Run `cd ..` (back to sublime-platform directory)
7. Run `docker compose --profile nginx-custom-ssl up`
Empty file added nginx-custom-ssl/certs/.keep
Empty file.
56 changes: 56 additions & 0 deletions nginx-custom-ssl/conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
events {
worker_connections 1024;
}

http {
# language server websockets
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name __server_names__;
return 302 https://$server_name$request_uri;
}

server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;

ssl_certificate /etc/ssl/certs/nginx.crt;
ssl_certificate_key /etc/ssl/private/nginx.key;

include ssl-params.conf;

location /v1 {
proxy_pass http://sublime_mantis:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;

# language server websockets
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location /v0 {
proxy_pass http://sublime_mantis:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}

location / {
proxy_pass http://sublime_dashboard;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
}
21 changes: 21 additions & 0 deletions nginx-custom-ssl/conf/ssl-params.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# from https://cipherli.st/
# and https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
# Disable preloading HSTS for now. You can use the commented out header line that includes
# the "preload" directive if you understand the implications.
#add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;

ssl_dhparam /etc/ssl/certs/dhparam.pem;
2 changes: 2 additions & 0 deletions nginx-letsencrypt/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ http {
'' close;
}

client_max_body_size 50M;

server {
listen 80;
server_name ___server_names___;
Expand Down
10 changes: 8 additions & 2 deletions update-and-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ linux*) cmd_prefix="sudo " ;;
darwin*) cmd_prefix="" ;;
esac

if [ ! -z "$cmd_prefix_override" ]; then
cmd_prefix=$cmd_prefix_override
fi

if [ "$1" != "always_launch" ]; then
if ! $cmd_prefix docker compose ps | grep "mantis" >/dev/null 2>&1; then
print_error "docker compose appears to be brought down. Will not proceed to avoid relaunching."
print_error "Sublime Platform appears to have been manually shut down. Will not proceed to avoid relaunching."
print_warning "If you wish to relaunch, please refer to the documentation here:"
print_warning "https://docs.sublimesecurity.com/docs/quickstart-docker#how-to-update"
exit 0
fi
fi
Expand All @@ -23,7 +29,7 @@ if [ -z "$(git status --porcelain)" ]; then
echo "git working dir clean. Proceeding with git updates."

old_ref=$(git rev-parse HEAD)
git pull
logrun git pull
new_ref=$(git rev-parse HEAD)

if [ "${old_ref}" != "${new_ref}" ]; then
Expand Down
5 changes: 5 additions & 0 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ print_info() {
print_warning() {
print_color "\n$1\n" "warning"
}

logrun() {
echo >&2 "+ $*"
"$@"
}
Loading