├── VERSION ├── scripts ├── System_Scripts │ ├── .gitkeep │ ├── listenNamedPipe.sh │ ├── GenCert.sh │ ├── sendmail.sh │ ├── wipe_part.sh │ ├── box4s_service.sh │ └── wait-for-healthy-container.sh ├── Automation │ ├── diskspacealert.sh │ ├── agent-upgrade.py │ └── versions.py ├── 1stLevelRepair │ ├── repair_restart.sh │ ├── repair_createSnapshot.sh │ ├── repair_snapshot.sh │ ├── repair_format.sh │ └── repair_reset.sh └── Development │ ├── healthy.sh │ └── backup4srepos.sh ├── docker ├── suricata │ ├── .gitignore │ ├── etc │ │ ├── update.yaml │ │ └── reference.config │ ├── scripts │ │ ├── update.sh │ │ └── ingest_testdata.sh │ └── Dockerfile ├── dnsmasq │ ├── resolv.personal │ ├── Dockerfile │ └── dnsmasq.conf ├── logstash │ ├── .env.ls │ └── etc │ │ ├── conf.d │ │ ├── openvas │ │ │ ├── 10_openvas_input.conf │ │ │ ├── 25-openvas-special.conf │ │ │ └── 100_openvas_output_pipe.conf │ │ ├── heartbeat │ │ │ ├── 10_heartbeat_input.conf │ │ │ └── 99_output.conf │ │ ├── suricata │ │ │ ├── 10_input_suricata.conf │ │ │ └── 99_output_pipe.conf │ │ ├── metricbeat │ │ │ ├── 10_metricbeat_input.conf │ │ │ └── 100_output.conf │ │ ├── estransfer │ │ │ ├── metricbeat_es_transfer.conf │ │ │ ├── heartbeat_es_transfer.conf │ │ │ ├── openvas_es_transfer.conf │ │ │ └── suricata_es_transfer.conf │ │ └── inputs │ │ │ ├── input_pipelines.conf │ │ │ └── basic_input.conf │ │ ├── pipelines.yml │ │ ├── startup.options │ │ ├── jvm.options │ │ └── BOX4s │ │ ├── icmp-codes.yaml │ │ ├── icmp-type.yaml │ │ ├── icmpv6-type.yaml │ │ └── suricata-template.json ├── web │ ├── source │ │ ├── static │ │ │ ├── wizard.js │ │ │ ├── faq │ │ │ │ ├── nav.png │ │ │ │ ├── pinfilter.jpg │ │ │ │ ├── filtersource.jpg │ │ │ │ ├── appliedfilters.jpg │ │ │ │ ├── filtercategory.jpg │ │ │ │ ├── filtersignature.jpg │ │ │ │ └── SuppressAlarms.mp4 │ │ │ ├── favicon.ico │ │ │ ├── Box4S_Logo.png │ │ │ ├── external │ │ │ │ ├── icons.woff │ │ │ │ ├── fonts │ │ │ │ │ ├── S6uyw4BMUTPHjx4wXg.woff2 │ │ │ │ │ ├── S6u8w4BMUTPHjxsAXC-q.woff2 │ │ │ │ │ ├── S6uyw4BMUTPHjxAwXjeu.woff2 │ │ │ │ │ ├── S6u8w4BMUTPHjxsAUi-qJCY.woff2 │ │ │ │ │ ├── S6u9w4BMUTPHh6UVSwaPGR_p.woff2 │ │ │ │ │ ├── S6u9w4BMUTPHh6UVSwiPGQ.woff2 │ │ │ │ │ ├── S6u_w4BMUTPHjxsI5wq_Gwft.woff2 │ │ │ │ │ └── S6u_w4BMUTPHjxsI5wq_FQft1dw.woff2 │ │ │ │ └── themes │ │ │ │ │ └── default │ │ │ │ │ └── assets │ │ │ │ │ ├── fonts │ │ │ │ │ ├── icons.eot │ │ │ │ │ ├── icons.otf │ │ │ │ │ ├── icons.ttf │ │ │ │ │ ├── icons.woff │ │ │ │ │ ├── icons.woff2 │ │ │ │ │ ├── brand-icons.eot │ │ │ │ │ ├── brand-icons.ttf │ │ │ │ │ ├── brand-icons.woff │ │ │ │ │ ├── brand-icons.woff2 │ │ │ │ │ ├── outline-icons.eot │ │ │ │ │ ├── outline-icons.ttf │ │ │ │ │ ├── outline-icons.woff │ │ │ │ │ └── outline-icons.woff2 │ │ │ │ │ └── images │ │ │ │ │ └── flags.png │ │ │ └── box4s.css │ │ ├── wizard │ │ │ ├── __init__.py │ │ │ ├── templates │ │ │ │ ├── logstash │ │ │ │ │ ├── drop.jinja2 │ │ │ │ │ ├── netplan.yaml.jinja2 │ │ │ │ │ ├── BOX4s-special.conf.jinja2 │ │ │ │ │ ├── system.jinja2 │ │ │ │ │ └── network.jinja2 │ │ │ │ └── wizard │ │ │ │ │ ├── verify_progress.html │ │ │ │ │ └── index.html │ │ │ ├── forms.py │ │ │ └── schemas.py │ │ ├── templates │ │ │ ├── user │ │ │ │ ├── _authorized_base.html │ │ │ │ ├── emails │ │ │ │ │ ├── base_subject.txt │ │ │ │ │ ├── invite_user_subject.txt │ │ │ │ │ ├── confirm_email_subject.txt │ │ │ │ │ ├── reset_password_subject.txt │ │ │ │ │ ├── password_changed_subject.txt │ │ │ │ │ ├── username_changed_subject.txt │ │ │ │ │ ├── registered_subject.txt │ │ │ │ │ ├── base_message.txt │ │ │ │ │ ├── base_message.html │ │ │ │ │ ├── username_changed_message.html │ │ │ │ │ ├── username_changed_message.txt │ │ │ │ │ ├── password_changed_message.html │ │ │ │ │ ├── reset_password_message.txt │ │ │ │ │ ├── password_changed_message.txt │ │ │ │ │ ├── confirm_email_message.txt │ │ │ │ │ ├── reset_password_message.html │ │ │ │ │ ├── confirm_email_message.html │ │ │ │ │ ├── invite_user_message.txt │ │ │ │ │ ├── registered_message.txt │ │ │ │ │ ├── registered_message.html │ │ │ │ │ └── invite_user_message.html │ │ │ │ ├── invite_user.html │ │ │ │ ├── change_username.html │ │ │ │ ├── resend_confirm_email.html │ │ │ │ ├── forgot_password.html │ │ │ │ ├── edit_user_profile.html │ │ │ │ ├── manage_emails.html │ │ │ │ ├── reset_password.html │ │ │ │ ├── _macros.html │ │ │ │ ├── login_or_register.html │ │ │ │ └── change_password.html │ │ │ ├── application │ │ │ │ ├── elastalert_smtp.yaml.j2 │ │ │ │ ├── smtp.conf.j2 │ │ │ │ ├── alert_email_conf.yaml.j2 │ │ │ │ ├── alert_frequency.yaml.j2 │ │ │ │ ├── msmtprc.j2 │ │ │ │ ├── alert_spike.yaml.j2 │ │ │ │ ├── alert_base.yaml.j2 │ │ │ │ ├── quick_alert_netuse.yaml.j2 │ │ │ │ ├── quick_alert_ids.yaml.j2 │ │ │ │ ├── quick_alert_vuln.yaml.j2 │ │ │ │ └── quick_alert_malware.yaml.j2 │ │ │ ├── spiderfoot.html │ │ │ ├── dashboard.html │ │ │ ├── suricata_suppress.bpf.j2 │ │ │ ├── user_base.html │ │ │ ├── errors │ │ │ │ ├── error_base.html │ │ │ │ └── 403.html │ │ │ ├── docs.html │ │ │ ├── 15_logstash_suppress.conf.j2 │ │ │ └── system.html │ │ ├── extensions.py │ │ ├── __init__.py │ │ ├── forms.py │ │ ├── error.py │ │ └── helpers.py │ ├── tests │ │ ├── updatestatus.json │ │ ├── validBPF.json │ │ └── validLSR.json │ ├── web.env │ ├── main.py │ ├── migrations │ │ ├── script.py.mako │ │ ├── versions │ │ │ ├── d995a93c3a9c_box4s_dhcp_col.py │ │ │ ├── 6845bca64bc8_.py │ │ │ ├── 9f79000ab53d_add_alerts.py │ │ │ ├── c2bdbad3c958_network_system_rel.py │ │ │ ├── 96cfbddbc495_add_role_config.py │ │ │ ├── 045ed1db87f6_.py │ │ │ ├── 1d03ea9e33bd_.py │ │ │ ├── ea1ce32ce8fd_box4s_model.py │ │ │ ├── 532110801da9_.py │ │ │ ├── 56e9b3f51ec8_.py │ │ │ ├── 031dd699edaa_add_wizard_state.py │ │ │ ├── 2bcd96b138e4_.py │ │ │ ├── 9a02836f6117_system_and_types.py │ │ │ ├── b1685fc5f49c_create_types.py │ │ │ ├── 5aadb38f6936_network_and_types.py │ │ │ └── a59fffda1b70_box4security_table.py │ │ └── alembic.ini │ ├── requirements.txt │ └── Dockerfile ├── elasticsearch │ ├── .env.es │ ├── Dockerfile │ └── etc │ │ └── elasticsearch.yml ├── elastalert │ ├── etc │ │ ├── elastalert │ │ │ ├── smtp_auth_file.yaml │ │ │ └── config.yaml │ │ └── elastalert-server │ │ │ ├── config.json │ │ │ ├── elastalert.yaml │ │ │ └── elastalert-test.yaml │ └── Dockerfile ├── openvas │ ├── scripts │ │ ├── vulnwhisp.sh │ │ ├── update.sh │ │ ├── insertconfig.sh │ │ ├── config.py │ │ └── start.sh │ ├── etc │ │ └── vuln_openvas.ini │ └── Dockerfile ├── heartbeat │ ├── Dockerfile │ └── etc │ │ ├── monitors.d │ │ └── box4s.yml │ │ └── heartbeat.yml ├── core4s │ ├── scripts │ │ └── Automation │ │ │ ├── score_calculation │ │ │ ├── res │ │ │ │ ├── insert_template.json │ │ │ │ ├── index_mapping.json │ │ │ │ ├── social_media.query.json │ │ │ │ ├── index_settings.json │ │ │ │ ├── cvss_buckets.query.json │ │ │ │ ├── alerts_buckets.query.json │ │ │ │ └── vuln_score.json │ │ │ ├── install_index.sh │ │ │ └── calculate_scores.sh │ │ │ ├── resourceupdate.sh │ │ │ ├── download_wazuh_clients.sh │ │ │ └── ASN_update.sh │ ├── healthcheck.py │ ├── curator │ │ └── curator.yml │ ├── Dockerfile │ └── core4s.crontab ├── metricbeat │ ├── Dockerfile │ └── etc │ │ ├── modules.d │ │ ├── docker.yml │ │ └── system.yml │ │ └── metricbeat.yml ├── filebeat │ ├── Dockerfile │ └── etc │ │ └── filebeat.yml ├── db │ ├── sql │ │ ├── ASN.sql │ │ ├── uniquevulns.sql │ │ └── filters.sql │ └── Dockerfile ├── wazuh │ ├── Dockerfile │ ├── wazuh.yml │ └── config │ │ └── entrypoint.sh ├── nginx │ └── Dockerfile ├── kibana │ ├── entry.sh │ ├── etc │ │ └── kibana.yml │ └── Dockerfile ├── wiki │ ├── Dockerfile │ └── config.ru └── spiderfoot │ └── Dockerfile ├── config ├── etc │ ├── etc_files │ │ ├── hostname │ │ ├── mail.rc │ │ └── environment │ ├── modules.conf │ ├── logstash │ │ ├── beat_add_clientIP.conf │ │ ├── 20-preBOX4s.conf │ │ ├── BOX4s-special.conf │ │ ├── output.conf │ │ └── dns_resolv.conf │ ├── systemd │ │ └── box4security.service │ └── network │ │ └── interfaces ├── secrets │ ├── wazuh.conf │ ├── openvas.conf │ ├── web.conf │ ├── db.conf │ ├── secrets.conf │ ├── smtp.conf │ └── msmtprc ├── crontab │ └── amadmin.crontab ├── ssl │ └── box4security-ssl.conf └── dashboards │ └── Patterns │ └── scores.ndjson ├── .gitattributes ├── docs └── box4security.png ├── .gitignore ├── Makefile └── CHANGELOG.md /VERSION: -------------------------------------------------------------------------------- 1 | VERSION=0.0.5 2 | -------------------------------------------------------------------------------- /scripts/System_Scripts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/suricata/.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | -------------------------------------------------------------------------------- /config/etc/etc_files/hostname: -------------------------------------------------------------------------------- 1 | box4security 2 | -------------------------------------------------------------------------------- /docker/dnsmasq/resolv.personal: -------------------------------------------------------------------------------- 1 | nameserver 8.8.8.8 2 | -------------------------------------------------------------------------------- /docker/logstash/.env.ls: -------------------------------------------------------------------------------- 1 | ES_JAVA_OPTS=-Xms4g -Xmx4g 2 | -------------------------------------------------------------------------------- /docker/web/source/static/wizard.js: -------------------------------------------------------------------------------- 1 | // Networks 2 | 3 | -------------------------------------------------------------------------------- /config/etc/modules.conf: -------------------------------------------------------------------------------- 1 | BOX4s_WAZUH=false 2 | BOX4s_INCMAN=false -------------------------------------------------------------------------------- /docker/elasticsearch/.env.es: -------------------------------------------------------------------------------- 1 | ES_JAVA_OPTS=-Xms8g -Xmx8g 2 | -------------------------------------------------------------------------------- /docker/web/tests/updatestatus.json: -------------------------------------------------------------------------------- 1 | {"status":"running"} 2 | -------------------------------------------------------------------------------- /config/etc/etc_files/mail.rc: -------------------------------------------------------------------------------- 1 | set sendmail="/usr/bin/msmtp -t" 2 | -------------------------------------------------------------------------------- /config/secrets/wazuh.conf: -------------------------------------------------------------------------------- 1 | WAZUH_USER=box4s 2 | WAZUH_PASS=wa3hz0hPW -------------------------------------------------------------------------------- /docker/web/source/wizard/__init__.py: -------------------------------------------------------------------------------- 1 | from .views import bpWizard 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | SuppressAlarms.mp4 filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /config/secrets/openvas.conf: -------------------------------------------------------------------------------- 1 | OPENVAS_USER=amadmin 2 | OPENVAS_PASS=CHANGEME -------------------------------------------------------------------------------- /docker/suricata/etc/update.yaml: -------------------------------------------------------------------------------- 1 | reload-command: suricatasc -c ruleset-reload-nonblocking 2 | -------------------------------------------------------------------------------- /docker/elastalert/etc/elastalert/smtp_auth_file.yaml: -------------------------------------------------------------------------------- 1 | user: "box@4sconsult.de" 2 | password: "CHANGEME" -------------------------------------------------------------------------------- /docker/web/source/templates/user/_authorized_base.html: -------------------------------------------------------------------------------- 1 | {% extends 'flask_user/_common_base.html' %} 2 | -------------------------------------------------------------------------------- /docker/web/web.env: -------------------------------------------------------------------------------- 1 | FLASK_APP=source/__init__.py 2 | FLASK_ENV=production 3 | APP_FOLDER=/home/app/web -------------------------------------------------------------------------------- /docs/box4security.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docs/box4security.png -------------------------------------------------------------------------------- /docker/logstash/etc/conf.d/openvas/10_openvas_input.conf: -------------------------------------------------------------------------------- 1 | input { pipeline { address => openvas_pipe } } 2 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/base_subject.txt: -------------------------------------------------------------------------------- 1 | {{ app_name }} - {% block subject %}{% endblock %} -------------------------------------------------------------------------------- /docker/logstash/etc/conf.d/heartbeat/10_heartbeat_input.conf: -------------------------------------------------------------------------------- 1 | input { pipeline { address => heartbeat_pipe } } 2 | -------------------------------------------------------------------------------- /docker/logstash/etc/conf.d/suricata/10_input_suricata.conf: -------------------------------------------------------------------------------- 1 | input { pipeline { address => suricata_pipe } } 2 | -------------------------------------------------------------------------------- /docker/logstash/etc/conf.d/metricbeat/10_metricbeat_input.conf: -------------------------------------------------------------------------------- 1 | input { pipeline { address => metricbeat_pipe } } 2 | -------------------------------------------------------------------------------- /config/secrets/web.conf: -------------------------------------------------------------------------------- 1 | # Flask 2 | SECRET_KEY=CHANGEME 3 | DATABASE_URL=postgresql://postgres:CHANGEME@db:5432/box4S_db -------------------------------------------------------------------------------- /docker/logstash/etc/conf.d/suricata/99_output_pipe.conf: -------------------------------------------------------------------------------- 1 | output { 2 | pipeline { send_to => [suricata_esoutput] } 3 | } 4 | -------------------------------------------------------------------------------- /docker/openvas/scripts/vulnwhisp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | vuln_whisperer -c /etc/vulnwhisperer/vulnwhisperer.ini -s openvas -F 3 | -------------------------------------------------------------------------------- /docker/web/source/static/faq/nav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/faq/nav.png -------------------------------------------------------------------------------- /docker/web/source/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/favicon.ico -------------------------------------------------------------------------------- /docker/web/source/templates/application/elastalert_smtp.yaml.j2: -------------------------------------------------------------------------------- 1 | user: "{{ smtp['username'] }}" 2 | password: "{{ smtp['password'] }}" -------------------------------------------------------------------------------- /config/etc/logstash/beat_add_clientIP.conf: -------------------------------------------------------------------------------- 1 | filter 2 | { mutate { copy => {"[@metadata][ip_address]" => "[client][ip]"}} 3 | 4 | } 5 | -------------------------------------------------------------------------------- /docker/web/source/static/Box4S_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/Box4S_Logo.png -------------------------------------------------------------------------------- /docker/web/source/static/faq/pinfilter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/faq/pinfilter.jpg -------------------------------------------------------------------------------- /docker/web/source/static/external/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/icons.woff -------------------------------------------------------------------------------- /docker/web/source/static/faq/filtersource.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/faq/filtersource.jpg -------------------------------------------------------------------------------- /config/secrets/db.conf: -------------------------------------------------------------------------------- 1 | POSTGRES_USER=postgres 2 | POSTGRES_PASSWORD=CHANGEME 3 | POSTGRES_DB=box4S_db 4 | POSTGRES_HOST=localhost 5 | POSTGRES_PORT=5432 -------------------------------------------------------------------------------- /docker/heartbeat/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.elastic.co/beats/heartbeat:7.9.0 2 | 3 | COPY --chown=heartbeat:heartbeat etc/* /usr/share/heartbeat/config/ 4 | -------------------------------------------------------------------------------- /docker/web/source/static/faq/appliedfilters.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/faq/appliedfilters.jpg -------------------------------------------------------------------------------- /docker/web/source/static/faq/filtercategory.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/faq/filtercategory.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /docker/web/source/wazuh/*.deb 2 | /docker/web/source/wazuh/*.pkg 3 | /docker/web/source/wazuh/*.rpm 4 | /docker/web/source/wazuh/*.msi 5 | .vscode/ -------------------------------------------------------------------------------- /docker/core4s/scripts/Automation/score_calculation/res/insert_template.json: -------------------------------------------------------------------------------- 1 | { 2 | "score_type": "%1", 3 | "value": %2, 4 | "timestamp": %3 5 | } 6 | -------------------------------------------------------------------------------- /docker/web/source/static/faq/filtersignature.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/faq/filtersignature.jpg -------------------------------------------------------------------------------- /docker/web/main.py: -------------------------------------------------------------------------------- 1 | from flask.cli import FlaskGroup 2 | from source import app 3 | 4 | cli = FlaskGroup(app) 5 | 6 | if __name__ == '__main__': 7 | cli() 8 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/invite_user_subject.txt: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_subject.txt' %} 2 | 3 | {% block subject %}Account{% endblock %} 4 | -------------------------------------------------------------------------------- /docker/metricbeat/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.elastic.co/beats/metricbeat:7.9.0 2 | 3 | ADD etc/ /tmp/etc/ 4 | USER root 5 | RUN cp -R /tmp/etc/* /usr/share/metricbeat/ 6 | -------------------------------------------------------------------------------- /docker/logstash/etc/conf.d/heartbeat/99_output.conf: -------------------------------------------------------------------------------- 1 | output { 2 | pipeline { send_to => [heartbeat_esoutput] } 3 | #pipeline { send_to => [heartbeat_sqloutput] } 4 | } 5 | -------------------------------------------------------------------------------- /docker/logstash/etc/conf.d/metricbeat/100_output.conf: -------------------------------------------------------------------------------- 1 | output { 2 | pipeline { send_to => [metricbeat_esoutput] } 3 | #pipeline { send_to => [heartbeat_sqloutput] } 4 | } 5 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/confirm_email_subject.txt: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_subject.txt' %} 2 | 3 | {% block subject %}E-Mail Bestätigung{% endblock %} 4 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/reset_password_subject.txt: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_subject.txt' %} 2 | 3 | {% block subject %}Passwort zurücksetzen{% endblock %} -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/password_changed_subject.txt: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_subject.txt' %} 2 | 3 | {% block subject %}Ihr Passwort wurde geändert{% endblock %} -------------------------------------------------------------------------------- /docker/web/source/static/external/fonts/S6uyw4BMUTPHjx4wXg.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/fonts/S6uyw4BMUTPHjx4wXg.woff2 -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/username_changed_subject.txt: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_subject.txt' %} 2 | 3 | {% block subject %}Ihr Benutzername wurde geändert{% endblock %} -------------------------------------------------------------------------------- /config/crontab/amadmin.crontab: -------------------------------------------------------------------------------- 1 | MAILTO=box@4sconsult.de 2 | # m h dom mon dow command 3 | 4 | # Check Disk Space Daily 5 | @daily $BASEDIR/$GITDIR/scripts/Automation/diskspacealert.sh 6 | -------------------------------------------------------------------------------- /docker/web/source/static/external/fonts/S6u8w4BMUTPHjxsAXC-q.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/fonts/S6u8w4BMUTPHjxsAXC-q.woff2 -------------------------------------------------------------------------------- /docker/web/source/static/external/fonts/S6uyw4BMUTPHjxAwXjeu.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/fonts/S6uyw4BMUTPHjxAwXjeu.woff2 -------------------------------------------------------------------------------- /docker/web/source/static/faq/SuppressAlarms.mp4: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fd9177e28bb5479f0443575d8b6cdbd635e0ffc6a3401b29913a0702586136fa 3 | size 52070607 4 | -------------------------------------------------------------------------------- /docker/web/tests/validBPF.json: -------------------------------------------------------------------------------- 1 | { 2 | "src_port": 80, 3 | "src_ip": "127.0.0.1", 4 | "dst_ip": "0.0.0.0", 5 | "dst_port": 0, 6 | "proto": "" 7 | } 8 | -------------------------------------------------------------------------------- /config/secrets/secrets.conf: -------------------------------------------------------------------------------- 1 | # IP2LOCATION Token, get yours at https://ip2location.com 2 | IP2TOKEN="GET_ME_FROM_IP2LOCATION.COM" 3 | # The username on the host machine 4 | HOST_USER="amadmin" 5 | -------------------------------------------------------------------------------- /docker/filebeat/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.elastic.co/beats/filebeat:7.9.0 2 | USER root 3 | COPY --chown=root:root etc/* /usr/share/filebeat/ 4 | RUN chmod go-w /usr/share/filebeat/filebeat.yml 5 | -------------------------------------------------------------------------------- /docker/web/source/static/external/fonts/S6u8w4BMUTPHjxsAUi-qJCY.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/fonts/S6u8w4BMUTPHjxsAUi-qJCY.woff2 -------------------------------------------------------------------------------- /docker/web/source/static/external/fonts/S6u9w4BMUTPHh6UVSwaPGR_p.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/fonts/S6u9w4BMUTPHh6UVSwaPGR_p.woff2 -------------------------------------------------------------------------------- /docker/web/source/static/external/fonts/S6u9w4BMUTPHh6UVSwiPGQ.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/fonts/S6u9w4BMUTPHh6UVSwiPGQ.woff2 -------------------------------------------------------------------------------- /docker/web/source/static/external/fonts/S6u_w4BMUTPHjxsI5wq_Gwft.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/fonts/S6u_w4BMUTPHjxsI5wq_Gwft.woff2 -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/icons.eot -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/icons.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/icons.otf -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/icons.ttf -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/icons.woff -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/images/flags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/images/flags.png -------------------------------------------------------------------------------- /config/secrets/smtp.conf: -------------------------------------------------------------------------------- 1 | # MAIL 2 | MAIL_SERVER=smtp.office365.com 3 | MAIL_PORT=587 4 | MAIL_USE_TLS=True 5 | MAIL_USERNAME=box@4sconsult.de 6 | MAIL_PASSWORD=CHANGEME 7 | MAIL_DEFAULT_SENDER=box@4sconsult.de -------------------------------------------------------------------------------- /docker/web/source/static/external/fonts/S6u_w4BMUTPHjxsI5wq_FQft1dw.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/fonts/S6u_w4BMUTPHjxsI5wq_FQft1dw.woff2 -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/icons.woff2 -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/brand-icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/brand-icons.eot -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/brand-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/brand-icons.ttf -------------------------------------------------------------------------------- /docker/web/source/wizard/templates/logstash/drop.jinja2: -------------------------------------------------------------------------------- 1 | if [source][ip] in {{iplist}} 2 | { 3 | drop { } 4 | } 5 | if [destination][ip] in {{iplist}} 6 | { 7 | drop { } 8 | } 9 | -------------------------------------------------------------------------------- /docker/db/sql/ASN.sql: -------------------------------------------------------------------------------- 1 | CREATE table asn (range_start INET,range_end INET, AS_number VARCHAR(10) ,country_code VARCHAR(7),AS_description VARCHAR(250)); 2 | COPY asn FROM '/tmp/ip2asn-combined.tsv' DELIMITER E'\t'; 3 | -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/brand-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/brand-icons.woff -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/brand-icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/brand-icons.woff2 -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/outline-icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/outline-icons.eot -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/outline-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/outline-icons.ttf -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/outline-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/outline-icons.woff -------------------------------------------------------------------------------- /docker/web/source/static/external/themes/default/assets/fonts/outline-icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4sConsult/box4security/HEAD/docker/web/source/static/external/themes/default/assets/fonts/outline-icons.woff2 -------------------------------------------------------------------------------- /docker/openvas/etc/vuln_openvas.ini: -------------------------------------------------------------------------------- 1 | [openvas] 2 | enabled=true 3 | hostname=localhost 4 | port=9392 5 | write_path=/var/lib/logstash/openvas/ 6 | db_path=/var/lib/logstash/openvas/database 7 | verbose=true 8 | username= 9 | password= -------------------------------------------------------------------------------- /docker/logstash/etc/conf.d/openvas/25-openvas-special.conf: -------------------------------------------------------------------------------- 1 | filter { 2 | mutate { 3 | #rename => {"report_date" => "timestamp"} 4 | #rename => {"timestamp" => "timestamp_found"} 5 | #remove_field => ["date", "epoch"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docker/core4s/healthcheck.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | 3 | app = Flask(__name__) 4 | 5 | 6 | @app.route('/') 7 | def hello_world(): 8 | return 'UP' 9 | 10 | 11 | if __name__ == '__main__': 12 | app.run(host='0.0.0.0', port=2981) 13 | -------------------------------------------------------------------------------- /docker/wazuh/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM wazuh/wazuh:3.13.1_7.8.0 2 | COPY config/entrypoint.sh /entrypoint.sh 3 | RUN chmod 755 /entrypoint.sh 4 | HEALTHCHECK --retries=10 CMD curl -k -u ${WAZUH_USER}:${WAZUH_PASS} -XGET https://localhost:55000 && exit 0 || exit 1 5 | -------------------------------------------------------------------------------- /docker/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:latest 2 | RUN apt update && \ 3 | apt install -y curl && \ 4 | rm -rf /var/lib/apt/lists/* && \ 5 | rm /etc/nginx/conf.d/default.conf 6 | 7 | HEALTHCHECK --retries=10 CMD curl -sk -XGET https://localhost 8 | COPY nginx.conf /etc/nginx/conf.d 9 | -------------------------------------------------------------------------------- /docker/openvas/scripts/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Updating OpenVAS Feed ..." 3 | greenbone-scapdata-sync --verbose 4 | greenbone-certdata-sync --verbose 5 | greenbone-nvt-sync --verbose 6 | openvas-feed-update --verbose 7 | openvasmd --update --verbose 8 | openvasmd --rebuild 9 | -------------------------------------------------------------------------------- /scripts/Automation/diskspacealert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CURRENT=$(df /data | grep /data | awk '{ print $5}' | sed 's/%//g') 3 | THRESHOLD=66 4 | 5 | if [ "$CURRENT" -gt "$THRESHOLD" ] ; then 6 | echo -e "BOX4s Festplattenspeicher bei Kunde: $KUNDE \n/data ist mit $CURRENT% belegt." 7 | fi 8 | -------------------------------------------------------------------------------- /docker/dnsmasq/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | 3 | ADD dnsmasq.conf /tmp/dnsmasq.conf 4 | 5 | RUN apk --no-cache add dnsmasq && \ 6 | cp /tmp/dnsmasq.conf /etc/dnsmasq.conf 7 | 8 | EXPOSE 53/tcp 53/udp 9 | 10 | RUN dnsmasq --test 11 | USER dnsmasq 12 | CMD ["dnsmasq", "-k"] 13 | -------------------------------------------------------------------------------- /docker/logstash/etc/conf.d/estransfer/metricbeat_es_transfer.conf: -------------------------------------------------------------------------------- 1 | input { pipeline { address => metricbeat_esoutput } } 2 | output { 3 | elasticsearch { 4 | hosts => [ "elasticsearch:9200" ] 5 | index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}" 6 | }} 7 | -------------------------------------------------------------------------------- /docker/web/source/templates/application/smtp.conf.j2: -------------------------------------------------------------------------------- 1 | # MAIL 2 | MAIL_SERVER={{ smtp['host'] }} 3 | MAIL_PORT={{ smtp['port'] }} 4 | MAIL_USE_TLS={{ smtp['tls'] }} 5 | MAIL_USERNAME={{ smtp['username'] }} 6 | MAIL_PASSWORD={{ smtp['password'] }} 7 | MAIL_DEFAULT_SENDER={{ smtp['senderMail'] }} 8 | -------------------------------------------------------------------------------- /config/etc/logstash/20-preBOX4s.conf: -------------------------------------------------------------------------------- 1 | filter { 2 | if [src_ip] 3 | { 4 | mutate { 5 | copy => { "[src_ip]" => "[source][ip]" } 6 | } 7 | } 8 | if [dest_ip] 9 | { 10 | mutate { 11 | copy => { "[dest_ip]" => "[destination][ip]" } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docker/logstash/etc/conf.d/estransfer/heartbeat_es_transfer.conf: -------------------------------------------------------------------------------- 1 | input { pipeline { address => heartbeat_esoutput } } 2 | output { 3 | elasticsearch { 4 | hosts => [ "elasticsearch:9200" ] 5 | index => "logstash-%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}" 6 | }} 7 | -------------------------------------------------------------------------------- /docker/heartbeat/etc/monitors.d/box4s.yml: -------------------------------------------------------------------------------- 1 | # - type: http 2 | # urls: ["https://box4security:9392"] 3 | # # ssl: 4 | # #certificate_authorities: ['/etc/ca.crt'] 5 | # #supported_protocols: ["TLSv1.0", "TLSv1.1", "TLSv1.2"] 6 | # schedule: '@every 1m' 7 | # id: "Greenbone Security Manager" 8 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/registered_subject.txt: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_subject.txt' %} 2 | 3 | {% block subject %}{% if user_manager.enable_confirm_email and not user.confirmed_at %}Bestätigen Sie Ihre E-Mail-Adresse{% else %}Vielen Dank für Ihre Registrierung{% endif %}{% endblock %} -------------------------------------------------------------------------------- /docker/web/tests/validLSR.json: -------------------------------------------------------------------------------- 1 | { 2 | "src_port": 80, 3 | "src_ip": "127.0.0.1", 4 | "dst_ip": "0.0.0.0", 5 | "dst_port": 0, 6 | "proto": "", 7 | "signature_id":133769, 8 | "signature":"+++ Bayern verhängt Ausgangsbeschränkungen +++" 9 | } 10 | -------------------------------------------------------------------------------- /docker/kibana/entry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #insert wazuh startup 4 | echo -e "hosts:\n - default:\n url: https://${INT_IP}\n port: 55000\n user: ${WAZUH_USER}\n password: ${WAZUH_PASS}\n" > /usr/share/kibana/optimize/wazuh/config/wazuh.yml 5 | #make sure container does not restart 6 | exec "$@" 7 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/base_message.txt: -------------------------------------------------------------------------------- 1 | {% if user.first_name and user.last_name -%} 2 | Sehr geehrte*r {{user.first_name}} {{user.last_name}}, 3 | {% else -%} 4 | Guten Tag, 5 | {% endif %} 6 | {% block message %} 7 | {% endblock %} 8 | 9 | Mit freundlichen Grüßen, 10 | 4sConsult GmbH 11 | -------------------------------------------------------------------------------- /config/secrets/msmtprc: -------------------------------------------------------------------------------- 1 | defaults 2 | tls on 3 | auth on 4 | tls_trust_file /etc/ssl/certs/ca-certificates.crt 5 | aliases /etc/aliases 6 | account box@4sconsult.de 7 | port 587 8 | host smtp.office365.com 9 | from box@4sconsult.de 10 | user box@4sconsult.de 11 | password CHANGEME 12 | account default : box@4sconsult.de 13 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/base_message.html: -------------------------------------------------------------------------------- 1 | {% if user.first_name and user.last_name -%} 2 |
Sehr geehrte*r {{user.first_name}} {{user.last_name}},
3 | {% else -%} 4 |Guten Tag,
5 | {% endif %} 6 |Mit freundlichen Grüßen,
11 | 4sConsult GmbH
Ihr Benutzername wurde geändert.
5 |Wenn Sie die Änderung Ihres Benutzernamens nicht initiiert haben, bitte melden Sie sich an (mit Ihrer E-Mail-Adresse) und ändern Sie Ihr Passwort.
6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/username_changed_message.txt: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_message.txt' %} 2 | 3 | {% block message %} 4 | Ihr Benutzername wurde geändert. 5 | 6 | Wenn Sie die Änderung Ihres Benutzernamens nicht initiiert haben, bitte melden Sie sich an (mit Ihrer E-Mail-Adresse) und ändern Sie Ihr Passwort. 7 | {{ url_for('user.login', _external=True) }} 8 | {% endblock %} 9 | 10 | 11 | -------------------------------------------------------------------------------- /docker/web/source/wizard/templates/logstash/netplan.yaml.jinja2: -------------------------------------------------------------------------------- 1 | network: 2 | version: 2 3 | renderer: networkd 4 | ethernets: 5 | ens160: 6 | addresses: 7 | - {{BOX4s.ip_address}}/{{BOX4s.network.cidr}} 8 | dhcp4: {% if BOX4s.dhcp_enabled %}yes{% else %}no{% endif %} 9 | gateway4: {{BOX4s.gateway.ip_address}} 10 | nameservers: 11 | addresses: [{{BOX4s.dns.ip_address}}] 12 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/password_changed_message.html: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_message.html' %} 2 | 3 | {% block message %} 4 |Ihr Passwort wurde geändert.
5 | {% if user_manager.USER_ENABLE_FORGOT_PASSWORD %} 6 |Falls Sie die Änderung Ihres Passworts nicht initiiert haben, klicken Sie hier um dies zurückzusetzen.
7 | {% endif %} 8 | {% endblock %} -------------------------------------------------------------------------------- /config/etc/etc_files/environment: -------------------------------------------------------------------------------- 1 | BASEDIR=/home/amadmin/ 2 | GITDIR=/box4s/ 3 | KUNDE="NEWSYSTEM" 4 | 5 | PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 6 | BOX4SPATH="$BASEDIR$GITDIR" 7 | PYTHONPATH="/home/amadmin/.local/lib/python2.7/site-packages/" 8 | ES_TMPDIR=/tmp/elasticsearch 9 | 10 | IPADRESS=$(landscape-sysinfo --sysinfo-plugins=Network | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b") 11 | 12 | COMPANY_NAME=$KUNDE 13 | -------------------------------------------------------------------------------- /docker/elasticsearch/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.elastic.co/elasticsearch/elasticsearch:7.9.0 2 | 3 | RUN mkdir -p /var/log/elasticsearch/ && \ 4 | mkdir -p /data && \ 5 | touch /var/log/elasticsearch/gc.log && \ 6 | chown elasticsearch:elasticsearch -R /var/log/elasticsearch/ 7 | COPY --chown=elasticsearch:elasticsearch etc/* /usr/share/elasticsearch/config/ 8 | 9 | HEALTHCHECK --retries=10 CMD curl -s -XGET 'http://127.0.0.1:9200/_cat/health' 10 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/reset_password_message.txt: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_message.txt' %} 2 | 3 | {% block message %} 4 | Wir haben Ihre Anfrage zur Passwortzurücksetzung erhalten. 5 | 6 | Wenn Sie diese Anfrage initiiert haben, dann klicken Sie auf den nachstehenden Link: 7 | {{ reset_password_link }} 8 | 9 | Falls Sie diese Registrierung nicht initiiert haben, können Sie diese E-Mail ignorieren. 10 | 11 | {% endblock %} -------------------------------------------------------------------------------- /config/etc/logstash/BOX4s-special.conf: -------------------------------------------------------------------------------- 1 | filter 2 | { 3 | if [event][subtype] != "stats" { 4 | # dont do this for suricata stats 5 | 6 | mutate { 7 | add_field => { "company" => "${KUNDE}" } 8 | } 9 | 10 | # Drop if no track 11 | # {! PLACEHOLDER DROP !} 12 | 13 | 14 | # Classify assets by subnet 15 | # {! PLACEHOLDER CIDR !} 16 | 17 | # Classify asset by ip to type 18 | # {! PLACEHOLDER IP !} 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /config/etc/logstash/output.conf: -------------------------------------------------------------------------------- 1 | output { 2 | 3 | # if "nmap" in [tags] { 4 | # elasticsearch { 5 | # # Nmap data usually isn't too bad, so monthly rotation should be fine 6 | # index => "logstash-nmap-%{+YYYY.MM}" 7 | # } 8 | #}else { 9 | 10 | elasticsearch { 11 | hosts => [ "elasticsearch:9200" ] 12 | index => "logstash-%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}" 13 | } 14 | #} 15 | } 16 | -------------------------------------------------------------------------------- /docker/openvas/scripts/insertconfig.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CONFIG=/etc/openvas/4s-OpenVAS.xml 3 | LOCK=/data/imported_4sConsult_Config 4 | if [ ! -f "$LOCK" ]; then 5 | python3 -m venv .venv-openvas 6 | source .venv-openvas/bin/activate 7 | pip install python-gvm 8 | python3 /root/config.py 9 | deactivate 10 | echo "OpenVAS Config Full and Fast without Default Account Check and Bruteforce imported." 11 | rm -r .venv-openvas 12 | touch $LOCK 13 | fi 14 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/password_changed_message.txt: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_message.txt' %} 2 | 3 | {% block message %} 4 | Ihr Passwort wurde geändert. 5 | 6 | {% if user_manager.USER_ENABLE_FORGOT_PASSWORD -%} 7 | Falls Sie die Änderung Ihres Passworts nicht initiiert haben, klicken Sie auf den nachstehenden Link um dies zurückzusetzen. 8 | {{ url_for('user.forgot_password', _external=True) }} 9 | {% endif -%} 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/confirm_email_message.txt: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_message.txt' %} 2 | 3 | {% block message %} 4 | Vor der Nutzung der {{ app_name }} muss Ihre E-Mail-Adresse bestätigt werden. 5 | 6 | Wenn Sie diese Bestätigung initiiert haben, dann klicken Sie auf den nachstehenden Link: 7 | {{ confirm_email_link }} 8 | 9 | Falls Sie diese Bestätigung nicht initiiert haben, können Sie diese E-Mail ignorieren. 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /docker/web/source/wizard/templates/logstash/BOX4s-special.conf.jinja2: -------------------------------------------------------------------------------- 1 | filter 2 | { 3 | if [event][subtype] != "stats" { 4 | # dont do this for suricata stats 5 | 6 | mutate { 7 | add_field => { "company" => "${KUNDE}" } 8 | } 9 | 10 | # Drop if no track 11 | {{templateDrop}} 12 | 13 | 14 | # Classify assets by subnet 15 | {{templateNetworks}} 16 | 17 | # Classify asset by ip to type 18 | {{templateSystems}} 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /scripts/Automation/agent-upgrade.py: -------------------------------------------------------------------------------- 1 | import json 2 | import requests 3 | import os 4 | 5 | # TODO: Updatescript for wazuh agents 6 | # https://documentation.wazuh.com/3.12/user-manual/agents/remote-upgrading/upgrading-agent.html 7 | url = "http://wazuh:55000/agents/outdated?pretty" 8 | headers = {'content-type': 'application/json', 'Accept-Charset': 'UTF-8'} 9 | r = requests.get(url, headers=headers, auth=(os.getenv('WAZUH_USER'), os.getenv('WAZUH_PASS'))) 10 | r.json() 11 | -------------------------------------------------------------------------------- /docker/core4s/curator/curator.yml: -------------------------------------------------------------------------------- 1 | client: 2 | hosts: 3 | - elasticsearch 4 | port: 9200 5 | url_prefix: 6 | use_ssl: False 7 | certificate: 8 | client_cert: 9 | client_key: 10 | ssl_no_validate: False 11 | http_auth: 12 | timeout: 30 13 | master_only: False 14 | logging: 15 | loglevel: INFO 16 | logfile: 17 | logformat: default 18 | blacklist: 19 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/invite_user.html: -------------------------------------------------------------------------------- 1 | {% extends 'flask_user/_authorized_base.html' %} 2 | 3 | {% block content %} 4 | {% from "flask_user/_macros.html" import render_field, render_submit_field %} 5 |Wir haben Ihre Anfrage zur Passwortzurücksetzung erhalten.
6 | 7 |Wenn Sie diese Anfrage initiiert haben, dann klicken Sie auf den nachstehenden Link:
8 | Passwort zurücksetzen.
Falls Sie diese Registrierung nicht initiiert haben, können Sie diese E-Mail ignorieren.
11 | 12 | {% endblock %} -------------------------------------------------------------------------------- /docker/web/source/templates/application/msmtprc.j2: -------------------------------------------------------------------------------- 1 | defaults 2 | tls {% if smtp['tls'] or smtp['port'] == 587 %}on{% else %}off{% endif %} 3 | {% if not smtp['tls'] and smtp['port'] == 587 %}tls_starttls on{% endif -%} 4 | auth on 5 | tls_trust_file /etc/ssl/certs/ca-certificates.crt 6 | aliases /etc/aliases 7 | account {{ smtp['senderMail'] }} 8 | port {{ smtp['port'] }} 9 | host {{ smtp['host'] }} 10 | from {{ smtp['senderMail'] }} 11 | user {{ smtp['username'] }} 12 | password {{ smtp['password'] }} 13 | account default : {{ smtp['senderMail'] }} 14 | -------------------------------------------------------------------------------- /config/etc/systemd/box4security.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=box4security 3 | Requires=docker.service 4 | After=docker.service 5 | 6 | [Service] 7 | Restart=always 8 | RestartSec=5 9 | TimeoutSec=infinity 10 | # Pass environmentfile to service 11 | EnvironmentFile=/etc/environment 12 | EnvironmentFile=/etc/box4s/modules.conf 13 | 14 | # Compose Box4Security up 15 | ExecStart=/usr/bin/box4s/box4s_service.sh up 16 | 17 | # Compose Box4Security down 18 | ExecStop=/usr/bin/box4s/box4s_service.sh down 19 | 20 | [Install] 21 | WantedBy=multi-user.target 22 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/confirm_email_message.html: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_message.html' %} 2 | 3 | {% block message %} 4 |Vor der Nutzung der {{ app_name }} muss Ihre E-Mail-Adresse bestätigt werden.
5 | 6 |Wenn Sie diese Bestätigung initiiert haben, dann klicken Sie auf den nachstehenden Link:
7 | E-Mail-Adresse bestätigen.
Falls Sie diese Bestätigung nicht initiiert haben, können Sie diese E-Mail ignorieren.
10 | 11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/emails/invite_user_message.txt: -------------------------------------------------------------------------------- 1 | {% extends 'user/emails/base_message.html' %} 2 | 3 | {% block message %} 4 | Ihnen wurde ein Account für die BOX4security angelegt. 5 | 6 | Verwenden Sie zum Login bitte: 7 | E-Mail: {{ user.email }} 8 | Passwort: {{ user_pass }} 9 | 10 | Bitte beachten Sie, dass es sich bei dem Kennwort um ein automatisch generiertes Kennwort handelt. Sie sollten dieses so schnell wie möglich ändern. 11 | Eine Änderung ist hier möglich: {{ url_for('user.change_password',_external=True) }} 12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /docker/openvas/scripts/config.py: -------------------------------------------------------------------------------- 1 | from gvm.connections import TLSConnection 2 | from gvm.protocols.gmp import Gmp 3 | from gvm.transforms import EtreeTransform 4 | from gvm.xml import pretty_print 5 | import os 6 | 7 | conn = TLSConnection() 8 | transform = EtreeTransform() 9 | 10 | with Gmp(conn, transform=transform) as gmp: 11 | # Login 12 | gmp.authenticate(os.getenv('OPENVAS_USER'), os.getenv('OPENVAS_PASS')) 13 | with open('/etc/openvas/4s-OpenVAS.xml', 'r') as fxml: 14 | xml_string = fxml.read() 15 | gmp.import_config(xml_string) 16 | -------------------------------------------------------------------------------- /docker/wazuh/wazuh.yml: -------------------------------------------------------------------------------- 1 | version: "2.3" 2 | services: 3 | wazuh: 4 | container_name: wazuh 5 | image: 4sconsult/wazuh:0.0.5 6 | build: . 7 | hostname: wazuh-manager 8 | restart: always 9 | ports: 10 | - "1514:1514/udp" 11 | - "1515:1515" 12 | - "514:514/udp" 13 | - "55000:55000" 14 | volumes: 15 | - /var/lib/box4s/wazuh-authd.pass:/wazuh-config-mount/etc/authd.pass 16 | env_file: 17 | - ../../config/secrets/wazuh.conf 18 | - /etc/box4s/modules.conf 19 | -------------------------------------------------------------------------------- /docker/web/source/templates/user/change_username.html: -------------------------------------------------------------------------------- 1 | {% extends 'flask_user/_authorized_base.html' %} 2 | 3 | {% block content %} 4 | {% from "flask_user/_macros.html" import render_field, render_submit_field %} 5 |Vielen Dank für Ihre Registrierung für die {{ app_name }}.
6 | 7 | {% if confirm_email_link -%} 8 |Für die Nutzung ist die Bestätigung Ihrer E-Mail-Adresse notwendig.
9 | 10 |Wenn Sie diese Registrierung initiiert haben, dann klicken Sie auf den nachstehenden Link
11 | E-Mail-Adresse bestätigen.
Falls Sie diese Registrierung nicht initiiert haben, können Sie diese E-Mail ignorieren.
14 | {%- endif %} 15 | 16 | {% endblock %} -------------------------------------------------------------------------------- /docker/core4s/scripts/Automation/score_calculation/res/social_media.query.json: -------------------------------------------------------------------------------- 1 | { 2 | "query": { 3 | "bool": { 4 | "must": [ 5 | { 6 | "term": { 7 | "alert.category.keyword": "Social Media Alerts by 4sConsult" 8 | } 9 | }, 10 | { 11 | "range": { 12 | "@timestamp": { 13 | "gte": "now-1d/d", 14 | "lte": "now" 15 | } 16 | } 17 | } 18 | ] 19 | } 20 | } 21 | } 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /docker/web/migrations/script.py.mako: -------------------------------------------------------------------------------- 1 | """${message} 2 | 3 | Revision ID: ${up_revision} 4 | Revises: ${down_revision | comma,n} 5 | Create Date: ${create_date} 6 | 7 | """ 8 | from alembic import op 9 | import sqlalchemy as sa 10 | ${imports if imports else ""} 11 | 12 | # revision identifiers, used by Alembic. 13 | revision = ${repr(up_revision)} 14 | down_revision = ${repr(down_revision)} 15 | branch_labels = ${repr(branch_labels)} 16 | depends_on = ${repr(depends_on)} 17 | 18 | 19 | def upgrade(): 20 | """Upgrade to migration.""" 21 | ${upgrades if upgrades else "pass"} 22 | 23 | 24 | def downgrade(): 25 | """Downgrade to migration.""" 26 | ${downgrades if downgrades else "pass"} 27 | -------------------------------------------------------------------------------- /docker/web/source/templates/application/alert_spike.yaml.j2: -------------------------------------------------------------------------------- 1 | {% extends ./alert_base.yaml.j2 %} 2 | 3 | # (Required, spike specific) 4 | # The size of the window used to determine average event frequency 5 | # We use two sliding windows each of size timeframe 6 | # To measure the 'reference' rate and the current rate 7 | timeframe: 8 | hours: 2 9 | 10 | # (Required, spike specific) 11 | # The spike rule matches when the current window contains spike_height times more 12 | # events than the reference window 13 | spike_height: 3 14 | 15 | # (Required, spike specific) 16 | # The direction of the spike 17 | # 'up' matches only spikes, 'down' matches only troughs 18 | # 'both' matches both spikes and troughs 19 | spike_type: "up" 20 | 21 | -------------------------------------------------------------------------------- /docker/web/source/wizard/templates/logstash/system.jinja2: -------------------------------------------------------------------------------- 1 | {% for s in systems %} 2 | if [source][ip] == "{{s.ip_address}}" 3 | { 4 | mutate { 5 | add_field => {"[soure][host][name]" => "{{s.name}}" } 6 | {% for t in s.types %} 7 | add_field => {"[soure][host][type]" => "{{t.name}}" } 8 | {% endfor %} 9 | } 10 | } 11 | if [destination][ip] == "{{s.ip_address}}" 12 | { 13 | mutate { 14 | add_field => {"[destination][host][name]" => "{{s.name}}" } 15 | {% for t in s.types %} 16 | add_field => {"[destination][host][type]" => "{{t.name}}" } 17 | {% endfor %} 18 | } 19 | } 20 | {% endfor %} 21 | -------------------------------------------------------------------------------- /docker/suricata/scripts/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Move Own rules to correct folder - Only do if folder not empty 4 | if find /root/var_lib -mindepth 1 | read; then 5 | mv -f /root/var_lib/* /var/lib/suricata/rules 6 | fi 7 | 8 | suricata-update update-sources 9 | suricata-update enable-source et/open 10 | suricata-update enable-source oisf/trafficid 11 | suricata-update enable-source ptresearch/attackdetection 12 | suricata-update enable-source sslbl/ssl-fp-blacklist 13 | suricata-update enable-source etnetera/aggressive 14 | suricata-update enable-source tgreen/hunting 15 | suricata-update 16 | 17 | # If this is not during install, reload the rules 18 | if [ -z "$1" ]; then 19 | suricatasc -c ruleset-reload-nonblocking; 20 | fi 21 | -------------------------------------------------------------------------------- /docker/core4s/scripts/Automation/resourceupdate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Updating ASN 3 | /bin/bash /core4s/scripts/Automation/ASN_update.sh 4 | 5 | # Updating Geo-IP 6 | source /core4s/config/secrets/secrets.conf 7 | cd /tmp/ 8 | curl -sL "https://www.ip2location.com/download/?token=$IP2TOKEN&file=DB5LITEBIN" -o IP2LOCATION-LITE-DB5.BIN.zip 9 | curl -sL "https://www.ip2location.com/download/?token=$IP2TOKEN&file=DB5LITEBINIPV6" -o IP2LOCATION-LITE-DB5.IPV6.BIN.zip 10 | unzip -o IP2LOCATION-LITE-DB5.BIN.zip 11 | mv -f IP2LOCATION-LITE-DB5.BIN /core4s/workfolder/var/lib/box4s/IP2LOCATION-LITE-DB5.BIN 12 | unzip -o IP2LOCATION-LITE-DB5.IPV6.BIN.zip 13 | mv -f IP2LOCATION-LITE-DB5.IPV6.BIN /core4s/workfolder/var/lib/box4s/IP2LOCATION-LITE-DB5.IPV6.BIN 14 | -------------------------------------------------------------------------------- /docker/core4s/scripts/Automation/score_calculation/res/index_settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "settings": { 3 | "number_of_shards": 1 4 | }, 5 | "mappings": { 6 | "properties": { 7 | "score_type": { 8 | "type": "text" 9 | }, 10 | "rules": { 11 | "properties" : { 12 | "text":{ 13 | "type": "keyword" 14 | }, 15 | "weight":{ 16 | "type": "float" 17 | } 18 | } 19 | }, 20 | "value": { 21 | "type": "float" 22 | }, 23 | "timestamp": { 24 | "type": "date", 25 | "format": "epoch_millis" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /docker/web/migrations/versions/d995a93c3a9c_box4s_dhcp_col.py: -------------------------------------------------------------------------------- 1 | """BOX4s: DHCP col 2 | 3 | Revision ID: d995a93c3a9c 4 | Revises: a59fffda1b70 5 | Create Date: 2020-10-30 07:24:16.155013 6 | 7 | """ 8 | from alembic import op 9 | import sqlalchemy as sa 10 | from sqlalchemy.dialects import postgresql 11 | 12 | # revision identifiers, used by Alembic. 13 | revision = 'd995a93c3a9c' 14 | down_revision = 'a59fffda1b70' 15 | branch_labels = None 16 | depends_on = None 17 | 18 | 19 | def upgrade(): 20 | """Upgrade to migration.""" 21 | op.add_column('box4security', sa.Column('dhcp_enabled', sa.Boolean(), nullable=True)) 22 | 23 | 24 | def downgrade(): 25 | """Downgrade to migration.""" 26 | op.drop_column('box4security', 'dhcp_enabled') 27 | -------------------------------------------------------------------------------- /docker/db/sql/uniquevulns.sql: -------------------------------------------------------------------------------- 1 | CREATE SEQUENCE public.uniquevulns_vul_id_seq 2 | INCREMENT 1 3 | START 27275 4 | MINVALUE 1 5 | MAXVALUE 2147483647 6 | CACHE 1; 7 | ALTER SEQUENCE public.uniquevulns_vul_id_seq 8 | OWNER TO postgres; 9 | CREATE TABLE public.uniquevulns 10 | ( 11 | vul_id integer NOT NULL DEFAULT nextval('uniquevulns_vul_id_seq'::regclass), 12 | uniqueidentifier character varying(50) COLLATE pg_catalog."default" NOT NULL, 13 | CONSTRAINT uniquevulns_pkey PRIMARY KEY (vul_id), 14 | CONSTRAINT uniquevulns_uniqueidentifier_key UNIQUE (uniqueidentifier) 15 | 16 | ) 17 | WITH ( 18 | OIDS = FALSE 19 | ) 20 | TABLESPACE pg_default; 21 | 22 | ALTER TABLE public.uniquevulns 23 | OWNER to postgres; 24 | -------------------------------------------------------------------------------- /docker/metricbeat/etc/modules.d/docker.yml: -------------------------------------------------------------------------------- 1 | # Module: docker 2 | # Docs: https://www.elastic.co/guide/en/beats/metricbeat/7.6/metricbeat-module-docker.html 3 | 4 | - module: docker 5 | metricsets: 6 | - container 7 | - cpu 8 | - diskio 9 | - event 10 | - healthcheck 11 | - info 12 | - memory 13 | - network 14 | period: 15s 15 | hosts: ["unix:///var/run/docker.sock"] 16 | 17 | # If set to true, replace dots in labels with `_`. 18 | #labels.dedot: false 19 | 20 | # To connect to Docker over TLS you must specify a client and CA certificate. 21 | #ssl: 22 | #certificate_authority: "/etc/pki/root/ca.pem" 23 | #certificate: "/etc/pki/client/cert.pem" 24 | #key: "/etc/pki/client/cert.key" -------------------------------------------------------------------------------- /docker/web/source/wizard/templates/wizard/verify_progress.html: -------------------------------------------------------------------------------- 1 | {% extends "wizard/base.html" %} 2 | {% block content %} 3 || E-Mail: | 9 |{{ user.email }} | 10 |
| Passwort: | 13 |{{ user_pass }} | 14 |
{%trans%}Change username{%endtrans%}
24 | {% endif %} 25 | {% if user_manager.USER_ENABLE_CHANGE_PASSWORD %} 26 |{%trans%}Change password{%endtrans%}
27 | {% endif %} 28 | {% endif %} 29 | 30 | {% endblock %} -------------------------------------------------------------------------------- /docker/core4s/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | 3 | # Install all programs 4 | RUN apt-get update && apt-get install -y \ 5 | bc\ 6 | python3\ 7 | python3-venv\ 8 | python3-pip\ 9 | curl\ 10 | jq\ 11 | msmtp\ 12 | cron\ 13 | postgresql-client\ 14 | unzip\ 15 | wget 16 | 17 | # Install docker 18 | RUN curl -sSL https://get.docker.com/ | sh 19 | 20 | # Install Pyip dependencies 21 | RUN pip3 install Flask untangle python-gvm 22 | # TODO: REMOVE TEMPORARY FIX: https://github.com/pypa/pip/issues/9108#issuecomment-723198497 23 | RUN pip3 install boto3==1.16.12 urllib3==1.24.3 botocore==1.19.12 24 | RUN pip3 install elasticsearch-curator==5.8.1 25 | 26 | # Add files from git 27 | ADD scripts /core4s/scripts 28 | ADD curator /core4s/curator 29 | ADD core4s.crontab /core4s/core4s.crontab 30 | ADD healthcheck.py /healthcheck.py 31 | ADD exporter.py /core4s/openvas/exporter.py 32 | 33 | # Add Crontab 34 | RUN crontab /core4s/core4s.crontab 35 | 36 | # Create cronchecker directory 37 | RUN mkdir -p /var/log/cronchecker/ 38 | 39 | #Check health 40 | HEALTHCHECK CMD curl --fail http://localhost:2981/ || exit 1 41 | 42 | # Run the command on container startup 43 | CMD cron &&\ 44 | python3 healthcheck.py 45 | -------------------------------------------------------------------------------- /docker/logstash/etc/conf.d/estransfer/suricata_es_transfer.conf: -------------------------------------------------------------------------------- 1 | input { pipeline { address => suricata_esoutput } } 2 | 3 | output { 4 | if [event][type] == "suricata" { 5 | if [event][subtype] == "stats" { 6 | elasticsearch { 7 | id => "output_elasticsearch_stats" 8 | hosts => [ "elasticsearch:9200" ] 9 | index => "suricata_stats-%{+YYYY.MM.dd}" 10 | # template => "${SYNLITE_SURICATA_TEMPLATE_PATH:/etc/logstash/synlite_suricata/templates}/synlite_suricata_stats.template.json" 11 | # template_name => "synlite-suricata_stats-1.1.0" 12 | # template_overwrite => "true" 13 | } } else { 14 | elasticsearch { 15 | id => "output_elasticsearch" 16 | hosts => [ "elasticsearch:9200" ] 17 | index => "suricata-%{+YYYY.MM.dd}" 18 | template => "/etc/logstash/BOX4s/suricata-template.json" 19 | template_name => "suricata-4s" 20 | template_overwrite => "true" 21 | }}}} 22 | -------------------------------------------------------------------------------- /docker/wiki/config.ru: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'rubygems' 3 | require 'gollum/app' 4 | 5 | gollum_path = File.expand_path('/wiki') 6 | wiki_options = {:universal_toc => false, index_page: "BOX4security", page_file_dir: "BOX4security"} 7 | Precious::App.set(:gollum_path, gollum_path) 8 | Precious::App.set(:default_markup, :markdown) 9 | Precious::App.set(:wiki_options, wiki_options) 10 | 11 | require 'rack' 12 | 13 | # set author 14 | class Precious::App 15 | before do 16 | session['gollum.author'] = { 17 | :name => env['HTTP_X_AUTH_USERNAME'], 18 | :email => "box@4sconsult.de", 19 | } 20 | end 21 | end 22 | 23 | class MapGollum 24 | def initialize base_path 25 | @mg = Rack::Builder.new do 26 | map '/' do 27 | run Proc.new { [302, { 'Location' => "/#{base_path}" }, []] } 28 | end 29 | map "/#{base_path}" do 30 | run Precious::App 31 | end 32 | end 33 | end 34 | 35 | def call(env) 36 | @mg.call(env) 37 | end 38 | end 39 | 40 | # Rack::Handler does not work with Ctrl + C. Use Rack::Server instead. 41 | Rack::Server.new(:app => MapGollum.new("wiki"), :Port => 80, :Host => '0.0.0.0').start 42 | 43 | -------------------------------------------------------------------------------- /docker/db/sql/filters.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE blocks_by_bpffilter 2 | ( 3 | id SERIAL primary key, 4 | src_ip inet, 5 | src_port integer, 6 | dst_ip inet, 7 | dst_port integer, 8 | proto varchar(4) 9 | ) 10 | WITH ( 11 | OIDS = FALSE 12 | ) 13 | TABLESPACE pg_default; 14 | ALTER TABLE blocks_by_bpffilter 15 | OWNER to postgres; 16 | INSERT INTO blocks_by_bpffilter (src_ip, src_port, dst_ip, dst_port, proto) VALUES ('127.0.0.1',0,'0.0.0.0',0,''); 17 | INSERT INTO blocks_by_bpffilter (src_ip, src_port, dst_ip, dst_port, proto) VALUES ('0.0.0.0',0,'127.0.0.1',0,''); 18 | CREATE TABLE blocks_by_logstashfilter 19 | ( 20 | id SERIAL primary key, 21 | src_ip inet, 22 | src_port integer, 23 | dst_ip inet, 24 | dst_port integer, 25 | proto varchar(4), 26 | signature_id varchar(10), 27 | signature varchar(256) 28 | ) 29 | WITH ( 30 | OIDS = FALSE 31 | ) 32 | TABLESPACE pg_default; 33 | ALTER TABLE blocks_by_logstashfilter 34 | OWNER to postgres; 35 | -------------------------------------------------------------------------------- /docker/web/source/templates/application/quick_alert_ids.yaml.j2: -------------------------------------------------------------------------------- 1 | name: Critical Intrusion Detection 2 | # (Required) 3 | # Type of alert. 4 | # the frequency rule type alerts when num_events events occur with timeframe time 5 | # The any rule will match everything. Every hit that the query returns will generate an alert. 6 | type: any 7 | 8 | {# realert: 9 | hours: 4 #} 10 | 11 | # take the whole day into account, vulns have the timestamp of the scan 12 | timeframe: 13 | minutes: 1 14 | 15 | # (Required) 16 | # Index to search, wildcard supported 17 | index: suricata-* 18 | 19 | filter: 20 | # Ignore 4s Alerts for now (gid=2) 21 | - query: 22 | query_string: 23 | query: "NOT alert.gid:2" 24 | - range: 25 | alert.severity: 26 | from: 4 27 | to: 5 28 | 29 | {% include "application/alert_email_conf.yaml.j2" %} 30 | {% raw %} 31 | alert_subject: "BOX4s IDS: {0} - {1} <-> {2}" 32 | {% endraw %} 33 | alert_subject_args: 34 | - alert.signature 35 | - source.domain 36 | - destination.domain 37 | alert_text: "{4} ({7}/{5}) \nSource: {0}:{1} <-> Destination: {2}:{3}\n Payload:\n{6}" 38 | alert_text_type: alert_text_only 39 | alert_text_args: ["source.domain", "source.port.number", "destination.domain", "destination.port.name", "alert.signature","log.severity", "payload_printable", "alert.severity"] 40 | -------------------------------------------------------------------------------- /docker/web/migrations/versions/532110801da9_.py: -------------------------------------------------------------------------------- 1 | """empty message 2 | 3 | Revision ID: 532110801da9 4 | Revises: 5 | Create Date: 2020-04-16 14:31:23.045988 6 | 7 | """ 8 | from alembic import op 9 | import sqlalchemy as sa 10 | from sqlalchemy.dialects import postgresql 11 | 12 | # revision identifiers, used by Alembic. 13 | revision = '532110801da9' 14 | down_revision = None 15 | branch_labels = None 16 | depends_on = None 17 | 18 | 19 | def upgrade(): 20 | """Create Users table.""" 21 | op.create_table( 22 | 'user', 23 | sa.Column('id', sa.Integer(), nullable=False), 24 | sa.Column('is_active', sa.Boolean(), server_default='1', nullable=False), 25 | sa.Column('email', sa.String(length=255), nullable=False), 26 | sa.Column('email_confirmed_at', sa.DateTime(), nullable=True), 27 | sa.Column('password', sa.String(length=255), server_default='', nullable=False), 28 | sa.Column('first_name', sa.String(length=100), server_default='', nullable=False), 29 | sa.Column('last_name', sa.String(length=100), server_default='', nullable=False), 30 | sa.PrimaryKeyConstraint('id'), 31 | sa.UniqueConstraint('email'), 32 | ) 33 | 34 | 35 | def downgrade(): 36 | """Drop Users table.""" 37 | op.drop_table('user') 38 | # ### end Alembic commands ### 39 | -------------------------------------------------------------------------------- /scripts/Automation/versions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """Fetches and returns all versions greater than installed one.""" 3 | import requests 4 | import semver 5 | import urllib3 6 | urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) 7 | API_VER = requests.get('http://localhost/api/ver/', verify=False).json() 8 | CURRVER = str(API_VER['version']) 9 | ENV = str(API_VER['env']) 10 | tags = requests.get('http://localhost/api/ver/releases/', verify=False).json() 11 | VERSIONS = [] 12 | # Source: https://stackoverflow.com/questions/11887762/how-do-i-compare-version-numbers-in-python 13 | for t in tags: 14 | # now compare the versions 15 | # discard all lower and equal versions 16 | if semver.compare(CURRVER, str(t['version'])) < 0: 17 | # semver.compare returns -1 if second argument is newer 18 | if not semver.parse(t['version'])['prerelease']: 19 | # Hide prereleases from VERSIONS 20 | VERSIONS.append(t['version']) 21 | 22 | # For development systems: 23 | if ENV == "dev": 24 | # add the latest tag if it is not in VERSIONS yet 25 | # so it is a prerelease actually 26 | latest = tags[0]['version'] 27 | if latest not in VERSIONS: 28 | VERSIONS.insert(0, latest) 29 | 30 | # !! Script Output!! 31 | # All Versions greater than installed one 32 | # Latest Release last 33 | for t in reversed(VERSIONS): 34 | print(t) 35 | -------------------------------------------------------------------------------- /scripts/System_Scripts/wait-for-healthy-container.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | container_name=$1 3 | shift 4 | 5 | RETURN_HEALTHY=0 6 | RETURN_STARTING=1 7 | RETURN_UNHEALTHY=2 8 | RETURN_UNKNOWN=3 9 | RETURN_ERROR=99 10 | 11 | function usage() { 12 | echo " 13 | Usage: wait-for-healthy-container.sh| Status | Actions | |
|---|---|---|
| {{ user_email.email }} | 12 |13 | {% if user_email.email_confirmed_at %} 14 | Confirmed 15 | {% else %} 16 | Confirm Email 17 | {% endif %} 18 | | 19 |20 | {% if user_email.is_primary %} 21 | Primary email 22 | {% else %} 23 | {% if user_email.email_confirmed_at %} 24 | Make primary | 25 | {% endif %} 26 | Delete 27 | {% endif %} 28 | | 29 |
{{ e }}
11 | {% endfor %} 12 | {% endif %} 13 |
32 |
33 |
34 | {%trans%}Forgot your Password?{%endtrans%}
35 |
8 |
9 | Sie sind nicht berechtigt, diese Seite aufzurufen.
11 | {% if current_user and current_user.roles%} 12 |Ihre Berechtigungen:
13 |