$ npm install nimbusec
## Usage Example
var nimbusecAPI = require('nimbusec');
var api = new nimbusecAPI('NIMBUSEC-KEY', 'NIMBUSEC-SECRET');
api.findDomains(null, function(err, domains) {
if (err) {
console.log('An error occured : ');
console.log(' - code : '+ err.statusCode);
console.log(' - message : '+ err.message);
process.exit(1);
}
console.log('My domains are :');
for (var i = 0; i < domains.length; i++) {
console.log(' - ' + domains[i].name);
}
});
$ grunt doc
$ grunt shell:generateReadme
$ grunt eslint
- Implement /v2/user/* part of the API
- Implement /v2/domain//screenshot/* part of the API when available
Kind: global class
Access: public
- NimbusecAPI
- new NimbusecAPI(key, secret, [options])
- instance
- .findBundles(filter, callback)
- .findDomains(filter, callback)
- .createDomain(domain, callback)
- .updateDomain(domain, domainID, callback)
- .deleteDomain(domainID, callback)
- .findAgentToken(filter, callback)
- .createAgentToken(agentToken, callback)
- .deleteAgentToken(agentToken, callback)
- .findInfectedDomains(filter, callback)
- .findDomainResults(domainID, filter, callback)
- .updateDomainResult(domainID, resultID, result, callback)
- .getDomainMetadata(domainID, callback)
- ._parseResponse(err, data, response, callback) ℗
- ._get(uri, filter, callback) ℗
- ._delete(uri, callback) ℗
- ._post(uri, obj, callback) ℗
- ._put(uri, obj, callback) ℗
- inner
- ~findBundlesCallback :
function
- ~findDomainsCallback :
function
- ~createDomainCallback :
function
- ~updateDomainCallback :
function
- ~deleteDomainCallback :
function
- ~findAgentTokenCallback :
function
- ~createAgentTokenCallback :
function
- ~deleteAgentTokenCallback :
function
- ~findInfectedDomainsCallback :
function
- ~findDomainResultsCallback :
function
- ~updateDomainResultCallback :
function
- ~getDomainMetadataCallback :
function
- ~Domain :
object
- ~DomainMetadata :
object
- ~Result :
object
- ~Package :
object
- ~Agent :
object
- ~AgentToken :
object
- ~User :
object
- ~Notification :
object
- ~CMS :
object
- ~Error :
object
- ~findBundlesCallback :
Construct a new NimbusecAPI object.
Param | Type | Description |
---|---|---|
key | string |
nimbusec API key |
secret | string |
nimbusec API secret |
[options] | Object |
|
options.baseURL | string |
Nimbusec base URL |
Read all existing bundles depending on an optional filter.
Kind: instance method of NimbusecAPI
Access: public
Param | Type | Description |
---|---|---|
filter | string |
optional filter |
callback | findBundlesCallback |
Read all existing domains depending on an optional filter.
Kind: instance method of NimbusecAPI
Access: public
Param | Type | Description |
---|---|---|
filter | string |
optional filter |
callback | findDomainsCallback |
Create a domain from the given object.
Kind: instance method of NimbusecAPI
Access: public
Param | Type | Description |
---|---|---|
domain | Domain |
domain to be created. id will be ignored. |
callback | createDomainCallback |
Update an existing domain by the given object. To modify only certain fields of the domain you can include just these fields inside of the domain object you pass. The destination path for the request is determined by the ID.
Kind: instance method of NimbusecAPI
Access: public
Param | Type | Description |
---|---|---|
domain | Domain |
the domain object with the fields to be updated |
domainID | integer |
the domain's assigned ID (must be valid) |
callback | updateDomainCallback |
Delete a specific domain. The destination path for the request is determined by the ID.
Kind: instance method of NimbusecAPI
Access: public
Param | Type | Description |
---|---|---|
domainID | integer |
the domain's assigned ID (must be valid) |
callback | deleteDomainCallback |
Read all existing tokens depending on an optional filter.
Kind: instance method of NimbusecAPI
Access: public
Param | Type | Description |
---|---|---|
filter | string |
optional filter |
callback | findAgentTokenCallback |
Create an server agent token from the given object. In the following step this token can be used to run the server agent.
Kind: instance method of NimbusecAPI
Access: public
Param | Type | Description |
---|---|---|
agentToken | AgentToken |
token to be created |
callback | createAgentTokenCallback |
Delete a specific agent token. The destination path for the request is determined by the ID.
Kind: instance method of NimbusecAPI
Access: public
Param | Type | Description |
---|---|---|
agentToken | AgentToken |
token to be created |
callback | createAgentTokenCallback |
Read list of infected domains depending on an optional filter.
Kind: instance method of NimbusecAPI
Access: public
Param | Type | Description |
---|---|---|
filter | string |
optional filter |
callback | findInfectedDomainsCallback |
Read list of results of a domain depending on an optional filter.
Kind: instance method of NimbusecAPI
Access: public
Param | Type | Description |
---|---|---|
domainID | integer |
|
filter | string |
optional filter |
callback | findDomainResultsCallback |
Update an existing DomainResult by the given object. Only status can be modified to acknowledge a specific result. The destination path for the request is determined by the ID.
Kind: instance method of NimbusecAPI
Access: public
Param | Type | Description |
---|---|---|
domainID | integer |
|
resultID | integer |
the result assigned ID (must be valid) |
result | Result |
the result object. Only the status field will be modified. |
callback | updateDomainResultCallback |
Retrieve domain metadata. The destination path for the request is determined by the ID.
Kind: instance method of NimbusecAPI
Access: public
Param | Type |
---|---|
domainID | integer |
callback | getDomainMetadataCallback |
Parse the HTTP response. Will get the error message in x-nimbusec-error header if present. Will parse JSON into JavaScript Object if present.
Kind: instance method of NimbusecAPI
Access: private
Param | Type | Description |
---|---|---|
err | Object |
oauth requester error object |
data | string |
body of the HTTP response |
response | Object |
oauth requester response object |
callback | NimbusecAPI~apiCallCallback |
callback called at end of parsing |
Execute a HTTP GET request on the API server.
Kind: instance method of NimbusecAPI
Access: private
Param | Type | Description |
---|---|---|
uri | string |
URI of the resource |
filter | string |
optional filter |
callback | string |
callback function |
Execute a HTTP DELETE request on the API server.
Kind: instance method of NimbusecAPI
Access: private
Param | Type | Description |
---|---|---|
uri | string |
URI of the resource |
callback | string |
callback function |
Execute a HTTP POST request on the API server.
Kind: instance method of NimbusecAPI
Access: private
Param | Type | Description |
---|---|---|
uri | string |
URI of the resource |
obj | Object |
Object to be posted |
callback | string |
callback function |
Execute a HTTP PUT request on the API server.
Kind: instance method of NimbusecAPI
Access: private
Param | Type | Description |
---|---|---|
uri | string |
URI of the resource |
obj | Object |
Object to be put |
callback | string |
callback function |
Kind: inner typedef of NimbusecAPI
Param | Type | Description |
---|---|---|
error | Error |
|
packages | Array.<Package> |
array of selected packages objects |
Kind: inner typedef of NimbusecAPI
Param | Type | Description |
---|---|---|
error | Error |
|
domains | Array.<Domain> |
array of selected domain objects |
Kind: inner typedef of NimbusecAPI
Param | Type | Description |
---|---|---|
error | Error |
|
domain | Domain |
the created domain object |
Kind: inner typedef of NimbusecAPI
Param | Type | Description |
---|---|---|
error | Error |
|
domain | Domain |
the created domain object |
Kind: inner typedef of NimbusecAPI
Param | Type |
---|---|
error | Error |
Kind: inner typedef of NimbusecAPI
Param | Type | Description |
---|---|---|
error | Error |
|
agentToken | AgentToken |
array of selected agent token objects |
Kind: inner typedef of NimbusecAPI
Param | Type | Description |
---|---|---|
error | Error |
|
agentToken | AgentToken |
the created agent token object |
Kind: inner typedef of NimbusecAPI
Param | Type |
---|---|
error | Error |
Kind: inner typedef of NimbusecAPI
Param | Type | Description |
---|---|---|
error | Error |
|
domains | Array.<Domain> |
array of selected domains |
Kind: inner typedef of NimbusecAPI
Param | Type | Description |
---|---|---|
error | Error |
|
results | Array.<Result> |
array of selected results |
Kind: inner typedef of NimbusecAPI
Param | Type | Description |
---|---|---|
error | Error |
|
domain | Domain |
the domain object |
Kind: inner typedef of NimbusecAPI
Param | Type | Description |
---|---|---|
error | Error |
|
domainMetadata | DomainMetadata |
the metadata object |
Kind: inner typedef of NimbusecAPI
Properties
Name | Type | Description |
---|---|---|
id | integer |
unique identification of domain |
bundle | string |
id of assigned package |
scheme | string |
whether the domain uses http or https |
name | string |
name of domain (usually DNS name) |
deepScan | string |
starting point for the domain deep scan |
fastScans | Array.<string> |
landing pages of the domain scanned |
Kind: inner typedef of NimbusecAPI
Properties
Name | Type | Description |
---|---|---|
lastDeepScan | date |
timestamp (in ms) of last external scan of the whole site |
nextDeepScan | date |
timestamp (in ms) for next external scan of the whole site |
lastFastScan | date |
timestamp (in ms) of last external scan of the landing pages |
nextFastScan | date |
timestamp (in ms) for next external scan of the landing pages |
agent | date |
last date server agent sent results to the domain |
cms | string |
detected CMS vendor and version |
httpd | string |
detected HTTP server vendor and version |
php | string |
detected PHP version |
files | integer |
number of downloaded files/URLs for last deep scan |
size | integer |
size of downloaded files for last deep scan (in byte) |
Kind: inner typedef of NimbusecAPI
Properties
Name | Type | Description |
---|---|---|
id | integer |
unique identification of a result |
status | string |
status of the result (1 = pending, 2 = acknowledged, 3 = falsepositive, 4 = removed) |
event | string |
event type of result, possible values are :
|
category | string |
category of result, possible values are :
|
severity | integer |
severity level of result (1 = medium to 3 = severe) |
probability | float |
probability the result is critical |
safeToDelete | boolean |
flag indicating if the file can be safely deleted without loosing user data |
createDate | date |
timestamp (in ms) of the first occurrence |
lastDate | date |
timestamp (in ms) of the last occurrence the following fields contain more details about the result. Not all fields must be filled or present. |
threatname | string |
name identifying the threat of a result. meaning differs per category :
|
resource | string |
affected resource (e.g. file path or URL) |
md5 | string |
MD5 hash sum of the affected file |
filesize | integer |
filesize of the affected file |
owner | string |
file owner of the affected file |
group | string |
file group of the affected file |
permission | integer |
permission of the affected file as decimal integer |
diff | string |
diff of a content change between two scans |
reason | string |
reason why a domain/URL is blacklisted |
Kind: inner typedef of NimbusecAPI
Properties
Name | Type | Description |
---|---|---|
id | string |
unique identification of a bundle |
name | string |
given name for a bundle |
startDate | date |
timestamp in milliseconds when bundle was added / set active |
endDatet | date |
timestamp in milliseconds when bundle will expire |
quota | string |
maximum size of files that will be downloaded per scan |
depth | integer |
maximum link depth that will be followed (-1 means no limit) |
fast | integer |
interval of fast scans in minutes (-1 means disabled) |
deep | integer |
interval of deep scans in minutes (-1 means disabled) |
contingent | integer |
maximum number of domains that can be assigned |
active | integer |
number of currently assigned domain |
engines | Array.<string> |
list of used anti-virus engines |
Kind: inner typedef of NimbusecAPI
Properties
Name | Type | Description |
---|---|---|
os | string |
operating system of agent (windows, macosx, linux) |
arch | string |
cpu architecture of agent (32bit, 64bit) |
version | int |
version of agent |
md5 | string |
MD5 hash of download file |
sha1 | string |
SHA1 hash of download file |
format | string |
format of downloaded file (zip) |
url | string |
URL were agent can be downloaded from |
Kind: inner typedef of NimbusecAPI
Properties
Name | Type | Description |
---|---|---|
id | integer |
unique identification of a token |
name | string |
given name for a token |
key | string |
oauth key |
secret | string |
oauth secret |
lastCall | date |
last timestamp (in ms) an agent used the token |
version | integer |
last agent version that was seen for this key |
Kind: inner typedef of NimbusecAPI
Properties
Name | Type | Description |
---|---|---|
id | integer |
unique identification of a user |
login | string |
login name of user |
string |
e-mail contact where mail notificatins are sent to | |
role | string |
role of an user (administrator or user ) |
company | string |
company name of user |
surname | string |
surname of user |
forename | string |
surname of user |
title | string |
academic title of user |
mobile | string |
phone contact where sms notificatins are sent to |
password | string |
password of user (only used when creating or updating a user) |
signatureKey | string |
secret for SSO (only used when creating or updating a user) |
Kind: inner typedef of NimbusecAPI
Properties
Name | Type | Description |
---|---|---|
id | integer |
unique identification of a notification |
domain | integer |
id of a domain |
transport | string |
type of contact (mail, sms) |
serverside | integer |
level for server side notifications (see result severity, >3 = disabled) |
content | integer |
level for content notifications (see result severity, >3 = disabled) |
blacklist | integer |
level for blacklist notifications (see result severity, >3 = disabled) |
Kind: inner typedef of NimbusecAPI
Properties
Name | Type |
---|---|
CpeId | string |
LatestStable | string |
Path | string |
Error object passed in first argument of callbacks.
Kind: inner typedef of NimbusecAPI
Properties
Name | Type | Description |
---|---|---|
statusCode | integer |
HTTP reponse status code |
message | string |
Error message (from X-Nimbusec-Error header) |
data | object |
HTTP error details |
data.timestamp | integer |
HTTP response date |
data.status | string |
HTTP reponse status code |
data.error | string |
short error message |
data.message | string |
detailed error message |
data.path | string |
path of the request |