Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Incubator Q&A

Welcome to the staging ground for new communities! Each proposal has a description in the "Descriptions" category and a body of questions and answers in "Incubator Q&A". You can ask questions (and get answers, we hope!) right away, and start new proposals.

Are you here to participate in a specific proposal? Click on the proposal tag (with the dark outline) to see only posts about that proposal and not all of the others that are in progress. Tags are at the bottom of each post.

Comments on What security best practices are applicable to any public website?

Post

What security best practices are applicable to any public website? Question

+2
−0

Let's say I want to host a public website, for use by anyone on the internet. I am deliberately leaving the exact nature of the website vague, because I want to ask for general things that are applicable to any person serving HTML over the public internet.

What security best practices should be followed by anyone hosting such a website? Note that I'm asking for general things. So, for example, "hash the passwords of your users in the DB" should not be part of the answer because not all sites have user accounts. But "disable obsolete HTTPS cyphers" can be part of an answer; even though not all sites are HTTP, the majority these days are, and there is rarely a reason to support known-vulnerable cyphers.

To make things more specific:

  • The website serves HTML. The HTML is likely contain JS and CSS. Some files may be served, such as JPG, PNG, GIF, TXT, PDF, video or audio - but always as direct links and never with a file browser.
  • You can assume no REST API, websocket or other non-web technology is used. You can also disregard any databases.
  • The HTML may be static, or it may be generated dynamically server-side with eg. WSGI.
  • The site is accessible by the public internet.
  • Anyone can browse the site. There can be no restriction on users (such as requiring visitors to be on a VPN).
  • The host machine is fully dedicated to the website, there are no other services that share it, and no data on the server that is unrelated to host the website.
  • You can assume that https://caddyserver.com/ acts as a reverse proxy in front of the server, and introduces TLS.
  • You can assume the website uses HTTPS.
  • The web admin is individual who is maintaining it in his free time, not a full-time team of professional sysadmins at a large company.
History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Very broad, an entire book could be written on this subject (3 comments)
Very broad, an entire book could be written on this subject
Stephen Ostermiller‭ wrote over 1 year ago · edited over 1 year ago

I don't think this question can be adequately answered here. You need to consider cross site scripting (XSS), SQL injection, server security, and server updates, password complexity, password uniqueness, database encryption, domain registrar account two factor authentication, and web app functionality, just to name a few. Many of those could have a book to itself.

Stephen Ostermiller‭ wrote over 1 year ago

Would it be possible to edit this question to narrow its scope to some particular security concern? What is the attack vector that you are worried about in particular in this case? What are you trying to protect? Against defacement? Personally identifiable information (PII) of your users? The domain name getting stolen? Negative SEO?

matthewsnyder‭ wrote over 1 year ago · edited over 1 year ago

I'd love to narrow it down, but many things you bring up are already out of scope. For example, in my question I said

So, for example, "hash the passwords of your users in the DB" should not be part of the answer because not all sites have user accounts.

Thus, SQL injection, passwords, database encryption and web app functionality are out of scope already.

My concern is preventing unauthorized use of the server used to host the website. So the domain name being stolen and negative SEO are out of scope. PII is also out of scope because the question doesn't say that PII would be stored on the site.

I thought that this was already pretty clear, but I guess it's not. How do I make it clearer, though?