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

Improved framework functions used by MITRE API endpoints #14208

Merged
merged 9 commits into from
Jul 21, 2022

Conversation

mcarmona99
Copy link
Contributor

@mcarmona99 mcarmona99 commented Jul 11, 2022

Related issue
close #14167

Description

This PR closes #14167.

In this pull request, I have improved all the MITRE framework functions. There is more information about the new design in the related issue's comments.

Apart from the time improvements, I have also reviewed the request_slice values, reviewed the queries to improve the optimal request_slice for relational queries, made profiling, and removed timeouts.

New total times (API integration tests environment, CI hosts)

Specs: 4 GB RAM and 2 CPU cores (Wazuh deployment in a Docker environment). Specs between the minimum and the recommended for a Wazuh manager.

Endpoint Response time
GET /mitre/metadata 1.04 s
GET /mitre/mitigations 3.21 s
GET /mitre/references 2.82 s
GET /mitre/tactics 2.20 s
GET /mitre/techniques 5.74 s
GET /mitre/groups 2.51 s
GET /mitre/software 3.61 s

As we can see there is no need to use custom timeouts.

@mcarmona99 mcarmona99 self-assigned this Jul 11, 2022
@mcarmona99 mcarmona99 linked an issue Jul 12, 2022 that may be closed by this pull request
13 tasks
framework/wazuh/core/mitre.py Outdated Show resolved Hide resolved
framework/wazuh/core/mitre.py Outdated Show resolved Hide resolved
framework/wazuh/core/mitre.py Outdated Show resolved Hide resolved
framework/wazuh/core/mitre.py Outdated Show resolved Hide resolved
framework/wazuh/core/mitre.py Outdated Show resolved Hide resolved
framework/wazuh/core/mitre.py Outdated Show resolved Hide resolved
framework/wazuh/core/mitre.py Outdated Show resolved Hide resolved
framework/wazuh/core/mitre.py Outdated Show resolved Hide resolved
framework/wazuh/core/mitre.py Outdated Show resolved Hide resolved
@mcarmona99 mcarmona99 marked this pull request as draft July 12, 2022 09:30
@mcarmona99 mcarmona99 marked this pull request as ready for review July 12, 2022 14:35
framework/wazuh/core/mitre.py Outdated Show resolved Hide resolved
framework/wazuh/core/mitre.py Outdated Show resolved Hide resolved
Co-authored-by: Víctor Fernández Poyatos <victor.f.poyatos@wazuh.com>
Copy link
Contributor

@vicferpoy vicferpoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davidjiglesias davidjiglesias merged commit 7d1d142 into 4.3 Jul 21, 2022
@davidjiglesias davidjiglesias deleted the feature/14167-improve-framework-mitre branch July 21, 2022 09:49
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.

Rework framework functions used by MITRE API endpoints
3 participants