问题原文
原帖链接 · Martin · CC BY-SA 4.0
What are the options to share unfinished web-page with a customer without allowing third-party to see the work in progress when developer has control over the web-server? I could come up with following:
- Configure web-server to listen on some random port. For example, this means that web-site is accessible from
http://www.example.com:48080. However, one is able to detect the web server easily with port scan and access the web-site. - Make the content available only if it is prefixed with a unique string. However, this does not protect against fuzzers. Example using Apache
mod_rewrite:
# Web-page is available from https://example.com/5d15d58b294ee/index.html
# while https://example.com/index.html sends HTTP status code 403(forbidden).
# Probably easier approach would be to move all the web-page files to directory named 5d15d58b294ee.
RewriteRule "^/5d15d58b294ee/(.*)" "/$1" [L]
RewriteRule "^/.*" - [F,L]
- Use authentication. For example, Apache basic authentication.
Out of those three options, the third one seems to be the most secure. However, the second one is probably more convenient and maybe usually secure enough.
已采纳解答
原帖链接 · Maximillian Laumeister · CC BY-SA 4.0
Here are some answers, in order:
There exist only 65,535 ports, so this is a very small space to hide in, relatively speaking. Someone could enumerate your ports without much effort, so this solution is a no-go.
Using a key as part of the URL is a much better idea. There exist more than 200 trillion 13-character alphanumeric strings, so the probability of someone guessing it with a fuzzer is essentially zero. The only concern is that since the key is part of the URL, the key will become part of the user's browsing history and the history of any caching proxies (or maybe even a search engine if the URL gets leaked). This is probably not any security issue, but something to keep in mind.
This is the best idea if it's convenient enough.
So (3) is technically the most secure, but if you're just sharing a client site and not incredibly sensitive data, (2) should be more than good enough. If I were to go with (2), I would also serve up the X-Robots-Tag: noindex header to give it a better chance of not being picked up by search engines if the URL leaks, but that might be overkill.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
