denali-js / core

An opinionated, ORM agnostic framework for building robust JSON APIs in Node
http://denalijs.org
Apache License 2.0
73 stars 14 forks source link

Should be consistent with server command (skipAudit) #419

Open seawatts opened 6 years ago

seawatts commented 6 years ago

https://github.com/denali-js/denali/blob/82401b4517b94426c3d723981eafad6356fd39cf/commands/build.ts#L39

knownasilya commented 6 years ago

Audit is no longer a thing in the latest code, although those options are still in the commands. @davewasmer what's the goal here?

davewasmer commented 6 years ago

I'm open to suggestions.

Ideally, I want to make security a "default" thing as much as possible in Denali. The Node Security Project (nsp) is a good resource that catalogs CVE's for Node projects and offers tools to programmatically analyze your package.json for vulnerable packages.

My gut says that this should be baked into Denali core, although I'm open to reasons why an addon might be better.

If it's core, then one question is when to run the check - on every single build? On production builds only? On CI only?

knownasilya commented 6 years ago

What about a denali audit command, which does nsp and maybe other things? Then a ci:test script could run audit and test.

davewasmer commented 6 years ago

Hm, yea, that could work.

Here's a slight tweak, lemme know what you think:

I think this approach is a good blend of security by default, while allowing for escape valves for folks that don't want it, and easy ways to track down problems locally when detected.