UPDATE YOUR POLICY

Now that you have created your policy, what if you want to make changes? There are 2 ways to update your policy:

  • By modifying security.json directly
  • By running _spartan -u [|--update]

If you chose the second route, _spartan will automatically launch into the interview questions again but, instead of showing the default values, you’ll be presented with what’s currently reflected in security.json

Neither method will trigger boilerplate regeneration. To do this, you should run the ‘force’ command after you’ve completed updating the policy. Note that any changes you made to the boilerplate code will be overwritten during this process.

Beyond this, the policy is treated much the same as any new policy

Though modifying the policy may not change the policy ID, changing other components of the policy will cause the hash value of both security.json and security.js (upon running the –force command) to change

ERRORS

  • (policy/no-policy-found) => if _spartan cannot find the security.json file, it will launch the policy creation process as if the policy didn’t exist. Be sure to run the update command from the same location as security.json or create a new policy using any of the methods described in the ‘create policy’ section