Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add stats to JSON output #725

Open
miketheman opened this issue Dec 18, 2024 · 0 comments
Open

Feature: Add stats to JSON output #725

miketheman opened this issue Dec 18, 2024 · 0 comments

Comments

@miketheman
Copy link

When using mal in an automated context, using --format json is the likeliest interface for other processes to evaluate the output.

Currently, the JSON output has one top-level key - "Files", which we can traverse to get the RiskLevel or RiskScore, but we have to iterate through each to collect them and calculate a score.

The --stats command currently does not affect the JSON output, only printing to terminal, where it would be preferable to include that information in the JSON output, probably as a top-level "Stats" key, something like:

{
  "Files": {...},
  "Stats": {
    FilesScanned: <int>,
    FilesSkipped: <int>,
    TotalRisks: <int>,
    RiskLevel: <str>,
    RiskPercentage: <float>,
    BehaviorCount: <int>,
    ...
  }
}

I'm not certain on the namespace details yet, but wanted to get the conversation started on whether this is a good idea or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant