GaProgMan / bookApi

An API and UI for a fake book search engine - built entirely in the open, on Twitch
https://twitch.tv/gaprogman
MIT License
2 stars 0 forks source link

[SPIKE] Initial Security Investigation #8

Open GaProgMan opened 3 years ago

GaProgMan commented 3 years ago

Description

Now that a small set of features have been added to the code base, let's take some time to investigate any security holes that we can find, and implement any security best practises we can find.

Ideally, this would have been performed at the initial requirements gathering stage and will be repeated as we continue to develop the application.

High-Level Proposed Solution

Considerations

Any changes made to the API, including adding security headers, will likely cause us issues when we integrate with a UI. As the UI has not yet been built, we shouldn't need to worry about that yet. But, it will be useful to have some way of globally disabling any security features (FOR LOCAL DEVELOPMENT ONLY) in a programmatic way. This will enable us to test whether there is something in the security set up which is stopping the UI from working.

Requirements

GaProgMan commented 3 years ago

Based on reading both:

It is recommended that the following actions are taken for HTTP-based Rest endpoints:

An example of the full set of headers and values is:

content-type: application/jsonl; charset=utf-8
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X--Frame-Options: deny
Cache-Control: no-store
Content-Security-Policy: default-src 'none'; frame-ancestors 'none'; sandbox