osquery
v1.0.0
Published
facebook osquery client
Downloads
19
Readme
osquery-node
Facebook osquery client for node.js
Installation
npm install osquery
Usage
client:
var osquery = require('osquery');
var os = osquery.createClient({ path: '/var/osquery/osquery.em' });
os.query('select * SELECT uid, name FROM listening_ports l, processes p WHERE l.pid=p.pid', function(err, res) {
console.log(res);
});
Table plugin:
var osquery = require('osquery');
var generateTable = function(req, resp) {
resp(null, [{
"foo": "foo value",
"bar": "bar value " + Date.now()
}]
);
};
var c = osquery.createClient();
var s = c.createServer({
info: {
name: 'test table extension'
},
plugins: [{
type: 'table',
name: 'node_ext_table',
schema: [
{"name": "foo", "type": "TEXT"},
{"name": "bar", "type": "TEXT"}
],
handler: generateTable
}]
});
s.listen(function(err, serv) {
console.log('extension started!');
});
License
MIT