Community
Questions Library
Docs
Blog
Events
Swag
Github
Slack
JupiterOne
Discussions
Release Notes
Contact Us
Using the Policy Builder CLI - AskJ1 Community
<main> <article class="userContent"> <p>Policy and procedure documents can be managed in code, checked into a Git repository, such that the Git Pull Request (PR) process can be leveraged for revisions and reviews.</p> <p>JupiterOne provides a command line for this purpose.</p> <h2 data-id="installing-and-building">Installing and Building</h2> <p>Run the following command to install and build the policies for the first time:</p> <pre class="code codeBlock" spellcheck="false" tabindex="0">npm install -g <a href="https://jupiterone.vanillacommunities.com/profile/jupiterone%2Fjupiter-policy-builder" rel="nofollow">@jupiterone/jupiter-policy-builder</a> mkdir my-company-policies cd my-company-policies psp build </pre> <p>You will be prompted for a few input, such as company name, to be included in your policy text.</p> <p>When prompted to save the config to a file, enter <code class="code codeInline code codeInline" spellcheck="false" tabindex="0">config.json</code> (or your custom path). This will allow you to reference the populated configurations the next time you'd like to rebuild the policies and procedures.</p> <p>This will create the following contents in your current directory:</p> <ul><li><code class="code codeInline code codeInline" spellcheck="false" tabindex="0">./templates</code></li> <li><code class="code codeInline code codeInline" spellcheck="false" tabindex="0">./partials</code></li> <li><code class="code codeInline code codeInline" spellcheck="false" tabindex="0">./docs</code></li> </ul><p>For details of these files and their usage, see <a rel="nofollow" href="https://jupiterone.vanillacommunities.com/kb/articles/816-jupiterone-security-policies-format-and-structure">JupiterOne Policies Structure</a>.</p> <h2 data-id="editing-and-rebuilding">Editing and Rebuilding</h2> <p>To edit the policies and procedures, use the template files in <code class="code codeInline code codeInline" spellcheck="false" tabindex="0">./templates</code> and re-run the <code class="code codeInline code codeInline" spellcheck="false" tabindex="0">psp build</code> command. Do <em>not</em> edit the <code class="code codeInline code codeInline" spellcheck="false" tabindex="0">./docs</code> and <code class="code codeInline code codeInline" spellcheck="false" tabindex="0">./partials</code> files directly as they will be overwritten on the next build.</p> <pre class="code codeBlock" spellcheck="false" tabindex="0">psp build -t ./templates -c path/to/your/config.json </pre> <h2 data-id="publishing">Publishing</h2> <p>Run the following command to publish your policies and procedures to your JupiterOne account. You will need to <a rel="nofollow" href="https://jupiterone.vanillacommunities.com/kb/articles/785-creating-user-and-account-api-keys">generate an API key</a> for your user and the user needs to have policies admin permissions.</p> <pre class="code codeBlock" spellcheck="false" tabindex="0">export J1_ACCOUNT=<your_j1_account_id> export J1_API_KEY=<your_user_api_key> psp publish -a $J1_ACCOUNT -k $J1_API_KEY -t ./templates -c ./config.json </pre> <h2 data-id="advanced-options">Advanced Options</h2> <p>For additional details and advanced options, see the README <a rel="nofollow" href="https://github.com/JupiterOne/jupiter-policy-builder">here</a>.</p> </article> </main>