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

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    47
    ·
    25 days 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
      12
      ·
      edit-2
      20 days ago

      I too would like to know more. Jellyfin has been something that I am still hesitating 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
      12
      ·
      25 days 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
          2
          ·
          24 days 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
              2
              ·
              24 days 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.

  • rumba@lemmy.zip
    link
    fedilink
    English
    arrow-up
    15
    arrow-down
    1
    ·
    24 days 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
      10
      ·
      24 days 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
          3
          arrow-down
          1
          ·
          24 days 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

  • Nibodhika@lemmy.world
    link
    fedilink
    English
    arrow-up
    14
    ·
    24 days 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.

  • NeryK@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    10
    ·
    24 days 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.

    • Bazoogle@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      24 days 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

      • NeryK@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        24 days ago

        Yep, that’s why I call that a tradeoff. Far from perfect and yet so much better than nothing.

        Pros:

        • Likely cuts 99.99% of attacks.
        • Nothing to do on client’s end.

        Cons:

        • Whitelisting must be updated everytime the client address changes.
        • Not 100% bulletproof as operators (notably for mobile networks) can NAT multiple connections behind a single publicly addressable IPv4 address.
        • Also IP addresses can be spoofed but I doubt that would be a major concern here.
    • MIDItheKID@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      24 days 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.

  • anon_8675309@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    1
    ·
    24 days 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.

  • Encrypt-Keeper@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    23 days ago

    The biggest problem with that Jellyfin to this day is that you can’t.

    Seems like every new open source selfhosted app implements OIDC compatibility, but for some reason, I can only assume is technical debt, Jellyfin hasn’t.

  • pnelego@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    23 days ago

    To be totally honest I’m not sure you can harden jellyfin enough for public Internet exposure without also breaking basic functionality of the platform.

    This is why everyone is always pushing so hard for a VPN/Tailnet of some kind. The public internet is a bit to much of a wild west to be exposing arbitrary services to it unless you really know what you’re doing.

  • BandDad@lemmy.zip
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    2
    ·
    24 days 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.

  • Seefoo@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    23 days ago

    You can do a reverse proxy + authelia (or other auth service). It’s still more risky than a VPN IMO, buts wayyyy better than some of the other options in this thread

  • AllYourSmurf@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    25 days ago

    I agree with reverse proxy + middleware. I’d also suggest something like Jellyswarm as the front end. That way I can connect to other friends’ servers too.

  • PeriodicallyPedantic@lemmy.ca
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    1
    ·
    23 days ago

    I’m kinda disappointed with this thread, I’m in a similar position to OP, but all the responses are just like “use a reverse proxy and make your URL hard to guess” and other measures which are not very secure. \

    It seems like that’s about as good as you can get at the moment, because the mobile apps barf if you try to add in auth in front of the reverse proxy, but a lot of people seem to be providing this advice like it’s good enough rather than as good as you can get.

  • PieMePlenty@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    23 days ago

    My use cases are:

    • Connect from multiple devices on the same home network (with the application)
    • Connect from a phone device on the internet (with the application)
    • Connect from some PC’s and devices on the internet (with the application and from web browser)

    For home networked devices, I don’t care about security that much. I try to lock it down on the router level and by using VLANs for less secure devices. I connect via IP directly (or .local domain).

    Jellyfin runs under its own user with read access to a media library.

    For devices on the internet, I have jellyfin exposed on a specific url path of my domain - through a reverse proxy all through 443. A bit of security through obscurity here. I’m proxied through cloudflare on the DNS side with very restrictive IP rules.
    I think this is enough for the security flaws jellyfin does have. I’d sleep better at night if it had client certificate support, but Its not a big deal imo. If security flaws allowing remote code execution are found, I’ll shut it down and allow access through wireguard only and lose access from some devices on the internet where I cant use VPNs. Not a bit deal either.

  • azureskypirate@lemmy.zip
    link
    fedilink
    English
    arrow-up
    2
    ·
    24 days ago

    As others have mentioned, a reverse proxy, like nginx or caddy. These are web servers, so you need to configure it or an app that runs in it. May I shill: Nginx Proxy Manager (NPM).