feat: expose IoC-Sensor relationship in API responses#999
feat: expose IoC-Sensor relationship in API responses#999aashnaachaudhary10 wants to merge 12 commits intointelowlproject:developfrom
Conversation
a443ca2 to
5b6d30f
Compare
|
@regulartim ,please have a look and tell me if any change required. |
Hey @aashnaachaudhary10 ! First of all, the CI should not fail! ;) Please fix that. |
Hi @regulartim I've updated the IOCSerializer to include the sensors field as requested. However, I see one CI test failing. It seems like it might be related to the expected response schema in the tests. Could you please guide if I should update the test cases as well? |
Hi! I haven't gone through code changes , but looking at your CI error, it's clear the failure is coming from the linter rather than the functional tests. It looks like the code in api/serializers.py just needs to be reformatted to match the project's style. You can fix this locally and prevent it from happening again by setting up the pre-commit hooks as mentioned in the docs |
|
regulartim
left a comment
There was a problem hiding this comment.
Hey @aashnaachaudhary10 ! You included the filed in the serializer, but this does not automatically expose it in the API responses, right? Did you test the API response? Did it contain the relation? Maybe add a test for that! Also, it seems like you included a lot of unrelated changes in this PR.
.vscode/settings.json
Outdated
There was a problem hiding this comment.
This file does not belong into this PR.
frontend/package-lock.json
Outdated
There was a problem hiding this comment.
This file also doesn't belong into this PR!
I have just removed the unrelated files (.vscode/settings.json and package-lock.json) that were accidentally included. I did verify the response manually in the Docker environment (as shown in the screenshot in my description), and the sensors field was correctly populated with the sensor addresses. Aut I understand the importance of an automated test for this. I will add a test case to verify this relationship in the API response shortly and update the PR. Thanks for your patience! |
regulartim
left a comment
There was a problem hiding this comment.
Hey @aashnaachaudhary10 ! Now you completely removed the package-lock.json. But it is needed for building the frontend. Also, I still don't see how your changes will expose the relationship in the API.
This PR is far from being ready to merge. Please take your time to understand the task, understand the project setup and how to work with Git. Make sure your PR is flawless before requesting a review again.
Description
This PR addresses the requirement to expose the relationship between Indicators of Compromise (IoCs) and their reporting Sensors in the API responses. By updating the
IOCSerializer, we now include asensorsfield that lists the addresses of all sensors associated with a specific IoC using aSlugRelatedField.This branch has been re-created based on the latest
developbranch to ensure a clean commit history and compatibility with the current project structure.Related Issues
Type of Change
Checklist
developVerification Proof (Manual Testing)
I verified the serializer output within the Docker environment (

greedybear_uwsgicontainer):