Neuling bei Synology, Frage nach richtigen Schlagworten

  • Ab sofort steht euch hier im Forum die neue Add-on Verwaltung zur Verfügung – eine zentrale Plattform für alles rund um Erweiterungen und Add-ons für den DSM.

    Damit haben wir einen Ort, an dem Lösungen von Nutzern mit der Community geteilt werden können. Über die Team Funktion können Projekte auch gemeinsam gepflegt werden.

    Was die Add-on Verwaltung kann und wie es funktioniert findet Ihr hier

    Hier geht es zu den Add-ons

MichaelLE

Benutzer
Registriert
01. Feb. 2025
Beiträge
4
Reaktionspunkte
0
Punkte
1
Hallo zusammen,

ich bin ein absoluter Synology-Neuling. Mir wurde eine DS920+ zur Verfügung gestellt. Folgende Aufgaben sollen zunächst realisiert werden:

Aufgabe 1: Das Wichtigste ist die Trennung der beiden LAN-Anschlüsse, so dass es niemals zum Datenaustausch zwischen offenem Internet (LAN1) und Firmennetzwerk (LAN2) stattfinden kann

Aufgabe 2: Stündlicher Download von AVI-Dateien von einem FTP-Server im INTERNET. Ablage der Dateien auf NAS.

Aufgabe 3: Verwalteter Benutzerzugang zum Streamen der AVI-Dateien mittels VLC-Player im FIRMENNETZWERK. Verschiedene Benutzer dürfen nur Dateien in bestimmtem Verzeichnis sehen.

Kann mir vielleicht jemand ein paar Schlagworte nennen, mit denen ich für diese Aufgaben recherchieren kann?

Vielen Dank für Eure Hilfe
Michael
 
Externer Dienstleister, wäre mein Schlagwort.
 
1 und 2 schließt sich, wenn man es ganz genau nimmt, logisch aus. Du willst den Datenaustausch mit dem Internet verhindern, möchtest aber aus dem Internet Daten herunterladen. Was du vermutlich meinst, dass ein Zugriff aus dem Internet auf das NAS unterbunden werden soll. Das ist im Normalfall aber der Standard, wenn du nicht zwangsweise eine Portweiterleitung (am Router hantierst) und / oder Quick Connect der Diskstation verwendest.
---
Aufgabe 2: Was sind das für Daten? Kamera-Aufzeichnungen? Wenn ja: Besteht die Möglichkeit direkt auf die Kamera zuzugreifen und möglicherweise die Surveillance Station zu verwenden. Wenn nein: Stichwort Aufgabenplanung und Bash-Skripte... Das Skript müsste potentiell extra auf deine Umgebung angepasst werden. Mit einfacherer Recherche ist es hier nicht getan.
---
Aufgabe 3: Benutzer & Gruppen, Rechtemanagement, Freigegebene Ordner..., SMB, NFS
Könntest du vielleicht mit ein wenig ausprobieren mit verschiedenen Test-Usern hinbekommen. Setzt aber voraus, dass du dich hier erstmal einlesen tust und verstehst wie unter Linux Ordner-Berechtigungen funktionieren.

Summa summarum: Du wirst eine Menge Zeit vertüddeln und vermutlich auch gar nicht alles hinbekommen.. Oder halt mit einem Zeitinvest, welcher zwischen Gut und Böse ist. Ein externer Dienstleister wird wohl hier tatsächlich rein rechnerisch die bessere Lösung darstellen.
 
Welcome to the forum @MichaelLE

Others have already answered regarding task 1.

For task 2:
Are files on the FTP server in folders for specific groups? If they aren't then it's almost impossible to know which shared folder to download them to.
Is it a public FTP server or does it require a password?

This task is complicated. You would need to write a script that:
  1. Gets a list of .avi files and their size from the FTP server.
  2. Compares the name and size to files on the Synology.
  3. If a file on the FTP server does not exist on the Synology, or is a different size, download the file.
  4. Then schedule the script to run every hour.
For task 3 you would:
  1. Create a shared folder for each user group. For example: management, sales, accounts, users
  2. Set the permissions on those shared folders so only users in the desired groups are have read access to those folders.
 
Vielen Dank für Eure Antworten.

Tatsächlich habe ich mir das einfacher vorgestellt. Ich werde erstmal etwas lesen und dann sehen, wie weit ich komme.
 
You didn't answer my question about are files on the FTP server in folders for specific groups?

Assuming the files on the FTP server are in specific folders I've whipped up a python script to download any avi file in those folders.

Note: It does not compare the file size of any existing files. The test FTP server I was using does not return the file sizes.
  • I wrote it to support 2 different user groups. You can delete the 2nd group, or copy and paste more groups.
  • You need to change the variables under the 5 places with "# Change ..." to suit your FTP server and shared folders.
  • Test it and if it works as expected schedule it to run every hour in task scheduler (task planner).
Python:
#!/usr/bin/env python
#--------------------------------------------------------------
#        Written by DaveR aka 007revad aka DaveR007
#
# Download avi files from FTP server and save to shared folder
# Supports multiple user groups with their own shared folder
#--------------------------------------------------------------

import os
from ftplib import FTP

# Change to suit your FTP server
ftp_host = "ftp.scene.org"
ftp_user = "ftp"
ftp_pass = "email@example.com"

def download_files(ftp_host, ftp_user, ftp_pass, ftp_dir="/", download_path="./"):
    try:
        ftp = FTP(ftp_host)
        ftp.login(ftp_user, ftp_pass)
        ftp.cwd(ftp_dir)
       
        files = ftp.nlst()  # Get a list of file names
        file_details = []
       
        for file in files:
            # Check if file is an avi file
            file_name, file_extension = os.path.splitext(file)
            #print(file_extension)  # debug
            if file_extension == ".avi":
                # Check if file already exists
                file_path = download_path + file_name + file_extension
                #print(file_path)  # debug
                if os.path.exists(file_path):
                    file_details.append((file, "exists"))
                else:
                    # Download file
                    try:
                        with open(download_path + file, "wb") as f:
                            ftp.retrbinary(f"RETR {file}", f.write)

                        file_details.append((file, "downloaded"))
                    except Exception as e:
                        print('\a', end ="")
                        print(f"Failed to download {file}: {e}")
       
        ftp.quit()
       
        return file_details
    except Exception as e:
        print('\a', end ="")
        print(f"Error: {e}")
        return []

# Sales
if __name__ == "__main__":
    # Change "/pub/demos/compilations/awards/2003/" to suit your FTP server
    ftp_dir = "/pub/demos/compilations/awards/2003/"  # must have / at end

    # Change "/volume1/sales/" to suit your Synology shared folder
    download_path = "/volume1/sales/"  # must have / at end

    print("Sales:")
    if os.path.exists(download_path):
        files = download_files(ftp_host, ftp_user, ftp_pass, ftp_dir, download_path)
        for name, result in files:
            print(f"{name} {result}")
    else:
        print('\a', end ="")
        print(f"{download_path} not found!")
   
    print("")

# Accounts
if __name__ == "__main__":
    # Change "/pub/demos/compilations/awards/2002/" to suit your FTP server
    ftp_dir = "/pub/demos/compilations/awards/2002/"  # must have / at end

    # Change "/volume1/accounts/" to suit your Synology shared folder
    download_path = "/volume1/accounts/"  # must have / at end
   
    print("Accounts:")
    if os.path.exists(download_path):
        files = download_files(ftp_host, ftp_user, ftp_pass, ftp_dir, download_path)
        for name, result in files:
            print(f"{name} {result}")
    else:
        print('\a', end ="")
        print(f"{download_path} not found!")
   
    print("")
 
Zuletzt bearbeitet:
  • Like
Reaktionen: Benie und Ulfhednir
Der Auftrag liest sich für mich so: Wir wollen Dateien im internen Netz bereitstellen, aber wir wollen das interne Netz nicht zum Internet öffnen. Na, da haben wir doch dieses famose NAS mit 2 Netzwerkports. Den einen stellen wir in eine DMZ (Demilitarisierte Zone, also an sich das offene Internet), und da holen wir uns die Inhalte. Den zweiten stellen wir ins interne Netz, da holen sich die User die Inhalte ab, die auf der DS zwischengespeichert werden.

Erstens ist das nicht trivial, weil der Port in der DMZ innerhalb weniger Minuten angegriffen werden wird. Wenn das nicht super eingerichtet und laufend überwacht wird, ist ein Angreifer irgendwann "drin".

Zweitens kommt da ein Sicherheitsgedanke zum Tragen, der ist sowas von kaputt, schlimmer geht es kaum: Burggraben und Zugbrücke. Allen innerhalb der Burg wird vertraut, alle außerhalb sind böse. Das funktioniert nicht mehr ! Netzwerke werden heute von innen heraus aufgebrochen, davon merken die Wächter an der Zugbrücke überhaupt nichts.

Man sollte versuchen, statt dessen so viel "zero trust" umzusetzen wie möglich. Die Benutzer dürfen der DS nicht vertrauen, und die DS darf den Benutzern nicht vertrauen. Vielmehr handeln sie untereinander ihre Transaktionen so aus, dass sie auch dann sicher ablaufen, wenn einer der Partner bösartig handelt.

