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: parse arguments only if chosen by flag #3960

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlonZivony
Copy link
Collaborator

1. Explain what the PR does

Fix an the issue that cause the parse arguments to always run. It was probably caused to support signatures using parsed arguments. From now on it should be chosen directly in these cases.

2. Explain how to test it

3. Other comments

Fix an the issue that cause the parse arguments to always run.
It was probably caused to support signatures using parsed arguments.
From now on it should be chosen directly in these cases.
@@ -320,9 +320,6 @@ func GetTraceeRunner(c *cobra.Command, version string) (cmd.Runner, error) {
runner.Printer = p
runner.InstallPath = traceeInstallPath

// parse arguments must be enabled if the rule engine is part of the pipeline
runner.TraceeConfig.Output.ParseArguments = true
Copy link
Member

Choose a reason for hiding this comment

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

@NDStrahilevitz
Copy link
Collaborator

NDStrahilevitz commented Apr 5, 2024

Pretty sure this is by design until we convert all our signatures to non parsed args. I should have a branch with a commit doing that lying somewhere on my machine if we opt for that.

@NDStrahilevitz
Copy link
Collaborator

Actually, even if we convert all our signatures, we would introduce another problem, that the instant some opts to use the flag they would break the (now converted) signatures. So basically it would reintroduce the test failures from the opposite end.
BTW, marking that this resolves the last checkpoint from #2177. What we're missing is a solution for #3008.

@AlonZivony
Copy link
Collaborator Author

Pretty sure this is by design until we convert all our signatures to non parsed args. I should have a branch with a commit doing that lying somewhere on my machine if we opt for that.

The more reasonable option is to require the user to use the flag if he wants to use the signatures.
Currently the flag doesn't do anything as it is overridden when the signatures engine is used, which is always.

The main problem right now with this is the fact that Tracee is made to use the unparsed arguments.
As implementing the full analyze mode requires streaming unparsed events into Tracee we can either not parse them from the start or unparse them in the analyze mode. The later option is the better one probably, especially if we can assuming from the stream whether the arguments are parsed or not. However, the analyze mode introduce too much code as is and is hard to merge. For now it makes more sense that it will only support unparsed events, but it requires that the parse-arguments option will enable to opt-out the parsing, which is currently not an option.

In the end, it makes more sense to give the user the option to choose whether he wants parsed or unparsed arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants