-
Notifications
You must be signed in to change notification settings - Fork 58
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/efficient reporting #2516
Conversation
Signed-off-by: Donny Peeters <[email protected]>
Signed-off-by: Donny Peeters <[email protected]>
Signed-off-by: Donny Peeters <[email protected]>
Signed-off-by: Donny Peeters <[email protected]>
Use new query functionality in API as well.
…t-coordination into feature/efficient-reporting
Signed-off-by: Donny Peeters <[email protected]>
Signed-off-by: Donny Peeters <[email protected]>
Signed-off-by: Donny Peeters <[email protected]>
Signed-off-by: Donny Peeters <[email protected]>
Signed-off-by: Donny Peeters <[email protected]>
Signed-off-by: Donny Peeters <[email protected]>
Signed-off-by: Donny Peeters <[email protected]>
…all-reports' into feature/efficient-reporting
…re/efficient-reporting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I am very happy to see this and it looks good, I have just a few small remarks. I think it is a nice big step towards more efficient report generation.
In the meantime, some naming changes have been made to the Mail Report (#2513). I think your code will overwrite this, so it would be good to compare the two and make sure these changes won't be overwritten. |
Yes I noticed those, should be fixed I think 👍 |
Signed-off-by: Donny Peeters <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good overal. I just have a few suggestions that might improve it even more
- Fix typing issue: add valid time string cast.
…s and change list comprehensions
…t-coordination into feature/efficient-reporting
Signed-off-by: Donny Peeters <[email protected]>
Checklist for QA:
What works:Generated an aggregate report successfully for multiple domains. Tasks are created and seem to complete as expected. What doesn't work:n/a Bug or feature?:n/a |
* main: (85 commits) Fix wrong solving of merge conflict (#2585) Add metrics collection for scheduler using prometheus (#2468) Hotfix for where_in queries for abstract types (#2577) Update django (#2587) Fix octopoes typing (#2555) Create findings report (#2393) Raise exception if boefje input OOI has been deleted (#2573) Set a timeout on hanging test ssl container (#2560) Feature/efficient reporting (#2516) Updated findings database. Removed old findings, added Impact, Source… (#2569) add unit test for web report (#2528) Add pool size config and logs (#2541) Quick fix for PDF table overflow (#2562) Fix/2527 octopoes unicode (#2558) Add return typing to report test fixtures (#2557) Sort vulnerabilities in vulnerability report (#2378) Disable ruff split-on-trailing-comma and update ruff (#2544) Select all oois triggers toggle all (#2536) Remove unnecessary toplevel dependencies (#2554) Make valid time required parameter in the octopoes API (#2543) ...
Changes
This PR adds several changes that should be backward compatible with current reporting, but opens up the possibility to make significant performance improvements:
collect_data
method that takes in multiple oois. By default this generates the data through the already existinggenerate_data
method. It returns the data grouped by the input_ooi for easy compatibility.collect_data
method, moving iteration to the report classes in a backward compatible way./query-many
endpoint that you also give a path query, but takes in severalsources
(references), and returns the same result as running that path on all sources separately.or
-clauses. Still for compatibility we had to connect this back to the source through some datalog magic.collect_data
method to make use of this feature. When the other reports do this as well, the amount of queries to octopoes will remain constant instead of scaling with the number of input objects. This is a TODO for a follow up PR that I will create, including benchmark results.Note: the logic around the Query object in this endpoint gets a bit complicated at this point. We should reserve some time to refactor this at some point, but this would give quite some changes perhaps.
Issue link
Closes #2446 (partly, follow up PR incoming)
Demo
See tests.
Notes for QA
Follow the regular report generation flow, but now expect a performance boost generating (aggregate) reports.
Code Checklist
Communication
.env
changes files if required and changed the.env-dist
accordingly.Checklist for code reviewers:
Copy-paste the checklist from the docs/source/templates folder into your comment.
Checklist for QA:
Copy-paste the checklist from the docs/source/templates folder into your comment.