node application to package & configure common security middleware into your application => returns a policy file and boilerplate code
git init
npm install -g spartan-shield
sudo npm install -g spartan-shield
. If necessary, you should still be able to install and run it locally without the global flag_spartan init
creates a policy based upon your answers to a few questions. Use ‘y’ to generate a default policy and boilerplate codeAssuming there are no errors, you will see 3 new files/folders in your local directory:
_spartan throws ‘ENOENT’ (no entity) errors for each of the following conditions
_spartan -D
and get this error, then _spartan can’t find the default policy (packaged with the module); the quickest way to deal with this is to pull the default policy from github by running _spartan -R
which restores the factory default policy
Other potential installation errors
Required programs missing => _spartan won’t be able to generate integrity (hash) values if either shasum or openssl utilities are missing; if you don’t already have them installed, use homebrew or similar to install them or make sure they are correctly linked to /usr/bin
| /usr/local/bin system
directories depending upon your operating system
See the example apps in the example folder