Skip to content

Update printresults.go#246

Merged
santoshkal merged 1 commit intopre-mainfrom
santoshkal-patch-printresults
Dec 19, 2024
Merged

Update printresults.go#246
santoshkal merged 1 commit intopre-mainfrom
santoshkal-patch-printresults

Conversation

@santoshkal
Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Santosh Kaluskar <141515226+santoshkal@users.noreply.github.com>
@dryrunsecurity
Copy link
Copy Markdown

DryRun Security Summary

The code changes in pkg/validate/printresults.go aim to enhance the PrintResults function by improving result tracking, logging, and reporting of policy evaluation outcomes.

Expand for full summary

Summary:

The provided code changes in the pkg/validate/printresults.go file appear to be focused on improving the implementation of the PrintResults function, which is responsible for printing the evaluation results of a set of policies, along with their associated metadata, in a tabular format. The key changes include:

  1. Tracking the number of passed and failed policy evaluations, which can provide useful insights into the overall security posture of the application.
  2. Modifying the logging behavior for failed policy evaluations, using log.Warn() instead of log.Info(), to ensure that these issues are more prominently highlighted in the logs.
  3. Introducing the ability to save the evaluation results to a JSON file named "results.json", which can be useful for storing and analyzing the policy evaluation data over time.
  4. Handling cases where the policy evaluation result is not a slice of values, but a single value, to ensure that the function can properly process and display the results.

From an application security perspective, these changes appear to be generally positive, as they can contribute to better visibility and monitoring of the application's security posture. However, it's important to review the broader context and the overall security practices employed in the application to ensure a comprehensive security approach.

Files Changed:

  • pkg/validate/printresults.go: The changes in this file are focused on improving the implementation of the PrintResults function, which is responsible for printing the evaluation results of a set of policies, along with their associated metadata, in a tabular format. The key changes include tracking passed and failed policy evaluations, improving the logging behavior for failed evaluations, adding the ability to save the results to a JSON file, and handling non-slice policy evaluation results.

Code Analysis

We ran 9 analyzers against 1 file and 0 analyzers had findings. 9 analyzers had no findings.

View PR in the DryRun Dashboard.

@santoshkal santoshkal merged commit 8286bba into pre-main Dec 19, 2024
@santoshkal santoshkal deleted the santoshkal-patch-printresults branch December 19, 2024 13:20
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

Successfully merging this pull request may close these issues.

1 participant