Nurturing Palpable Magnificence

    osquery

    1.0.0 • Public • Published

    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

    See also

    Keywords

    Install

    npm i osquery

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • sidorares