Schlussfolgerung: Da müssen Profis ran, mit etwas "Einlesen" ist es nicht getan. Das wurde messerscharf bereits in #2, #3 und #4 festgestellt.
 
Guten Morgen,

und nochmal vielen Dank. Demnach muss ich das nochmals überdenken. Schließlich geht es nur darum, sich den manuellen täglichen Transport von Festplatten und damit viel Zeit zu sparen.
 
Vielen Dank für deine Mühen, DaveR. Tatsächlich liegen die Videodateien in seperaten Verzeichnissen nach folgendem Schema:

Device1 - Date - YYYYMMDD-HHMMSS.avi

Aber leider kann ich das erst einsetzen, wenn ich ein Möglichkeit für die anderen Probleme gefunden habe.

You didn't answer my question about are files on the FTP server in folders for specific groups?

Assuming the files on the FTP server are in specific folders I've whipped up a python script to download any avi file in those folders.

Note: It does not compare the file size of any existing files. The test FTP server I was using does not return the file sizes.
  • I wrote it to support 2 different user groups. You can delete the 2nd group, or copy and paste more groups.
  • You need to change the variables under the 5 places with "# Change ..." to suit your FTP server and shared folders.
  • Test it and if it works as expected schedule it to run every hour in task scheduler (task planner).
Python:
#!/usr/bin/env python
#--------------------------------------------------------------
#        Written by DaveR aka 007revad aka DaveR007
#
# Download avi files from FTP server and save to shared folder
# Supports multiple user groups with their own shared folder
#--------------------------------------------------------------

import os
from ftplib import FTP

# Change to suit your FTP server
ftp_host = "ftp.scene.org"
ftp_user = "ftp"
ftp_pass = "email@example.com"

def download_files(ftp_host, ftp_user, ftp_pass, ftp_dir="/", download_path="./"):
    try:
        ftp = FTP(ftp_host)
        ftp.login(ftp_user, ftp_pass)
        ftp.cwd(ftp_dir)
      
        files = ftp.nlst()  # Get a list of file names
        file_details = []
      
        for file in files:
            # Check if file is an avi file
            file_name, file_extension = os.path.splitext(file)
            #print(file_extension)  # debug
            if file_extension == ".avi":
                # Check if file already exists
                file_path = download_path + file_name + file_extension
                #print(file_path)  # debug
                if os.path.exists(file_path):
                    file_details.append((file, "exists"))
                else:
                    # Download file
                    try:
                        with open(download_path + file, "wb") as f:
                            ftp.retrbinary(f"RETR {file}", f.write)

                        file_details.append((file, "downloaded"))
                    except Exception as e:
                        print('\a', end ="")
                        print(f"Failed to download {file}: {e}")
      
        ftp.quit()
      
        return file_details
    except Exception as e:
        print('\a', end ="")
        print(f"Error: {e}")
        return []

# Sales
if __name__ == "__main__":
    # Change "/pub/demos/compilations/awards/2003/" to suit your FTP server
    ftp_dir = "/pub/demos/compilations/awards/2003/"  # must have / at end

    # Change "/volume1/sales/" to suit your Synology shared folder
    download_path = "/volume1/sales/"  # must have / at end

    print("Sales:")
    if os.path.exists(download_path):
        files = download_files(ftp_host, ftp_user, ftp_pass, ftp_dir, download_path)
        for name, result in files:
            print(f"{name} {result}")
    else:
        print('\a', end ="")
        print(f"{download_path} not found!")
  
    print("")

# Accounts
if __name__ == "__main__":
    # Change "/pub/demos/compilations/awards/2002/" to suit your FTP server
    ftp_dir = "/pub/demos/compilations/awards/2002/"  # must have / at end

    # Change "/volume1/accounts/" to suit your Synology shared folder
    download_path = "/volume1/accounts/"  # must have / at end
  
    print("Accounts:")
    if os.path.exists(download_path):
        files = download_files(ftp_host, ftp_user, ftp_pass, ftp_dir, download_path)
        for name, result in files:
            print(f"{name} {result}")
    else:
        print('\a', end ="")
        print(f"{download_path} not found!")
  
    print("")
 
...
Aufgabe 1: Das Wichtigste ist die Trennung der beiden LAN-Anschlüsse, so dass es niemals zum Datenaustausch zwischen offenem Internet (LAN1) und Firmennetzwerk (LAN2) stattfinden kann
...
Sagst Du bitte, für welche Firma du arbeitest, damit ich mit der nie etwas beruflich anfange, wenn die Ihre IT mit Laien betreiben?
Privat fände ich dein Engagement zwar auch schon mutig oder ambitioniert mit so wenig Kenntnissen aber im beruflich Kontext finde ich es inakzebatel.
 
  • Like
Reaktionen: Kachelkaiser

Additional post fields

 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat