/dev/null
105 |
106 | apt update && apt-get install -y docker-ce docker-ce-cli containerd.io
107 |
108 | curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
109 | chmod +x /usr/local/bin/docker-compose
110 | ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
111 |
112 | /bin/systemctl enable docker && \
113 | /bin/systemctl start docker
114 | /bin/systemctl daemon-reload
115 |
116 | ip link add tppdummy0 type dummy && \
117 | ip link set tppdummy0 up && \
118 | ifconfig tppdummy0 mtu 1572
119 |
120 | mkdir -p /opt/selksd/
121 |
122 | cd /opt/selksd/ && \
123 | git clone https://github.com/StamusNetworks/SELKS.git && cd SELKS/docker/ && \
124 | uname -a && whoami && echo $UID
125 |
126 | mkdir -p /opt/selksd/SELKS/docker/tar_images
127 |
128 | apt update && apt-get install -y python3-requests
129 |
130 | mkdir -p /opt/selksd/pull/
131 | cd /opt/selksd/pull/ && \
132 | git clone https://github.com/NotGlop/docker-drag.git && \
133 | python3 docker-drag/docker_pull.py jasonish/suricata:master-amd64 && \
134 | python3 docker-drag/docker_pull.py python:3.9.5-slim-buster && \
135 | python3 docker-drag/docker_pull.py hello-world:latest && \
136 | python3 docker-drag/docker_pull.py portainer/portainer-ce:latest && \
137 | python3 docker-drag/docker_pull.py nginx:latest && \
138 | python3 docker-drag/docker_pull.py elastic/elasticsearch:7.16.1 && \
139 | python3 docker-drag/docker_pull.py elastic/kibana:7.16.1 && \
140 | python3 docker-drag/docker_pull.py elastic/logstash:7.16.1 && \
141 | python3 docker-drag/docker_pull.py jasonish/suricata:master-amd64 && \
142 | python3 docker-drag/docker_pull.py ghcr.io/stamusnetworks/scirius:master && \
143 | python3 docker-drag/docker_pull.py jasonish/evebox:master && \
144 | python3 docker-drag/docker_pull.py ghcr.io/stamusnetworks/arkimeviewer:master
145 |
146 | mv /opt/selksd/pull/*.tar /opt/selksd/SELKS/docker/tar_images
147 | rm -rf /opt/selksd/pull/
148 |
149 | apt-get autoremove -y
150 | apt-get clean && \
151 | cat /dev/null > ~/.bash_history && history -c
152 |
153 |
--------------------------------------------------------------------------------
/staging/config/hooks/live/menues-changes-live-custom-kernel-choice.hook.binary:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # IF kustom kernel option is chosen:
4 | # remove the live menu since different kernel versions and custom flavours
5 | # can potentially fail to load in LIVE depending on the given environment.
6 | # so we create a file for execution at the binary stage to remove the
7 | # live menu choice. That leaves the options to install.
8 |
9 | sed -i -e 's|include live\.cfg| |' isolinux/menu.cfg
10 |
11 |
--------------------------------------------------------------------------------
/staging/config/hooks/live/menues-changes.hook.binary:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # changes of the wording (adding Stamus) in the
4 | # menu names
5 |
6 | sed -i -e 's|menu label \^Live|menu label \^Stamus SELKS Live|' isolinux/live.cfg
7 | sed -i -e 's|menu label \^Install|menu label \^Stamus SELKS Install|' isolinux/install.cfg
8 | sed -i -e 's|menu label \^Graphical install|menu label \^Stamus SELKS Graphical install|' isolinux/install.cfg
9 |
10 |
--------------------------------------------------------------------------------
/staging/etc/default/evebox:
--------------------------------------------------------------------------------
1 | # The URL to Elastic Search
2 | ELASTICSEARCH_URL="-e http://localhost:9200"
3 |
4 | # Config file.
5 | # CONFIG="-c /etc/evebox.yaml"
6 |
7 | # Other options.
8 | EVEBOX_OPTS="--host localhost"
9 |
--------------------------------------------------------------------------------
/staging/etc/iceweasel/profile/bookmarks.html:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
9 |
10 | Bookmarks
11 | Bookmarks
12 |
13 |
14 |
Bookmarks Toolbar Folder
15 | - Add bookmarks to this folder to see them displayed on the Bookmarks Toolbar
16 |
17 |
- Getting Started
18 |
19 |
S E L K S - scirius and dashboards
20 |
21 |
- Scirius ruleset management
22 |
- IDS-ALL-Events
23 |
24 |
S E L K S Help and Info
25 |
26 |
- Suricata IDPS
27 |
- Suricata IDPS wiki
28 |
- OISF
29 |
- ELK - Elasticsearch,Logstash,Kibana
30 |
- Scirius
31 |
- Stamus Networks - I Do See
32 |
- SELKS wiki
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/staging/etc/issue.net:
--------------------------------------------------------------------------------
1 | _____ __ _ __ _____ ________ __ _______
2 | / ___// /_____ _____ ___ __ _______/ | / / / ___// ____/ / / //_/ ___/
3 | \__ \/ __/ __ `/ __ `__ \/ / / / ___/ |/ / \__ \/ __/ / / / ,< \__ \
4 | ___/ / /_/ /_/ / / / / / / /_/ (__ ) /| / ___/ / /___/ /___/ /| |___/ /
5 | /____/\__/\__,_/_/ /_/ /_/\__,_/____/_/ |_/ /____/_____/_____/_/ |_/____/
6 |
7 |
8 | !!! All connections are monitored and recorded !!!
9 | !!! Disconnect IMMEDIATELY if you are not an authorized user !!!
10 |
11 |
--------------------------------------------------------------------------------
/staging/etc/logrotate.d/suricata:
--------------------------------------------------------------------------------
1 | /var/log/suricata/eve.json {
2 | daily
3 | rotate 30
4 | olddir /var/log/suricata/StatsByDate/
5 | compress
6 | missingok
7 | notifempty
8 | dateext
9 | postrotate
10 | /bin/kill -HUP $(cat /var/run/suricata.pid)
11 | endscript
12 | }
13 |
14 | # to see status
15 | # cat /var/lib/logrotate/status
16 | # to manually test -
17 | # logrotate --force /etc/logrotate.d/suricata
18 |
--------------------------------------------------------------------------------
/staging/etc/logstash/conf.d/logstash.conf:
--------------------------------------------------------------------------------
1 | input {
2 | file {
3 | path => ["/var/log/suricata/*.json"]
4 | #sincedb_path => ["/var/lib/logstash/"]
5 | sincedb_path => ["/var/cache/logstash/sincedbs/since.db"]
6 | codec => json
7 | type => "SELKS"
8 | }
9 |
10 | }
11 |
12 | filter {
13 | if [type] == "SELKS" {
14 |
15 | date {
16 | match => [ "timestamp", "ISO8601" ]
17 | }
18 |
19 | ruby {
20 | code => "
21 | if event.get('[event_type]') == 'fileinfo'
22 | event.set('[fileinfo][type]', event.get('[fileinfo][magic]').to_s.split(',')[0])
23 | end
24 | "
25 | }
26 | ruby {
27 | code => "
28 | if event.get('[event_type]') == 'alert'
29 | sp = event.get('[alert][signature]').to_s.split(' group ')
30 | if (sp.length == 2) and /\A\d+\z/.match(sp[1])
31 | event.set('[alert][signature]', sp[0])
32 | end
33 | end
34 | "
35 | }
36 |
37 | metrics {
38 | meter => [ "eve_insert" ]
39 | add_tag => "metric"
40 | flush_interval => 30
41 | }
42 | }
43 |
44 | if [http] {
45 | useragent {
46 | source => "[http][http_user_agent]"
47 | target => "[http][user_agent]"
48 | }
49 | }
50 | if [src_ip] {
51 | geoip {
52 | source => "src_ip"
53 | target => "geoip"
54 | #database => "/opt/logstash/vendor/geoip/GeoLiteCity.dat"
55 | #add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
56 | #add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
57 | }
58 | }
59 | if [dest_ip] {
60 | geoip {
61 | source => "dest_ip"
62 | target => "geoip"
63 | #database => "/opt/logstash/vendor/geoip/GeoLiteCity.dat"
64 | #add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
65 | #add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
66 | }
67 | }
68 | }
69 |
70 | output {
71 | if [event_type] and [event_type] != 'stats' {
72 | elasticsearch {
73 | hosts => "127.0.0.1"
74 | index => "logstash-%{event_type}-%{+YYYY.MM.dd}"
75 | template_overwrite => true
76 | template => "/etc/logstash/elasticsearch7-template.json"
77 | }
78 | } else {
79 | elasticsearch {
80 | hosts => "127.0.0.1"
81 | index => "logstash-%{+YYYY.MM.dd}"
82 | template_overwrite => true
83 | template => "/etc/logstash/elasticsearch7-template.json"
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/staging/etc/logstash/elasticsearch5-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "template" : "logstash-*",
3 | "version" : 50001,
4 | "settings" : {
5 | "number_of_replicas": 0,
6 | "index.refresh_interval" : "5s"
7 | },
8 | "mappings" : {
9 | "_default_" : {
10 | "_all" : {"enabled" : true, "norms" : false},
11 | "dynamic_templates" : [ {
12 | "message_field" : {
13 | "path_match" : "message",
14 | "match_mapping_type" : "string",
15 | "mapping" : {
16 | "type" : "text",
17 | "norms" : false
18 | }
19 | }
20 | }, {
21 | "string_fields" : {
22 | "match" : "*",
23 | "match_mapping_type" : "string",
24 | "mapping" : {
25 | "type" : "text", "norms" : false,
26 | "fields" : {
27 | "keyword" : { "type": "keyword", "index": "not_analyzed", "ignore_above": 256 },
28 | "raw" : { "type": "keyword", "index": "not_analyzed", "ignore_above": 256 }
29 | }
30 | }
31 | }
32 | } ],
33 | "properties" : {
34 | "@timestamp": { "type": "date", "include_in_all": false },
35 | "@version": { "type": "keyword", "include_in_all": false },
36 | "geoip" : {
37 | "dynamic": true,
38 | "properties" : {
39 | "ip": { "type": "ip" },
40 | "location" : { "type" : "geo_point" },
41 | "latitude" : { "type" : "half_float" },
42 | "longitude" : { "type" : "half_float" }
43 | }
44 | },
45 | "dest_ip": {
46 | "type": "ip",
47 | "fields": {
48 | "raw": {"index": "not_analyzed", "type": "keyword"},
49 | "keyword": {"index": "not_analyzed", "type": "keyword"}
50 | }
51 | },
52 | "src_ip": {
53 | "type": "ip",
54 | "fields": {
55 | "raw": {"index": "not_analyzed", "type": "keyword"},
56 | "keyword": {"index": "not_analyzed", "type": "keyword"}
57 | }
58 | }
59 | }
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/staging/etc/logstash/elasticsearch6-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "template" : "logstash-*",
3 | "version" : 60001,
4 | "settings" : {
5 | "number_of_replicas": 0,
6 | "index.refresh_interval" : "5s"
7 | },
8 | "mappings" : {
9 | "_default_" : {
10 | "dynamic_templates" : [ {
11 | "message_field" : {
12 | "path_match" : "message",
13 | "match_mapping_type" : "string",
14 | "mapping" : {
15 | "type" : "text",
16 | "norms" : false
17 | }
18 | }
19 | }, {
20 | "string_fields" : {
21 | "match" : "*",
22 | "match_mapping_type" : "string",
23 | "mapping" : {
24 | "type" : "text", "norms" : false,
25 | "fields" : {
26 | "keyword" : { "type": "keyword", "ignore_above": 256 }
27 | }
28 | }
29 | }
30 | } ],
31 | "properties" : {
32 | "@timestamp": { "type": "date"},
33 | "@version": { "type": "keyword"},
34 | "geoip" : {
35 | "dynamic": true,
36 | "properties" : {
37 | "ip": { "type": "ip" },
38 | "location" : { "type" : "geo_point" },
39 | "latitude" : { "type" : "half_float" },
40 | "longitude" : { "type" : "half_float" }
41 | }
42 | }
43 | }
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/staging/etc/logstash/elasticsearch7-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "template" : "logstash-*",
3 | "version" : 60001,
4 | "settings" : {
5 | "number_of_replicas": 0,
6 | "index.refresh_interval" : "5s"
7 | },
8 | "mappings" : {
9 | "dynamic_templates" : [ {
10 | "message_field" : {
11 | "path_match" : "message",
12 | "match_mapping_type" : "string",
13 | "mapping" : {
14 | "type" : "text",
15 | "norms" : false
16 | }
17 | }
18 | }, {
19 | "string_fields" : {
20 | "match" : "*",
21 | "match_mapping_type" : "string",
22 | "mapping" : {
23 | "type" : "text", "norms" : false,
24 | "fields" : {
25 | "keyword" : { "type": "keyword", "ignore_above": 256 }
26 | }
27 | }
28 | }
29 | } ],
30 | "properties" : {
31 | "@timestamp": { "type": "date"},
32 | "@version": { "type": "keyword"},
33 | "geoip" : {
34 | "dynamic": true,
35 | "properties" : {
36 | "ip": { "type": "ip" },
37 | "location" : { "type" : "geo_point" },
38 | "latitude" : { "type" : "half_float" },
39 | "longitude" : { "type" : "half_float" }
40 | }
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/staging/etc/motd:
--------------------------------------------------------------------------------
1 |
2 | SELKS comes with ABSOLUTELY NO WARRANTY, to the extent
3 | permitted by applicable law.
4 |
5 | The programs included with the Debian GNU/Linux system are free software;
6 | the exact distribution terms for each program are described in the
7 | individual files in /usr/share/doc/*/copyright.
8 |
9 | Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
10 | permitted by applicable law.
11 | _____ __ _ __ _____ ________ __ _______
12 | / ___// /_____ _____ ___ __ _______/ | / / / ___// ____/ / / //_/ ___/
13 | \__ \/ __/ __ `/ __ `__ \/ / / / ___/ |/ / \__ \/ __/ / / / ,< \__ \
14 | ___/ / /_/ /_/ / / / / / / /_/ (__ ) /| / ___/ / /___/ /___/ /| |___/ /
15 | /____/\__/\__,_/_/ /_/ /_/\__,_/____/_/ |_/ /____/_____/_____/_/ |_/____/
16 |
17 |
--------------------------------------------------------------------------------
/staging/etc/profile.d/pythonpath.sh:
--------------------------------------------------------------------------------
1 | PYTHONPATH="/usr/lib/python2.7/site-packages/":"${PYTHONPATH}"
2 | export PYTHONPATH
3 |
--------------------------------------------------------------------------------
/staging/etc/systemd/system/molochpcapread-selks.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Moloch Pcap Read
3 | After=network.target
4 | #Requires=network.target
5 |
6 | #After=network.target elasticsearch.service
7 | #Requires=network.target elasticsearch.service
8 |
9 | [Service]
10 | Type=simple
11 | #Restart=on-failure
12 | StandardOutput=tty
13 | #ExecStartPre=-/data/moloch/bin/moloch_config_interfaces.sh
14 | ExecStart=/bin/sh -c '/data/moloch/bin/moloch-capture -c /data/moloch/etc/config.ini -m -s -R /data/nsm/ >> /data/moloch/logs/capture.log 2>&1'
15 | WorkingDirectory=/data/moloch
16 | LimitCORE=infinity
17 | Restart=always
18 | RestartSec=90
19 | StartLimitInterval=600
20 | StartLimitBurst=4
21 |
22 | [Install]
23 | WantedBy=multi-user.target
24 |
--------------------------------------------------------------------------------
/staging/etc/systemd/system/molochviewer-selks.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Moloch Viewer
3 | After=network.target
4 |
5 | [Service]
6 | Type=simple
7 | #Restart=on-failure
8 | StandardOutput=tty
9 | ExecStart=/bin/sh -c '/data/moloch/bin/node viewer.js -c /data/moloch/etc/config.ini >> /data/moloch/logs/viewer.log 2>&1'
10 | WorkingDirectory=/data/moloch/viewer
11 | Restart=always
12 | RestartSec=90
13 | StartLimitInterval=600
14 | StartLimitBurst=4
15 |
16 | [Install]
17 | WantedBy=multi-user.target
18 |
--------------------------------------------------------------------------------
/staging/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StamusNetworks/SELKS/4af455cd15f69f2ba471fa6cd0b96d6aae6e93b9/staging/splash.png
--------------------------------------------------------------------------------
/staging/usr/share/applications/Evebox.desktop:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env xdg-open
2 | [Desktop Entry]
3 | Version=1.0
4 | Name=EveBox
5 | Icon=applications-internet
6 | Comment=Launch-EveBox-Web-Access
7 | Exec=firefox-esr https://localhost/evebox/
8 | Type=Application
9 | Categories=Application;System;
10 | StartupNotify=true
11 | Terminal=false
12 |
13 |
--------------------------------------------------------------------------------
/staging/usr/share/applications/Scirius.desktop:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env xdg-open
2 | [Desktop Entry]
3 | Version=1.0
4 | Name=Scirius
5 | #Icon=preferences-other
6 | Icon=applications-internet
7 | Comment=Launch-Kibana-Web-Access
8 | Exec=firefox-esr https://localhost/rules/
9 | Type=Application
10 | Categories=Application;System;
11 | StartupNotify=true
12 | Terminal=false
13 |
14 |
--------------------------------------------------------------------------------
/staging/usr/share/polkit-1/actions/org.stamusnetworks.firsttimesetup.policy:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 | Run the first time setup script as root
10 | Authentication is required to run SELKS First Time Setup
11 |
12 | auth_admin
13 | auth_admin
14 | auth_admin
15 |
16 | /usr/bin/selks-first-time-setup_stamus
17 | TRUE
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/staging/usr/share/polkit-1/actions/org.stamusnetworks.setupidsinterface.policy:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 | Run Setup IDS interface as root
10 | Authentication is required to run Setup IDS interface
11 |
12 | auth_admin
13 | auth_admin
14 | auth_admin
15 |
16 | /usr/bin/selks-setup-ids-interface
17 | TRUE
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/staging/usr/share/polkit-1/actions/org.stamusnetworks.update.policy:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 | Run SELKS upgrade as root
10 | Authentication is required to run SELKS upgrade
11 |
12 | auth_admin
13 | auth_admin
14 | auth_admin
15 |
16 | /usr/bin/selks-upgrade_stamus
17 | TRUE
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/staging/usr/share/polkit-1/rules.d/org.stamusnetworks.rules:
--------------------------------------------------------------------------------
1 | # Allow all users in the sudo group to run the SELKS setup scripts
2 | polkit.addRule(function(action, subject) {
3 | if ((action.id == "org.freedesktop.policykit.pkexec.run-selksfirsttimesetup" || action.id == "org.freedesktop.policykit.pkexec.run-selkssetupidsinterface" || action.id == "org.freedesktop.policykit.pkexec.run-selksupgrade") && subject.isInGroup("sudo")) {
4 | return polkit.Result.YES;
5 | }
6 | });
7 |
--------------------------------------------------------------------------------