Skip to content

[frontend/backend] chunk 1 scenario assistant #3225

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

Merged
merged 10 commits into from
May 27, 2025

Conversation

MarineLeM
Copy link
Contributor

Proposed changes

Front

  • Create scenario assistant button and Drawer (without TTPs widget)

Back

  • Generate injects based on assets asset-group and TTP
  • Handle number of inject by TTP
  • Add tests

Related issues

@MarineLeM MarineLeM self-assigned this May 22, 2025
Copy link

codecov bot commented May 22, 2025

Codecov Report

Attention: Patch coverage is 92.71845% with 15 lines in your changes missing coverage. Please review.

Project coverage is 42.74%. Comparing base (a924f0d) to head (1c10535).
Report is 21 commits behind head on release/current.

Files with missing lines Patch % Lines
...as/rest/inject/service/InjectAssistantService.java 96.15% 2 Missing and 5 partials ⚠️
...est/injector_contract/InjectorContractService.java 61.53% 3 Missing and 2 partials ⚠️
.../io/openbas/injectors/opencti/OpenCTIContract.java 0.00% 1 Missing ⚠️
.../java/io/openbas/injectors/ovh/OvhSmsContract.java 0.00% 1 Missing ⚠️
...va/io/openbas/rest/asset/endpoint/EndpointApi.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##             release/current    #3225      +/-   ##
=====================================================
+ Coverage              42.07%   42.74%   +0.66%     
- Complexity              2469     2542      +73     
=====================================================
  Files                    704      705       +1     
  Lines                  21781    22173     +392     
  Branches                1481     1538      +57     
=====================================================
+ Hits                    9165     9478     +313     
- Misses                 12112    12181      +69     
- Partials                 504      514      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@savacano28 savacano28 self-requested a review May 23, 2025 08:46
@MarineLeM MarineLeM changed the title Issue/2449 chunk 1 [frontend/backend] chunk 1 scenario assistant May 23, 2025
@savacano28
Copy link
Contributor

savacano28 commented May 26, 2025

Tested : Ok (multiplatforme, multiTTP)
Your code is really clean and well-organized :)!! 🚀


@PersistenceContext private EntityManager entityManager;

public List<Inject> generateInjectsForScenario(Scenario scenario, InjectAssistantInput input) {
Copy link
Member

@Dimfacion Dimfacion May 27, 2025

Choose a reason for hiding this comment

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

Nitpick (non-blocker) : Javadoc on top of the public methods (or even better on the private methods too) would be nice

manualInjectorContract,
String.format(
"[%s] Placeholder - %s %s", attackPattern.getExternalId(), platform, architecture),
String.format(
Copy link
Member

Choose a reason for hiding this comment

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

Question : Does that mean every title of injects are in english if generated by AI ? If so, might need to be validated by product

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've replicated the same behavior as the injects generated by openCTI.
But sure, i will confirm that with the product

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I feel that's a more global issue : some stuff on our backend is not localized and it might end up being a problem at some point ...

@Dimfacion
Copy link
Member

Seems to be working but I might have a dumb question. If I invoke the scenario assistant multiple times, it always add new injects. Is it expected or should it take into account what's already in the scenario ?

Signed-off-by: Marine LM <[email protected]>
@MarineLeM MarineLeM merged commit 99c248d into release/current May 27, 2025
8 checks passed
@MarineLeM MarineLeM deleted the issue/2449-chunk-1 branch May 27, 2025 12:59
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.

3 participants