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

Feature: improve settings and environment logic and phase out redundant environment keys #3384

Merged
merged 37 commits into from
Sep 5, 2024

Conversation

Donnype
Copy link
Contributor

@Donnype Donnype commented Aug 20, 2024

Changes

This improves the environment logic to pass all BOEFJES_* environment variables to the boefjes and allows you to override them with the KATalogus settings. This makes the flow more simple and intuitive.

Issue link

Closes #3356

Demo

QA notes

Please verify the Katalogus and boefjes such as dns-records still work properly, creating settings and review the documentation update.


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.

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.

@Donnype Donnype changed the title Feature/improve settings env logic Feature: improve settings and environment logic and phase out redundant environment keys Aug 20, 2024
Base automatically changed from feature/add-json-schema-for-copied-boefjes to main August 21, 2024 13:46
@Donnype Donnype marked this pull request as ready for review August 22, 2024 08:42
@Donnype Donnype requested a review from a team as a code owner August 22, 2024 08:42
ammar92
ammar92 previously approved these changes Aug 28, 2024
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. Btw; this is very much related to #1906, any possibility we could discuss this one soon?

boefjes/boefjes/job_handler.py Outdated Show resolved Hide resolved
ammar92
ammar92 previously approved these changes Sep 4, 2024
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.

For the next iteration, I suggest we start using pytest markers to distinguish between different test types (e.g., unit, integration, and performance tests). This approach will help us avoid using code/environment guards and streamline the CI process

@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:

Functionally this PR seems to work as expected. I enabled some general boefjes (onboarding + nmap ports) and they run. I also enabled LeaxIX with an API key and this runs as well, including the normalizers.

What doesn't work:

The docs have some room for improvement on how a user can work with the environment keys. Based on the initial ticket I would say you have to do the following:

Add BOEFJES_MYNEWBOEFJE=yourkey to the .env file, then in the schema.json file for MYNEWBOEFJE you would add the BOEFJES_MYNEWBOEFJE text and it should work? I think it would be very useful to have an example + description like this added, such that it is initially clear what/how it works.

Bug or feature?:

n/a

Signed-off-by: Donny Peeters <donny@bitestreams.com>
Signed-off-by: Donny Peeters <donny@bitestreams.com>
@Donnype
Copy link
Contributor Author

Donnype commented Sep 5, 2024

@stephanie0x00 Done :)

@Donnype Donnype self-assigned this Sep 5, 2024
@underdarknl underdarknl merged commit 3369b3b into main Sep 5, 2024
24 checks passed
@underdarknl underdarknl deleted the feature/improve-settings-env-logic branch September 5, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve env/settings/allowlist configuration logic for the boefjes
4 participants