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

detect/transform: Transform options and pcrexform (new transform) #4919

Closed
wants to merge 8 commits into from

Conversation

jlucovsky
Copy link
Contributor

This PR is a continuation of #4912

This PR adds transform pcrexform -- a new transform supporting transform options introduced in (#4647). Transform options are supported when the transform implementation supports them. This means that the transform infrastructure will provide the transform-specific options container to the transform evaluation logic. When no longer needed, the infrastructure will invoke the transform's Free function to release the options container.

pcrexform applies a (mandatory) RE to the transformation buffer and emits the first capture, if any, into the transformation buffer. If there is not a match, the transformation buffer is unmodified.

Link to redmine ticket:

Describe changes:

  • Remove unused function delaration

Companion Suricata-verify PR #196

jlucovsky added 8 commits May 2, 2020 08:33
This commit adds support for transform-specific options. During Setup,
transforms have the signature string available for options detection.
When a transform detects an option, it should convert the option into an
internal format and supply a pointer to this format as the last argument
to DetectSignatureAddTransform.

Transforms that support options must provide a function in their
Sigmatch table entry. When the transform is freed, a pointer to the
internal format of the option is passed to this function.
This commit adds the definition of the new `pcrexform` transform.
This commit adds a new transform -- pcrexform -- that applies a regular
expression to the transformation buffer. If an expression was captured,
that is output to the transformation buffer. Otherwise, the
transformation buffer is unchanged.
This commit registers the `pcrexform` transform.
@victorjulien
Copy link
Member

Merged in #5047, thanks Jeff!

@jlucovsky jlucovsky deleted the 3200/5 branch June 9, 2020 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants