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

Fix add related, fix manual ooi task list, remove redundant octopoes call #3421

Merged
merged 13 commits into from
Sep 5, 2024

Conversation

noamblitz
Copy link
Contributor

@noamblitz noamblitz commented Aug 29, 2024

Changes

Two fixes:

  • Add related now actually adds a related object instead of same ooi type
  • Manually added scans show up correctly in list
  • Fixes some view inheritance, increasing ooi detail speed by removing unneeded octopoes request

Demo

image image

QA notes

Add related: go to ooi detail and click "Add" under the related objects. Show now work again.

After adding a raw file, in the ooi detail, the observation should now show: Scan was added manually.

Whole ooi detail should be QA'ed because the view inheritance has changed so there is a chance of regressions.


Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue.
  • I have written unit tests for the changes or fixes I made.
  • I have checked the documentation and made changes where necessary.
  • I have performed a self-review of my code and refactored it to the best of my abilities.
  • Tickets have been created for newly discovered issues.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@noamblitz noamblitz requested a review from a team as a code owner August 29, 2024 09:45
@noamblitz noamblitz changed the title Fix add related, fix manual ooi task list Fix add related, fix manual ooi task list, remove redundant octopoes call Aug 29, 2024
@stephanie0x00 stephanie0x00 added this to the OpenKAT v1.17 milestone Sep 4, 2024
@@ -24,7 +24,11 @@ <h2>{% translate "Last observed by" %}</h2>
<a href="{% url 'boefje_detail' organization_code=organization.code plugin_id=observation.boefje.id %}"
title="{{ observation.boefje.id }}">{{ observation.boefje.name }}</a>
{% else %}
{% translate "The boefje has since been deleted or disabled." %}
{% if observation.normalizer.raw_data.boefje_meta.boefje.id == "manual" %}
{% translate "This scan was manually created." %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not really blocking, but maybe "The raw file was uploaded manually" or "This scan was done manually" is better than "This scan was manually created"? In the case OOIs are just added manually they don't have to be the result of a scan, so I think saying that there was a manual upload instead of scan is more accurate.

@stephanie0x00
Copy link
Contributor

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.
  • I confirmed that there are no unintended functional regressions in this branch:
    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.
  • I checked the logs for errors and/or warnings and made issues where necessary

What works:

Tested that the dropdown shows up when clicking the 'Add' button on a 'Related Objects' page. This works.
Manually added a DnsRecords scan, by downloading old DNSRecords, changing the data and re-uploading this. The data shows up in the tree and the objects can be clicked. The testdomain that was used has the same clearance levels as the domaindiscount24.net domains that result from the onboarding scans for mispo.es.
I also added a manual HostnameHTTPURL and that receives the same clearance level as a different HostnameHTTPURL for the same domain.
The DNS Records task can be rescheduled and runs accordingly.
Tested a migration scenario from main, by performing the step above. This seems to work.

Links from the normalizers (from newly added objects) also are clickable from the normalizer Tasks tab.
The added testdomain also shows up in the object tree for mispo.es.

What doesn't work:

n/a

Bug or feature?:

n/a

Copy link
Contributor

@ammar92 ammar92 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Very minimal remarks, consider it approved

rocky/rocky/views/mixins.py Outdated Show resolved Hide resolved
rocky/rocky/views/ooi_detail_related_object.py Outdated Show resolved Hide resolved
@underdarknl underdarknl merged commit f243e73 into main Sep 5, 2024
10 checks passed
@underdarknl underdarknl deleted the fix/add-related branch September 5, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants