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 settings boefje settings via system env vars #3766

Merged
merged 11 commits into from
Nov 12, 2024
Merged

Conversation

dekkers
Copy link
Contributor

@dekkers dekkers commented Oct 30, 2024

Changes

Fixes a bug where the BOEFJE prefix was not removed before checking if the environment variable is allowed, resulting in it not allowing any of the environment variables.

QA notes

Fix was already tested yesterday by Z-CERT.


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.

@dekkers dekkers requested a review from a team as a code owner October 30, 2024 09:29
@dekkers dekkers changed the title Fix boefje env vars Fix settings boefje settings via system env vars Oct 30, 2024
ammar92
ammar92 previously approved these changes Oct 31, 2024
@dekkers dekkers self-assigned this Nov 1, 2024
@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:

Looks good. Everything seems to work.

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.

Nice work. One suggestion, looks good otherwise

boefjes/boefjes/job_handler.py Outdated Show resolved Hide resolved
@dekkers
Copy link
Contributor Author

dekkers commented Nov 11, 2024

I have pushed a better implementation that fixed a bug in my original change, but should also be easier to understand. It also caches the boefje system env variables, because there is no need to loop over the environment variables everytime a boefje gets executed. There are also unit tests now.

.env-prod Show resolved Hide resolved
@underdarknl underdarknl merged commit 24d10a5 into main Nov 12, 2024
20 of 21 checks passed
@underdarknl underdarknl deleted the fix-boefje-env-vars branch November 12, 2024 09:17
Copy link

sonarcloud bot commented Nov 12, 2024

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.

4 participants