Giter Site home page Giter Site logo

Discussion: How would you recommend configuring Helmet for a RESTful JSON API (sessionless) secured by oAuth bearer tokens? about helmet HOT 5 CLOSED

helmetjs avatar helmetjs commented on May 3, 2024
Discussion: How would you recommend configuring Helmet for a RESTful JSON API (sessionless) secured by oAuth bearer tokens?

from helmet.

Comments (5)

EvanHahn avatar EvanHahn commented on May 3, 2024 1

In short, Helmet doesn't hurt, but not all of it is helpful.

Let's say you're building an API that serves JSON and nothing but JSON. No HTML at all. Many of Helmet's middleware won't help you in that case: csp, xframe, iexss, ienoopen, are contentTypeOptions are pretty much useless, because they prevent against attacks that would show up if I were browsing your site directly.

Some of the others might be useful, though:

  1. hsts might keep clients using HTTPS instead of HTTP, which is more secure.
  2. cacheControl is probably useful when building an API anyway; it prevents people from caching old garbage, although your clients probably won't do much of that to begin with.
  3. crossdomain would serve a restrictive crossdomain.xml, which effectively prevents Flash (and others) from loading content from your API. This might be helpful for security, although not huge either.
  4. hidePoweredBy is probably the most useful, because it'd prevent a hacker from exploiting bugs in Express.

If you're concerned about bandwidth/CPU cost of these extra HTTP headers, then skip Helmet. But it probably doesn't hurt!

from helmet.

evilpacket avatar evilpacket commented on May 3, 2024

The headers helmet helps implement are certainly recommended for any web
application. Some of the headers may not be applicable for api
endpoints, depending on what you are building.

jlchereau wrote:

I am endeavouring to put together a comprehensive CRUD prototype which
you can find at https://github.com/jlchereau/Phonegap.Express.

I am not a security expert but I have been recommended to add helmet
to the stack.


Reply to this email directly or view it on GitHub
#43.

from helmet.

jlchereau avatar jlchereau commented on May 3, 2024

Many Thanks.

from helmet.

EvanHahn avatar EvanHahn commented on May 3, 2024

Alright if I close this and move the discussion to #19?

from helmet.

jlchereau avatar jlchereau commented on May 3, 2024

Sure.

from helmet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.