Skip to content

Commit 6f73adb

Browse files
committed
Merge branch 'main' into dev
2 parents 7a94623 + b446ab4 commit 6f73adb

11 files changed

+132
-21
lines changed

README.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,30 @@ by Sublime Security
66

77
Overview
88
---------
9-
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.
9+
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.
1010

11-
Why?
12-
----------
13-
Traditional email security is a one-size-fits-all black box.
11+
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.
1412

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

1715
Setup
1816
----------
1917

2018
```console
21-
curl -sL https://sublime.security/install.sh | sh
19+
curl -sL https://raw.githubusercontent.com/sublime-security/sublime-platform/main/install-and-launch.sh | sh
2220
```
2321

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

24+
[View other deployment methods](https://sublime.security/start)
25+
2626
Detection rules
2727
----------
28-
Open-source detection rules are maintained in the [sublime-rules repo](https://github.com/sublime-security/sublime-rules).
29-
28+
Open-source detection rules and links to community Feeds are maintained in the [sublime-rules repo](https://github.com/sublime-security/sublime-rules).
3029

3130
Learn more
3231
----------
33-
- [Sublime overview](https://sublime.security)
3432
- [Docs](https://docs.sublimesecurity.com)
35-
- [Message Query Language (MQL) reference](https://docs.sublimesecurity.com/docs/message-query-language) - Sublime's DSL purpose-built for email analysis
33+
- [API](https://docs.sublimesecurity.com/reference/introduction)
3634
- [Release log](https://new.sublimesecurity.com)
35+
- [Message Query Language (MQL)](https://docs.sublimesecurity.com/docs/message-query-language)

docker-compose.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
version: '3'
21
services:
32
sublime_postgres:
43
image: postgres:13.2
4+
command: -c 'max_connections=200'
55
restart: unless-stopped
66
container_name: sublime_postgres
77
environment:
@@ -82,21 +82,15 @@ services:
8282
networks:
8383
- net
8484
sublime_screenshot_service:
85-
image: sublimesec/render-email-html:0.1
85+
image: sublimesec/render-email-html:0.2
8686
restart: unless-stopped
8787
ports:
8888
- "8100:8100"
8989
environment:
90-
- S3_ENDPOINT=http://sublimes3:8110
91-
- SCREENSHOT_BUCKET=email-screenshots
92-
- AWS_REGION=us-east-1
9390
- DISABLE_DD=true
9491
container_name: sublime_screenshot_service
95-
env_file: sublime.env
9692
networks:
9793
- net
98-
depends_on:
99-
- sublime_create_buckets
10094
# Keep this name as sublimes3 because underscores don't play nice with certain endpoint validation
10195
sublimes3:
10296
container_name: sublimes3
@@ -145,6 +139,8 @@ services:
145139
WORKERS: 2
146140
WEB_CONCURRENCY: 5
147141
KEEP_ALIVE: 2
142+
WORKER_TIMEOUT: 30
143+
GRACEFUL_WORKER_TIMEOUT: 30
148144

149145
networks:
150146
net:
@@ -153,3 +149,4 @@ volumes:
153149
postgres:
154150
logs:
155151
s3_data:
152+
persistent_storage:

install-and-launch.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ if [ -z "$interactive" ]; then
8080
# ascii art
8181
# credit: https://patorjk.com/
8282
# font: Cyberlarge
83-
cat <<EOF
83+
cat <<'EOF'
8484
8585
======================================================================
8686
| _______ _ _ ______ _____ _______ _______ |
@@ -410,6 +410,8 @@ launch_sublime() {
410410
else
411411
echo "Daily update check is already setup"
412412
fi
413+
else
414+
echo "Automatic updates not enabled"
413415
fi
414416

415417
print_info "Launching Sublime Platform..."

nginx-custom-ssl/Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM nginx:1.23.3
2+
3+
COPY conf/nginx.conf /etc/nginx/nginx.conf
4+
COPY conf/ssl-params.conf /etc/nginx/ssl-params.conf
5+
6+
COPY certs/nginx.crt /etc/ssl/certs/nginx.crt
7+
COPY certs/nginx.key /etc/ssl/private/nginx.key
8+
COPY certs/dhparam.pem /etc/ssl/certs/dhparam.pem
9+
10+
CMD nginx -g "daemon off;"

nginx-custom-ssl/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# nginx-custom-ssl
2+
3+
SSL support with custom cert.
4+
5+
To enable SSL with your custom certificate, follow the steps below:
6+
7+
1. Copy your certificate and key to certs/nginx.crt and certs/nginx.key
8+
2. Copy your dhparam file to certs/dhparam.pem
9+
3. Edit conf/nginx.conf to update `__server_names__` to your domain or IP address
10+
4. Perform any other configuration edits that you might need
11+
5. Run `docker build -t sublime_nginx_custom_ssl .`
12+
6. Run `cd ..` (back to sublime-platform directory)
13+
7. Run `docker compose --profile nginx-custom-ssl up`

nginx-custom-ssl/certs/.keep

Whitespace-only changes.

nginx-custom-ssl/conf/nginx.conf

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
events {
2+
worker_connections 1024;
3+
}
4+
5+
http {
6+
# language server websockets
7+
map $http_upgrade $connection_upgrade {
8+
default upgrade;
9+
'' close;
10+
}
11+
12+
server {
13+
listen 80 default_server;
14+
listen [::]:80 default_server;
15+
server_name __server_names__;
16+
return 302 https://$server_name$request_uri;
17+
}
18+
19+
server {
20+
listen 443 ssl http2 default_server;
21+
listen [::]:443 ssl http2 default_server;
22+
23+
ssl_certificate /etc/ssl/certs/nginx.crt;
24+
ssl_certificate_key /etc/ssl/private/nginx.key;
25+
26+
include ssl-params.conf;
27+
28+
location /v1 {
29+
proxy_pass http://sublime_mantis:8000;
30+
proxy_set_header Host $host;
31+
proxy_set_header X-Real-IP $remote_addr;
32+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
33+
proxy_set_header X-Forwarded-Host $server_name;
34+
35+
# language server websockets
36+
proxy_set_header Upgrade $http_upgrade;
37+
proxy_set_header Connection $connection_upgrade;
38+
}
39+
40+
location /v0 {
41+
proxy_pass http://sublime_mantis:8000;
42+
proxy_set_header Host $host;
43+
proxy_set_header X-Real-IP $remote_addr;
44+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
45+
proxy_set_header X-Forwarded-Host $server_name;
46+
}
47+
48+
location / {
49+
proxy_pass http://sublime_dashboard;
50+
proxy_set_header Host $host;
51+
proxy_set_header X-Real-IP $remote_addr;
52+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
53+
proxy_set_header X-Forwarded-Host $server_name;
54+
}
55+
}
56+
}

nginx-custom-ssl/conf/ssl-params.conf

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# from https://cipherli.st/
2+
# and https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
3+
4+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
5+
ssl_prefer_server_ciphers on;
6+
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
7+
ssl_ecdh_curve secp384r1;
8+
ssl_session_cache shared:SSL:10m;
9+
ssl_session_tickets off;
10+
ssl_stapling on;
11+
ssl_stapling_verify on;
12+
resolver 8.8.8.8 8.8.4.4 valid=300s;
13+
resolver_timeout 5s;
14+
# Disable preloading HSTS for now. You can use the commented out header line that includes
15+
# the "preload" directive if you understand the implications.
16+
#add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
17+
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
18+
add_header X-Frame-Options DENY;
19+
add_header X-Content-Type-Options nosniff;
20+
21+
ssl_dhparam /etc/ssl/certs/dhparam.pem;

nginx-letsencrypt/nginx.conf

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ http {
99
'' close;
1010
}
1111

12+
client_max_body_size 50M;
13+
1214
server {
1315
listen 80;
1416
server_name ___server_names___;

update-and-run.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@ linux*) cmd_prefix="sudo " ;;
1212
darwin*) cmd_prefix="" ;;
1313
esac
1414

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

2531
old_ref=$(git rev-parse HEAD)
26-
git pull
32+
logrun git pull
2733
new_ref=$(git rev-parse HEAD)
2834

2935
if [ "${old_ref}" != "${new_ref}" ]; then

utils.sh

+5
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,8 @@ print_info() {
4848
print_warning() {
4949
print_color "\n$1\n" "warning"
5050
}
51+
52+
logrun() {
53+
echo >&2 "+ $*"
54+
"$@"
55+
}

0 commit comments

Comments
 (0)