SEPIA-Framework / sepia-docs

Documentation and Wiki for SEPIA. Please post your questions and bug-reports here in the issues section! Thank you :-)
https://sepia-framework.github.io/
237 stars 16 forks source link

HTTP Zugriff verhindern #57

Open Scrounger opened 4 years ago

Scrounger commented 4 years ago

Ich hab sepia erfolgreich auf nem lxc proxmox container (ubuntu 20) installiert und den nginx server mit einem selbstsegnierten zertifikat eingerichtet. Zugriff per https funktioniert wunderbar.

Was ich aber nicht hinbekomme ist, wie ich den Zugriff per http deaktiviere. Hoff ihr könnt mir weiter helfen. Falls logs, conf, etc. benötigt werden kann ich die gerne zur Verfügung stellen.

sepia-assistant commented 4 years ago

Ubuntu 20 ... cool :-D Lxc? Das ist sozusagen Docker light oder?

Hast du auf dem Standard Port 20726 Https UND Http Zugriff? Das dürfte der Nginx eigentlich nicht zulassen, die mitgelieferte config für self-signed SSL (Ziel Ordner: /etc/nginx/sites-enabled/) schaltet allerdings zusätzlich den Port 20727 für Http frei. Auszug:

listen 20726 ssl http2;
listen [::]:20726 ssl http2;
listen 20727;

Ist in dem Ordner vielleicht noch eine zweite config gelandet die den HTTP Port offen hält?

Scrounger commented 4 years ago

Ubuntu 20 ... cool :-D Lxc? Das ist sozusagen Docker light oder?

LXC = Linux Container.

Ich hab in /etc/nginx/sites-enabled/ neben der sepia halt noch die default. Meine Konfig sieht so aus:

##
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
#
# To make this SEPIA config work please replace Sepia.local and 
# /home/sepia/SEPIA with your own values. You can use the setup-nginx.sh.
##

# SEPIA WebSockets
map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

# SEPIA HTTPS (and HTTP on PORT 20727)
server {
    # port to listen to 
    listen 20726 ssl http2;
    listen [::]:20726 ssl http2;
    #listen 20726;
    # domain to listen to 
    server_name sepia.home;

    #root /var/www/html/sepia;
    index index.html index.htm;

    location /sepia/assist/ {
        proxy_pass http://localhost:20721/;
    }
    location /sepia/teach/ {
        proxy_pass http://localhost:20722/;
    }
    location /sepia/chat/ {
        proxy_pass http://localhost:20723/;
    }
    location /sepia/chat/messages/ {
        proxy_pass http://localhost:20723/messages/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_read_timeout 14400;
    }

    # Example of Basic-Auth protection
    # location /elastic/ {
    #   auth_basic              "Elasticsearch Authentication";
    #   auth_basic_user_file    path/to/a/htpasswd;
    #   proxy_pass http://localhost:20724/;
    # }

    ssl_certificate /home/sepia/SEPIA/nginx/self-signed-ssl/sepia-ca-full.pem;
    ssl_certificate_key /home/sepia/SEPIA/nginx/self-signed-ssl/sepia.key.pem;
    ssl_trusted_certificate /home/sepia/SEPIA/nginx/self-signed-ssl/sepia.crt;

    ssl_session_timeout 5m;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #SSLv3 (POODLE vulnerability)
    ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
    ssl_prefer_server_ciphers on;
}

Und ich kann http://10.25.1.18:20721/app/index.html nach wie vor erreichen.

Hoerli1337 commented 3 years ago

Du bist schon einmal eins Schritt weiter als ich. Bei mir läuft die Installation von nginx durch, die Zertifikate können erstellt werden und nginx wird gestartet. Aber überall kommt nur 404.

Habe das ganze auf Linux Mint 4 Debian Edition zum laufen gebracht. :)

(Weitere Probleme wären, das openHAB nicht korrekt genutzt werden kann und die Android-App beim drücken des Sprachbuttons abstürzt)

Scrounger commented 3 years ago

Zur Info den http Zugriff kann man mittels firewall sperren.