[go: nahoru, domu]

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

[backend] Change external reference resolution for OpenCTI integration #1048

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

RomuDeuxfois
Copy link
Member
@RomuDeuxfois RomuDeuxfois commented Jun 5, 2024

Proposed changes

OpenCTI should get the latest ended simulation based on scenarios instead of the latest simulation based on the first scenario.

Related issues

Testing

  • Generate a scenario from OpenCTI to OpenBAS
  • Launch a simulation with some expectations
  • Wait for the end of this simulation
  • Go to opencti and checked that the security posture is the same as that on OpenBAS
  • Re launch the simulation, change the expectation result and verify the new posture in both platform

OpenCTI PR -> OpenCTI-Platform/opencti#7233

@RomuDeuxfois RomuDeuxfois linked an issue Jun 5, 2024 that may be closed by this pull request
@RomuDeuxfois RomuDeuxfois added the filigran team use to identify PR from the Filigran team label Jun 5, 2024
Copy link
codecov bot commented Jun 5, 2024

Codecov Report

Attention: Patch coverage is 3.33333% with 29 lines in your changes missing coverage. Please review.

Project coverage is 26.17%. Comparing base (716ffe7) to head (26b183e).

Files Patch % Lines
...pi/src/main/java/io/openbas/utils/ResultUtils.java 0.00% 20 Missing ⚠️
.../main/java/io/openbas/service/ScenarioService.java 0.00% 7 Missing ⚠️
...i/src/main/java/io/openbas/opencti/OpenCTIApi.java 33.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1048      +/-   ##
============================================
+ Coverage     25.87%   26.17%   +0.30%     
- Complexity     1006     1011       +5     
============================================
  Files           450      451       +1     
  Lines         10561    10566       +5     
  Branches        513      513              
============================================
+ Hits           2733     2766      +33     
+ Misses         7765     7737      -28     
  Partials         63       63              

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

@GetMapping(SCENARIO_URI + "/{scenarioId}/exercises")
@PreAuthorize("isScenarioObserver(#scenarioId)")
public Iterable<ExerciseSimple> scenarioExercises(@PathVariable @NotBlank final String scenarioId) {
Scenario scenario = this.scenarioService.scenario(scenarioId);
return scenario.getExercises().stream().map(ExerciseSimple::fromExercise).toList();
}

// endregion
@GetMapping(SCENARIO_URI + "/external_reference/{externalReferenceId}")
Copy link
Member Author
@RomuDeuxfois RomuDeuxfois Jun 5, 2024

Choose a reason for hiding this comment

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

Prefix by /opencti and add versioning (v1)
Keep the old URL with deprecated method
Add swagger doc to explain which endpoint is supported

Release note to be updated with needed OpenCTI version XXX

Copy link
Member
@SouadHadjiat SouadHadjiat left a comment

Choose a reason for hiding this comment

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

tested locally

@RomuDeuxfois RomuDeuxfois merged commit 7e4872f into master Jun 6, 2024
6 checks passed
@RomuDeuxfois RomuDeuxfois deleted the issue/1047 branch June 6, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Security Posture on OpenCTI
2 participants