create CLI and sigma stats function in CLI

This commit is contained in:
Charlotte Croce 2025-04-18 17:15:41 -04:00
parent 85bb8958b8
commit 519c87fb04
9 changed files with 849 additions and 46 deletions

View file

@ -31,11 +31,25 @@ async function getSigmaStats() {
};
}
// Format the data in a consistent structure for both CLI and Slack
const formattedStats = {
lastUpdate: statsResult.stats.lastUpdate,
totalRules: statsResult.stats.totalRules,
databaseHealth: statsResult.stats.databaseHealth,
operatingSystems: statsResult.stats.operatingSystems,
severityLevels: statsResult.stats.severityLevels,
mitreTactics: statsResult.stats.mitreTactics,
topAuthors: statsResult.stats.topAuthors,
// Add any other statistics needed
};
logger.info(`${FILE_NAME}: Successfully collected database statistics`);
return {
success: true,
stats: statsResult.stats
stats: formattedStats,
// Include raw response data for direct use by CLI
responseData: formattedStats
};
} catch (error) {
logger.error(`${FILE_NAME}: Error processing statistics: ${error.message}`);