What security features should I consider for my static website?
Asked by
~annual inspection
I recently built a simple static website on GitLab Pages that converts ASCII art. Since I'm planning to share this site with others, I want to ensure it's secure, but I'm not very knowledgeable about web security. My site mainly consists of buttons, labels, and text areas in HTML, while my JavaScript just retrieves the text, modifies the string, and copies it to the clipboard with a maximum character limit. Do I need to implement any additional security measures, like protection against cross-site scripting? I've read about using HTML meta tags like 'nosniff'โis that necessary for a site as simple as mine?
Answers
As long as users canโt create content for other users and thereโs no server-side input processing involved, youโre pretty secure. Just focus on keeping your server secure.
Reply to this answer
Consider getting an SSL certificate. Since youโre not storing any sensitive data, thereโs not much incentive for anyone to try to hack your site.
Reply to this answer
Make sure the permissions for your hosting setup are correct, especially if youโre using a VPS. If anything, that's the only thing to really worry about.
Reply to this answer
For a static site (especially one you donโt host yourself), the risk is minimal. Just avoid having any files in the same root folder that you want to keep private, and donโt hardcode any credentials into those files.
Reply to this answer
Honestly, I think youโre overthinking things for this site. Your attack surface is nearly non-existent right now, and thereโs really not much to gain from being malicious.
~annual inspection: I see, thank you! I thought so, but since I'll be sharing this site with a lot of people, I wanted to make sure it's as safe as possible.
Reply to this answer
Add your answer
Answers are reviewed before publication.
~annual inspection: Okay, thank you very much! I only have my name there, but thatโs just for contact purposes.