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

Enable running with no config if no plugin needs a config #736

Closed
wants to merge 3 commits into from

Conversation

NiklasHargarter
Copy link
Contributor

@NiklasHargarter NiklasHargarter commented Aug 9, 2024

What

Additional edits to poc_plugins_config_file. Allows Troubadix to run without a config file if no plugins require it.
Checks if any of the plugins that are part of the current run need the config, and only then loads the toml file.

Why

Alternative to placing an empty default config in the repo, so that Troubadix does not crash even if no config would have been required. Maintains the same level of security by not allowing plugins that require config to accidentally run without one.

Running Troubadix

Ok

Only config free plugins:

with default config. ./troubadix.toml can point to nothing or actual config
troubadix --include-tests <plugins_without_config> -d ~/gb/vulnerability-tests/nasl
manual config. Path can point to nothing or actual config
troubadix --include-tests <plugins_without_config> -d ~/gb/vulnerability-tests/nasl --config troubadix.toml

Plugins that require config

with default config when./troubadix.toml points to actual config
troubadix --include-tests <plugins_with_config> -d ~/gb/vulnerability-tests/nasl
manual config and path points to actual config
troubadix --include-tests <plugins_with_config> -d ~/gb/vulnerability-tests/nasl --config troubadix.toml

Not Ok

with default config if ./troubadix.toml does not exist
troubadix --include-tests <plugins_with_config> -d ~/gb/vulnerability-tests/nasl
manual config and path pointing to non-existent file
troubadix --include-tests <plugins_with_config> -d ~/gb/vulnerability-tests/nasl --config fake_file

References

Checklist

  • Tests

@NiklasHargarter NiklasHargarter requested a review from a team as a code owner August 9, 2024 10:39
Copy link

github-actions bot commented Aug 9, 2024

Conventional Commits Report

Type Number
Changed 3

🚀 Conventional commits found.

@NiklasHargarter NiklasHargarter changed the title Run with no config Enable running with no config if no plugin needs a config Aug 9, 2024
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.

1 participant