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

feat(policies): display policy breaches in tabulated form #158

Merged
merged 4 commits into from
Nov 23, 2022

Conversation

elsapet
Copy link
Contributor

@elsapet elsapet commented Nov 23, 2022

Description

  • Adds default table display for policies

Note: code extracts to be handled in a separate PR

Examples

No format specified

Screenshot 2022-11-23 at 16 34 23

=> go run cmd/curio/main.go scan ~/Desktop/test/temp.rb --report=policies

Loaded  configuration file
Target /Users/elsapet/Desktop/test/temp.rb
Scanning target... 100% [========================================] (1/1, 28 files/s) [0s]
===============================

CRITICAL: Logger leaks policy breach with Personal data
Logger leaks detected
Filename: .

===============================

CRITICAL: Dummy policy policy breach with dummy
Dummy policy to show other severity levels
Filename: some_file.rb

===============================

HIGH: Logger leaks policy breach with Sensitive data
Logger leaks detected
Filename: .

===============================

HIGH: Dummy policy policy breach with dummy
Dummy policy to show other severity levels
Filename: some_file.rb

===============================

MEDIUM: Dummy policy policy breach with dummy
Dummy policy to show other severity levels
Filename: some_file.rb

===============================

LOW: Dummy policy policy breach with dummy
Dummy policy to show other severity levels
Filename: some_file.rb

===============================

Specifying JSON format

=> go run cmd/curio/main.go scan ~/Desktop/test/temp.rb --report=policies --format=json | jq

Loaded  configuration file
Target /Users/elsapet/Desktop/test/temp.rb
Scanning target... 100% [========================================] (1/1, 31 files/s) [0s]
{
  "critical": [
    {
      "policy_name": "Logger leaks",
      "policy_description": "Logger leaks detected",
      "filename": ".",
      "category_group": "Personal data"
    },
    {
      "policy_name": "Dummy policy",
      "policy_description": "Dummy policy to show other severity levels",
      "filename": "some_file.rb",
      "category_group": "dummy"
    }
  ],
  "high": [
    {
      "policy_name": "Logger leaks",
      "policy_description": "Logger leaks detected",
      "filename": ".",
      "category_group": "Sensitive data"
    },
    {
      "policy_name": "Dummy policy",
      "policy_description": "Dummy policy to show other severity levels",
      "filename": "some_file.rb",
      "category_group": "dummy"
    }
  ],
  "low": [
    {
      "policy_name": "Dummy policy",
      "policy_description": "Dummy policy to show other severity levels",
      "filename": "some_file.rb",
      "category_group": "dummy"
    }
  ],
  "medium": [
    {
      "policy_name": "Dummy policy",
      "policy_description": "Dummy policy to show other severity levels",
      "filename": "some_file.rb",
      "category_group": "dummy"
    }
  ]
}

Checklist

  • I've added test coverage that shows my fix or feature works as expected.
  • I've updated or added documentation if required.
  • I've included usage information in the description if CLI behavior was updated or added.
  • PR title follows Conventional Commits format

@swarmia
Copy link

swarmia bot commented Nov 23, 2022

@elsapet elsapet force-pushed the AMA-3256-display-policy-breaches-in-tabulated-form branch from 2caab0c to 23ec2b6 Compare November 23, 2022 14:20
@elsapet elsapet force-pushed the AMA-3256-display-policy-breaches-in-tabulated-form branch from 23ec2b6 to 0dc6e0d Compare November 23, 2022 14:24
@elsapet elsapet force-pushed the AMA-3256-display-policy-breaches-in-tabulated-form branch from 5fd8445 to e5b0ee7 Compare November 23, 2022 15:05
@elsapet elsapet merged commit 10e2312 into main Nov 23, 2022
@elsapet elsapet deleted the AMA-3256-display-policy-breaches-in-tabulated-form branch November 23, 2022 15:12
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.

None yet

2 participants