-
Notifications
You must be signed in to change notification settings - Fork 971
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] fix file access restriction to also target trash index (#9424) #9455
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #9455 +/- ##
==========================================
- Coverage 65.34% 65.33% -0.01%
==========================================
Files 624 624
Lines 59696 59696
Branches 6685 6689 +4
==========================================
- Hits 39009 39005 -4
- Misses 20687 20691 +4 ☔ View full report in Codecov by Sentry. |
entity_type="Malware", entity_id=self.entity_id, mode="full" | ||
entity_type=self.entity_type, entity_id=self.entity_id, mode="full" |
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.
This change is unrelated to the fix. It's just to make this script more usable in other conditions.
I have updated it during my dev, but I thought it was still something good to keep.
opencti_api_client = OpenCTIApiClient(self.api_url, self.api_token) | ||
|
||
# Upload the given file to the entity | ||
opencti_api_client.stix_domain_object.add_file( |
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.
new utility for our tests, to upload a file to an entity
I don't get why the file attached to the report is deleted/sent to the trash when the report is deleted. It should simply be marked as removed with the EDIT: after testing, I understand your change better now. I thought the file was sent to the trash as well, but that's not the case, your change is to make it possible to load the entity related to the file. |
Proposed changes
When using
internalLoadById
to do a file access check, target also the trash index and not only the read indices.Related issues
Checklist
Further comments