Assuming the user will not be connecting over vpn, but is both remote and non-technical, how would you expose Jellyfin to them securely?

  • quips@slrpnk.net
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 hours ago

    A reverse proxy is what you are looking for. I recommend Caddy.

    You’ll also need a domain, but they can be had for very cheap.

  • anon_8675309@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    4 hours ago

    Another way:

    Expose using caddy. Use basic auth for the web UI only. This exempts the Jellyfin app clients from basic auth that they don’t support but requires it before anyone even gets to the Jellyfin UI. This obfuscates the fact that your endpoint is even a Jellyfin end point.

  • rumba@lemmy.zip
    link
    fedilink
    English
    arrow-up
    14
    arrow-down
    1
    ·
    8 hours ago

    Run the jellyfin in a container that only has read privileges to the videos ( make sure you can’t get out to your whole NAS from there), put that behind a Cloudflaired tunnel.

    It’s not technically secure, but if they can’t get a foothold in your network and the only thing they can access is your video catalog, that’s a reasonable amount of risk.

    • Bazoogle@lemmy.world
      link
      fedilink
      English
      arrow-up
      8
      ·
      4 hours ago

      Gotta be careful with cloudflared and media. They can block you if they detect copyrighted materials, even if it’s your own DVDs. You can setup TLS certs so the traffic is at least encrypted

        • Bazoogle@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          13 minutes ago

          Right. Which is why Cloudflared would block you if it’s detected. But regardless, if for whatever reason, you ended up in court for the content you copied, the judge would probably give you a low fine. Obviously not legal advice, but the US justice system doesn’t have time to care about people making digital copies of DVDs they’ve purchased.

          It’s irrelevant anyway, since none of us are just copying our own DVDs… But for legal reasons /s

  • zaggynl@feddit.nl
    link
    fedilink
    English
    arrow-up
    5
    ·
    9 hours ago

    Ask them to visit https://ipv4.icanhazip.com/ and give you back the number, then whitelist in your webserver, as well as your LAN/VPN range, deny rest. Explain they can only reach jellyfin from their home internet. Repeat if they get 403 forbidden after they get a new WAN IP.

    That or VPN like openziti, wireguard but gets more complicated.

  • BandDad@lemmy.zip
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    12 hours ago

    If anyone has any tips for getting Tailscale running via Docker on my Openmediavault machine, I’m open to it. Everyone lauds it for being dead simple and I cannot for the life of me get it running on the machine it needs to be. Not sure my wife can/will handle anything more complicated.

  • NeryK@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    1
    ·
    13 hours ago

    For a remote and non-technical user I would say IP whitelisting offers a decent tradeoff.

    On your end you expose your jellyfin port to internet, but restrict at the router level to your user’s client IP address as soon as you have it. Obviously in practice this works best if the address does not change often.

    • MIDItheKID@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      42 minutes ago

      Is there a way to this with like a MAC address instead of an IP? Allowing specific devices (my parents have a Firestick that they travel with) would be pretty ideal.

    • Bazoogle@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      4 hours ago

      Also not as ideal if their ISP uses CGNAT. Still waaay better than fully open, but you would be giving access to many households

  • rando@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    8
    ·
    7 hours ago

    headscale + tailscale. U will need a very small vps for headscale though.

  • DecentM@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    5
    ·
    13 hours ago

    Not at all, there’s legal risk if you’re hosting your blurays. Cloudflare even explicitly forbids such use. VPN or nothing imo.

    • Bobby@leminal.space
      link
      fedilink
      English
      arrow-up
      3
      ·
      9 hours ago

      Wow, Cloudflare is against piracy? Every single site I’ve ever seen in my life is registered with Cloudflare and uses their DNS with the exception of PTB I believe.

      • Bazoogle@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        4 hours ago

        They have to be. They have to at least somewhat comply with laws to avoid lawsuits and fines

        • Bobby@leminal.space
          link
          fedilink
          English
          arrow-up
          1
          ·
          4 hours ago

          Oh, ok, “they have to be” in the same way my seedbox says not to download copyright material. Got it.

      • DecentM@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        10
        ·
        9 hours ago

        Not sure about that, I think it’s more just that they don’t want people streaming terabytes of traffic through their edge.

        • Bobby@leminal.space
          link
          fedilink
          English
          arrow-up
          1
          ·
          8 hours ago

          Well, I don’t know. Cloudflare seems to be the standard, again with that one exception, and the only reason PTB has a different situation is because the founders had a connect.

  • kcweller@feddit.nl
    link
    fedilink
    English
    arrow-up
    4
    ·
    13 hours ago

    Set up a reverse proxy with https always on. And get a good (physical) firewall, preferably something akin to opnsense, pfsense, openwrt. Exposing is always a risk, and if you do want it, you have to bear the responsibility for your own security. Keep things up to date, set up monitoring and a good logging system (Wazuh) comes to mind.

    Exposure means a security risk. How you deal with that security risk is your choice.

    Cloudflare and the likes forbid usage of their stuff for these things.

    • syaochan@feddit.it
      link
      fedilink
      English
      arrow-up
      3
      ·
      12 hours ago

      How does a reverse proxy helps for security? I mean, the problem here is that exposing Jellyfin on the internet is dangerous: the only way to improve security via a reverse proxy would be mTLS, but I’m not sure how it would work client side.

      • kcweller@feddit.nl
        link
        fedilink
        English
        arrow-up
        3
        ·
        8 hours ago

        By setting up a reverse proxy you redirect the traffic through that specific proxy which means less open ports (basically just 80/443), less monitoring, the ability to easily put a WAF inbetween, etc.

      • Flatfire@lemmy.ca
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        9 hours ago

        You’ve got a couple benefits. If you have a domain name, and aren’t advertising it publicly, then you can use the reverse proxy to point that domain to a non-standard port that Jellyfin runs on.

        Security through obscurity is not good security, but it does prevent the majority of port scanning attacks. You can also use fail2ban on the reverse proxy side to try and mitigate some attacks.

  • Nibodhika@lemmy.world
    link
    fedilink
    English
    arrow-up
    12
    arrow-down
    1
    ·
    20 hours ago

    Secure is relative, you should be aware that jellyfin itself has security issues https://github.com/jellyfin/jellyfin/issues/5415 most of which are harmless, but at least one is fairly serious and allows people to watch your media without authentication, and adding an extra layer of authentication on the proxy would likely cause issues with clients.

    That being said, if you’re okay with those security issues what I would do is have a cheap VPS, connect both machines to tailscale, and have something like Caddy on the VPS to do the forwarding.

    • FreedomAdvocate
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      3 hours ago

      Isn’t it hilarious that the best solution to do remote streaming using the free software that people use because they don’t want to pay for a Plex subscription or one-off cost is to pay for at least one subscription, maybe more?

      It’s almost like the reason Plex charge money is because it’s not free to do.

    • exu@feditown.com
      link
      fedilink
      English
      arrow-up
      31
      arrow-down
      1
      ·
      19 hours ago

      Just leaving this here

      Now, let’s address this clearly once and for all. What is possible is unauthenticated streaming. Each item in a Jellyfin library has a UUID generated which is based on a checksum of the file path. So, theoretically, if someone knows your exact media paths, they could calculate the item IDs, and then use that ItemID to initiate an unauthenticated stream of the media. As far as we know this has never actually been seen in the wild. This does not affect anything else - all other configuration/management endpoints are behind user authentication. Is this suboptimal? Yes. Is this a massive red-flag security risk that actively exposes your data to the Internet? No.

      https://github.com/jellyfin/jellyfin/issues/5415#issuecomment-2825240290

      • Nibodhika@lemmy.world
        link
        fedilink
        English
        arrow-up
        9
        arrow-down
        2
        ·
        16 hours ago

        Except most people have almost the same structure because of media organizers like radarr/sonarr. At the very least they should hide that behind a setting to not require auth (since the header should be there for most clients) so only people running an old client would be affected. They could also add an extra salt to that hash or something similar.

        I agree, it’s not critical, but it shouldn’t be hand waved either. And like I said, security is relative, I would argue for most people this is fine, but I still think this should be taken more seriously.

        • BakedCatboy@lemmy.ml
          link
          fedilink
          English
          arrow-up
          3
          ·
          14 hours ago

          Yeah not only would a lot of people have the same media name, because of docker mounts, probably a lot of people have the same path to the media inside of the docker container even if the external location is different. I bet you could make a rainbow table of sorts of the most popular movie/TV torrents combined with the most common place in the container for media to be mounted, then use shodan to get a list of hundreds of instances that you could scan for the common hashes.

          I’m just seeing the issue for the first time and noticed it was raised 5 years ago - surely that was enough time to at least put forward a changeover date and give clients time to update.

          • Flatfire@lemmy.ca
            link
            fedilink
            English
            arrow-up
            4
            ·
            9 hours ago

            Jokes on them, my paths are a shitshow and I can’t be bothered to organize them properly

            • BakedCatboy@lemmy.ml
              link
              fedilink
              English
              arrow-up
              2
              ·
              edit-2
              9 hours ago

              Do you not do any renaming? That probably would make it even easier as you can just brute force with a database of filenames scraped from torrents. I already have a proof of concept that generates valid jellyfin IDs from any given file path, it only takes a few more steps before you can plug in a shodan scan of jellyfin instances and just shotgun a bunch of IDs generated from torrents.csv at them and find stuff you can stream without authentication.

              People not bothering to rename, using the default radarr naming scheme, or everyone using the same naming pattern from trash guides just makes it easier.

              Probably the only way to guarantee nobody can probe your media and stream it without authentication is to make sure to rename everything using a format that only you use or mount all your media under a path inside docker that contains a long randomly generated folder prefix.

              • Flatfire@lemmy.ca
                link
                fedilink
                English
                arrow-up
                1
                ·
                8 hours ago

                I was mostly making the comment in jest. I do rename, but my folder structures, as someone who downloads everything manually based on what I want to watch rather than doing the automated *arr stuff leaves it in directories only I consider sensible.

                I have Jellyfin behind a reverse proxy that lives in a DMZ and a WAF to go with it. I’m sure there’s still room for watching an unauthenticated stream because I forgot to rename a folder somewhere, but it’s not exactly an attack vector I care about. I’m more concerned about DDoS or impersonation attacks, which I also attempt to mitigate via an LDAP implementation behind the scenes.

                It’s not perfect, but it’s the best effort I can make at the moment.

                • BakedCatboy@lemmy.ml
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  2 hours ago

                  Yeah that’s fair and I think that’s a good move, my point is just that people are acting like this is not feasible to exploit. I’m at the point in my exploit testing excursion where I have a script that can generate a stream of potential IDs based on real torrent names being parsed and reformatted using radarr’s default naming pattern as well as the commonly used trash guides ones permuted with some common library paths used in the default docker compose examples, and it’s turning up actual ID matches with my jellyfin instance. All I have left to do is make it create API requests to test the IDs against the unauthenticated API instead of checking an exported list and there’s a proof of concept. 5 years is a long time for someone to figure that out.

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    76
    ·
    1 day ago

    At the very minimum stick a reverse proxy in front like caddy, nginx, or Traefik. Then have some middleware like crowdsec to inspect what’s going on. Then whitelist the IP or the country IP block.

    There is much more but those would be the bare minimum.

    • NarrativeBear@lemmy.world
      link
      fedilink
      English
      arrow-up
      19
      ·
      1 day ago

      I too would like to know more. Jellyfin has been something that I am still heditating to expose online without a VPN.

      I have Plex behind a reverse proxy (HAproxy) with Crowdsec and firewall rules all behind Cloudflare. My firewall rules in HAproxy block access a few different ways, like if request are higher then 60 requests a second, or if there is strange path traversal. Used the following guide as a start.

      https://www.archy.net/building-a-native-fail2ban-with-haproxy-stick-tables/

    • BakedCatboy@lemmy.ml
      link
      fedilink
      English
      arrow-up
      14
      ·
      1 day ago

      How do you get apps through something like that? Do you have to open your browser and hit the URL periodically to handle auth there and it just remembers your IP?

        • BakedCatboy@lemmy.ml
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          3 hours ago

          What do you mean viable? The web UI is just an app that is delivered to your browser, it makes more or less the same API requests as an app would make, so IDK why the risk would be lower with an app?

          If an attacker can access the login endpoint for example to brute force or dictionary attack, it doesn’t matter if the web UI is or isn’t accessible if the login endpoint it uses is exposed for an app. The attacker could serve their own copy of the web UI and proxy requests to the API your app connects to. Blocking the html from being served doesn’t make a difference.

            • BakedCatboy@lemmy.ml
              link
              fedilink
              English
              arrow-up
              1
              ·
              2 hours ago

              That’s exactly the point I’m getting at. Putting an auth wall doesn’t work with many apps, and if you add exceptions to the API then you’re not really protecting anything.

              • pushpull@fosstodon.org
                link
                fedilink
                arrow-up
                1
                ·
                edit-2
                1 hour ago

                @BakedCatboy @anon_8675309
                I think that could be fixed with authentication through headers (netbird reverse proxy supports that, no idea about pangolin though) but apps should also support adding custom headers on requests

                • BakedCatboy@lemmy.ml
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  1 hour ago

                  Yes that’s what I would like to advocate for. I did something similar with LunaSea, but often people suggest doing that with Jellyfin and are not aware that almost no apps support it, and that adding exceptions for the API makes you basically as secure as not having it. But people tend to get very defensive when you try to tell them that something won’t work, so I try to phrase it as a question to see if I can get them to understand what the limitations are in a way that’s less confrontational.

      • clb92@feddit.dk
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        13 hours ago

        If there was a Jellyfin app that supported adding a custom header to the server connection, you could set your reverse proxy to just let the connections with that secret key header through, and make everything else go through the extra auth middleware. But as far as I know, none of the Jellyfin apps have that feature, even though it has been requested. Lots of other selfhosted apps do have the feature though, and I use it in a few places as well.

        • BakedCatboy@lemmy.ml
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          13 hours ago

          Gotcha yeah, I did this for LunaSea with traefik forward auth for the arrs, but I the lack of support in jellyfin clients is annoying. Though personally I’ve been waiting 5 years for Findroid to support transcoded streams / adjusting video quality so personally that’s higher on my list of priorities.

        • BakedCatboy@lemmy.ml
          link
          fedilink
          English
          arrow-up
          1
          ·
          14 hours ago

          Gotcha I see, just checking if I missed something since that was the issue last time I tried doing something like that. These days I just yolo it and expose jellyfin to the public Internet.

      • halcyoncmdr@piefed.social
        link
        fedilink
        English
        arrow-up
        7
        arrow-down
        3
        ·
        1 day ago

        You can set pangolin to allow access to an entire resource or just certain paths without the front auth, instead relying on the built in auth.

        Your random plex/emby/jellyfin server isn’t going to be a huge target and the built in auth is good enough for the limited access your media system should have.

        • BakedCatboy@lemmy.ml
          link
          fedilink
          English
          arrow-up
          15
          ·
          22 hours ago

          Wait so if you’re gonna allow access without authentication then why bother putting pangolin in front of jellyfin? Does it help in some other kind of way? I don’t really get how it helps without interfering with apps accessing jellyfin.

  • 8j1obzlb@piefed.social
    link
    fedilink
    English
    arrow-up
    9
    ·
    23 hours ago

    I agree with the folks saying reverse proxy of some kind + WAF. That way end users don’t have to deal with the VPN, but your home system is not directly exposed.

    I’ve been doing something similar with SSH local port forwarding and a $5/month VPS. Haven’t come anywhere close to my network quotas, and performance has not been an issue for home use with 2-5 concurrent users most of the time. I forward the local caddy ports to unprivileged ports/user on the VPS, then use the firewall on the VPS to forward that port to 443 and lock down the rest.

    • FreedomAdvocate
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      3 hours ago

      With a single year of those VPS costs you could have just bought a plex lifetime pass on sale lol

      Avoiding paying a one off fee or subscription by paying a different subscription for a more complex and worse product is amazing.

    • 8j1obzlb@piefed.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      23 hours ago

      That said, VPN would be much more manageable if I was trying to really push performance or scale out the network.