0.2.1 • Published 2 years ago
@theprelude/prelude v0.2.1
The Prelude
Use this library to run continuous security tests on all your endpoints.
This library supplies access to the Prelude API. You must have a valid Prelude account to use it.
It works like this:
- Deploy agents around your network
- Upload TTPs to your Outpost server
- Activate the TTPs you want running continuously
Usage guide
Installation
Install the prelude library via:
npm install @theprelude/prelude
Import the prelude library via:
let prelude = require('@theprelude/prelude')
Authentication
You must have a valid Prelude account to run the client library. You'll need the following information to use the client library:
- your account id
- your account token
- your outpost key
Sample Usage
See client_library_test.js for a more detailed quickstart sample.
const Prelude = require('./index.js')
let account = prelude.detect('ACCOUNT_ID', 'ACCOUNT_TOKEN', 'ACCOUNT_KEY');
// Update an account property.
account.updateAccount('outpost_address', 'http://localhost:9753');
// Register a new endpoint.
account.registerEndpoint('host/2').then(token => {
console.log(token);
});
// Print all TTPs in your outpost.
account.getTTP().then(procedures => {
console.log(procedures);
})
// Upload a new TTP.
account.uploadTTP('/tmp/932E8EB2-576B-46E2-8F8A-01CCED72D70C.yml');
// Activate the TTP to run continuously on your endpoints.
account.activateTTP('932E8EB2-576B-46E2-8F8A-01CCED72D70C');
/******************* Once you're done testing *******************/
// Deactivate the TTP.
account.deactivateTTP('932E8EB2-576B-46E2-8F8A-01CCED72D70C');
Prelude publishes new TTPs every week. If you have a professional license, you can use this library to interact with them:
let account = prelude.professional('ACCOUNT_ID', 'ACCOUNT_TOKEN');
// Get a single TTP
account.getTTP('43b3754c-def4-4699-a673-1d85648fda6a');
// Get all TTPs
account.getTTP();
Developer guide
Publish a new version on npmjs.com.
npm publish --access=public