mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
Security: Disable Login page, except for Whitelisted IPs #792
Labels
No labels
ai
android
api
auth
awesome
bug
bug
ci
cli
config
database
declined
deprecated
docker
docs 📚
documents
duplicate
easy
enhancement
enhancement
enhancement
epic
faces
feedback wanted
frontend
hacktoberfest
help wanted
idea
in-progress
incomplete
index
invalid
ios
labels
live
live
low-priority
macos
member-feature
metadata
mobile
nas
needs-analysis
no-coding-required
no-coding-required
observability
performance
places
please-test
plus-feature
priority
pro-feature
question
raspberry-pi
raw
released
released
released
research
resolved
security
sharing
tested
tests
third-party-issue
thumbnails
upgrade
upstream-issue
ux
vector
video
waiting
won't fix
won't fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/photoprism#792
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ScuttleSE on GitHub (Feb 14, 2021).
If you, like me, use Photoprism to share albums publically, the ability to disable the login-page would be nice. If nothing else, to dissuade people who stumble upon your website to try to poke holes into it.
I would suggest a setting where an IP or subnet is whitelisted, and all other IPs gets a landing page with no way to login.
@mirisbowring commented on GitHub (Feb 28, 2021):
That would not make much sense.
In Europe for example, you don't have static IPs as an User. The ISP is NATing everything and you cannot grant access to this specific Router (Home of a User).
Probably you want to add htaccess in your webserver / reverse proxy to add HTTP BASIC auth or certificate based authorization for the users.
Alternatively you can setup an Wireguard VPN and invite Users to this VPN - the service will listen on the Wireguard Address instead of the public address. It's available for all Devices.
@ScuttleSE commented on GitHub (Feb 28, 2021):
As a resident "in Europe" I can say with confidence that I get a static IP.
And I can absolutely put up an additional required authentication on my reverse proxy, or set up a VPN, or set up a system with 2FA, some kind of ADFS-solution and a whole host of other American Ninja Warrior-esque hurdles for friends and family to easily view an album, but that is not the point here.
Having the ability to disable the login-page on an internet-facing server where the goal is to fast and easily share albums, with no need for a login to view those albums would be fairly trivial, and if I then need to jump through a few hurdles to get to the admin-page I am ok with that.
A filter based on the X-Forwarded-For header would probably be very trivial to set up. And if you don't want to filter traffic, don't?
@mirisbowring commented on GitHub (Feb 28, 2021):
And what about whitelisting the desired IP-Addresses in the nginx conf of your reverse proxy?
https://docs.nginx.com/nginx/admin-guide/security-controls/controlling-access-proxied-tcp/
@ScuttleSE commented on GitHub (Feb 28, 2021):
That blocks access to the whole site. What I'm talking about is not showing the admin login page except from certain IP-addresses or ranges.
@mirisbowring commented on GitHub (Feb 28, 2021):
Ah, now I understand what you want...
That sounds legit.
@psa commented on GitHub (May 31, 2021):
As a workaround, you could block access to
/loginin your nginx.conf.This should do it:
@lastzero commented on GitHub (May 31, 2021):
Note that brute force attacks are not possible in practice as each login attempt takes more time.
@LeehamElectronics commented on GitHub (Jul 9, 2022):
sadly this can be easily bypassed as PhotoPrism does a server-side redirect to the auth login page when an invalid URL is entered which bypasses NGINX locations.
@lastzero commented on GitHub (Nov 2, 2023):
@LeehamElectronics @ScuttleSE This requires some more thought before we might be able to implement it. In general, it would be possible to hide the login page in the navigation and/or disable the login redirect, however the following questions/concerns remain: