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 empty consumes of boefjes will trigger tasks in scheduler #3017

Merged
merged 9 commits into from
Jun 6, 2024

Conversation

jpbruinsslot
Copy link
Contributor

@jpbruinsslot jpbruinsslot commented Jun 3, 2024

Changes

When a boefje gets enabled the scheduler will check whether this boefje can run on ooi's that allow this boefje to run on. To do that the scheduler checks what types a boefje can consume. The scheduler will ask octopoes to return those ooi's. When the consumes field of a boefje is empty it will ask octopoes to return ooi's and it will do so when an empty list is provided.

This PR adds a check before the scheduler will ask octopoes to return ooi's, it will check if the consumes field is empty or not and will not request octopoes for ooi's when it is.

Issue link

Closes #3015

QA steps

From what I can see it is not possible to set the consumes of a boefje to an empty list from the webapp. In order to make sure that everything should be working as intended, is to enable a boefje and make sure that the types the ooi's consumes, tasks are being created for ooi's of that type.

@jpbruinsslot jpbruinsslot added the mula Issues related to the scheduler label Jun 3, 2024
@jpbruinsslot jpbruinsslot self-assigned this Jun 3, 2024
@jpbruinsslot jpbruinsslot marked this pull request as ready for review June 4, 2024 07:39
@jpbruinsslot jpbruinsslot requested a review from a team as a code owner June 4, 2024 07:39
@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:

Seems to work as expected, nothing identified that isn't working.

What doesn't work:

n/a

Bug or feature?:

n/a

Copy link

sonarqubecloud bot commented Jun 6, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@underdarknl underdarknl merged commit b7f1e9d into main Jun 6, 2024
10 checks passed
@underdarknl underdarknl deleted the fix/mula/boefje-empty-consumes branch June 6, 2024 12:47
jpbruinsslot added a commit that referenced this pull request Jun 11, 2024
* main: (78 commits)
  Translations update from Hosted Weblate (#3048)
  Translations update from Hosted Weblate (#3018)
  Fix empty consumes of boefjes will trigger tasks in scheduler (#3017)
  Fixes text in secondary menu on scan profile detail page (#3035)
  chore: Resolves css-issues found by sonarcloud (#3034)
  Add raw AuthToken SQL migration (#3009)
  Translations update from Hosted Weblate (#3012)
  Rewrite xtdb-cli.py with "click" (#2957)
  Phase out the Repository model from the KATalogus (#2984)
  Fix merge conflicts in weblate (#3007)
  Translations update from Hosted Weblate (#2996)
  Reports: Fix select all OOIs (#2909)
  Adding IPv6 support to documentation for Docker setups (#2813)
  Translations update from Hosted Weblate (#2930)
  User documentation for reports (#2898)
  Fix task api status code response for malformed id in the scheduler (#2953)
  Add drill trace option in dnssec boefje (#2979)
  Updated packages (#2972)
  Update granian and remove workaround for fixed bug (#2980)
  Fix typing in boefjes/normalizers (#2933)
  ...
jpbruinsslot added a commit that referenced this pull request Jun 17, 2024
* main: (40 commits)
  Translations update from Hosted Weblate (#3091)
  feat: 📝 add API titles (#3055)
  Fixed 2 small mistakes in documentation (#3089)
  Documentation - developer and helper functionality documentation for xtdb-cli tool (#3023)
  fix: 🔧 update db normalize setting (#2777)
  Translations update from Hosted Weblate (#3048)
  Translations update from Hosted Weblate (#3018)
  Fix empty consumes of boefjes will trigger tasks in scheduler (#3017)
  Fixes text in secondary menu on scan profile detail page (#3035)
  chore: Resolves css-issues found by sonarcloud (#3034)
  Add raw AuthToken SQL migration (#3009)
  Translations update from Hosted Weblate (#3012)
  Rewrite xtdb-cli.py with "click" (#2957)
  Phase out the Repository model from the KATalogus (#2984)
  Fix merge conflicts in weblate (#3007)
  Translations update from Hosted Weblate (#2996)
  Reports: Fix select all OOIs (#2909)
  Adding IPv6 support to documentation for Docker setups (#2813)
  Translations update from Hosted Weblate (#2930)
  User documentation for reports (#2898)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mula Issues related to the scheduler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate bug empty boefje consumes in scheduler
3 participants