mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
8fecef3ed5
* update helper to use the osquery schema from the osquery/osquery-site repo * update script description and generated json filename * Add ritual to digital experience handbook * add merged schema * Update README.md * Update get-extended-osquery-schema.js
31 lines
992 B
JavaScript
Vendored
31 lines
992 B
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'Generate merged schema',
|
|
|
|
|
|
description: 'Merge the osquery schema from the osquery/osquery-site GitHub repo with Fleet\'s overrides (/schema/fleet_schema.json) and save the merged schema to /schema/osquery_fleet_schema.json',
|
|
|
|
|
|
|
|
fn: async function () {
|
|
let path = require('path');
|
|
let topLvlRepoPath = path.resolve(sails.config.appPath, '../');
|
|
|
|
let mergedSchemaOutputPath = path.resolve(topLvlRepoPath+'/schema', 'osquery_fleet_schema.json');
|
|
|
|
let mergedSchemaTables = await sails.helpers.getExtendedOsquerySchema();
|
|
|
|
// Save the merged schema to /schema/merged_schema.json. Note: If this file already exists, it will be overwritten.
|
|
await sails.helpers.fs.writeJson.with({
|
|
destination: mergedSchemaOutputPath,
|
|
json: mergedSchemaTables,
|
|
force: true
|
|
});
|
|
|
|
sails.log(`osquery schema successfully merged with Fleet\'s overrides. The merged schema has been saved at ${mergedSchemaOutputPath}`);
|
|
}
|
|
|
|
};
|
|
|