24 Commits
Author SHA1 Message Date
Amir Malka b309cfca7a Print attack tree (optional, with argument) (#997)
* Print attack tree with argument

* fix
2023-01-03 08:46:50 +02:00
David Wertenteil 7c79c14363 Update core/pkg/resultshandling/results.go 2022-12-22 15:00:59 +02:00
Vlad Klokun f005cb7f80 feat: always print to (T)UI using PrettyPrinter
Prior to this change, `pretty-printer` was a special type of Printer
that wrote output to `Stdout`, unless explicitly asked to write to a
given file. Kubescape used `pretty-printer` as an output format by
default. This behavior created the following inconsistencies:
- When invoked as `kubescape scan`, Kubescape would use `pretty-printer`
  by default, and it would output the scan resluts in the
  `pretty-printer` format to `Stdout`.
- When invoked as `kubescape scan --format=pretty-printer`, the behavior
  would be as above.
- When invoked as `kubescape scan --format=FORMAT`, where `FORMAT` is any
  format except for `pretty-printer`, Kubescape would write the results
  to a sensible default file for the selected format. This is in
  contrast to how `--format=pretty-printer` would still output to
  `os.Stdout`, and not an output file.
- When invoked as `kubescape scan --format=ANY_FORMAT --output=FILENAME`, where
  `ANY_FORMAT` is any format, including `pretty-printer`, Kubescape
  would write the results to the provided `FILENAME` in the given
  `ANY_FORMAT`, and not write any results to `Stdout`.

The aforementioned situation complicates life for users running
Kubescape in CI, where Kubescape would skip writing the results to
`Stdout` and only write to the provided output file.

Moreover, with the addition of support for multiple output formats and,
hence, files, this introduces the following ambiguity:
- When invoked as `kubescape scan --format=json,pdf,pretty-printer
  --output=FILENAME`, should Kubescape treat `pretty-printer` as a
  format for the output file, or just an instruction to also print the
  results to `Stdout`?

To fix these inconsistencies and ambiguities, this commit introduces the
following changes:

- Kubescape will always print results to `Stdout` using the
  PrettyPrinter format.

- The `--format` CLI flag will control the format(s) in which the results
  will be written to one or many *output* files. This breaks the
  previous behavior that running `kubescape scan
  --format=pretty-printer` would not produce an output file, and only
  write to `Stdout`. After this change, the same invocation will still
  write to `Stdout`, but also produce a `report.txt` file in the
  PrettyPrinter format.
2022-12-22 15:00:59 +02:00
Vlad Klokun eb6d39be42 style: shorten receiver names in ResultsHandler 2022-12-22 15:00:59 +02:00
Vlad Klokun 5076c38482 refactor: tidy up printing to multiple outputs
This change:

- Simplifies printing to multiple outputs.
- Adds a comment on why we keep the Print → Score → Submit order when
  outputting results.
2022-12-22 15:00:59 +02:00
suhasgumma 874aa38f68 Handle Output Extensions Gracefully 2022-12-22 15:00:59 +02:00
suhasgumma 61c120de0e Support getting outputs in multiple formats 2022-12-22 15:00:59 +02:00
suhasgumma c3f7f0938d Handle Invalid Formats 2022-11-28 19:56:27 +05:30
David Wertenteil a3e87f4c01 Updating json v1 deprecation message 2022-11-13 15:03:22 +02:00
Vlad Klokun 79e2515807 feat: support the SARIF output format 2022-10-26 18:13:37 +03:00
Arvindh bb586892ba Fixed typos on multiple files (#808) 2022-09-15 15:53:32 +03:00
David Wertenteil bd970eff83 update to kubescape org 2022-08-22 18:22:28 +03:00
David Wertenteil ad91178ef7 updated dependencies pkgs 2022-08-18 17:41:03 +03:00
David Wertenteil aef74d6480 use exteranl go logger 2022-07-18 23:59:56 +03:00
Vlad Klokun af1d5694dc feat: add HTML as an output for scan results 2022-06-14 16:01:07 +03:00
David Wertenteil da27a27ad5 adding status rest api 2022-05-18 00:34:15 +03:00
David Wertenteil fa376ed5a4 support control view 2022-05-10 14:36:07 +03:00
David Wertenteil 858d7ac2ef update pkg struct 2022-04-10 18:06:28 +03:00
DanielGrunbergerCA 093d71fff4 exit status 1 2022-04-05 14:05:31 +03:00
dwertent db5fdd75c4 inserting scan source 2022-03-25 16:08:07 +03:00
dwertent 9d957b3c77 update output 2022-03-15 17:04:59 +02:00
dwertent d0e2730518 add cautils to core 2022-03-13 18:14:48 +02:00
dwertent 6dab82f01a fixed output format 2022-03-13 15:03:22 +02:00
dwertent 8f1e4ceff0 split pkg 2022-03-13 09:59:57 +02:00