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

transform: Add case-changing transforms #9761

Closed
wants to merge 4 commits into from

Conversation

jlucovsky
Copy link
Contributor

@jlucovsky jlucovsky commented Nov 9, 2023

DRAFT: suricata-verify tests will be added soon

Add the transforms for changing the case of a buffer.

Link to redmine ticket: (6439)[https://redmine.openinfosecfoundation.org/issues/6439]

Describe changes:

  • Add to_lowercase and to_uppercase transforms

Provide values to any of the below to override the defaults.

To use a pull request use a branch name like pr/N where N is the
pull request number.

Alternatively, SV_BRANCH may also be a link to an
OISF/suricata-verify pull-request.

SV_REPO=
SV_BRANCH=pr/1460
SU_REPO=
SU_BRANCH=
LIBHTP_REPO=
LIBHTP_BRANCH=

Add the constants for the to_lowercase and to_uppercase transforms

Issue: 6439
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #9761 (f6b21f8) into master (c8a7204) will decrease coverage by 0.18%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9761      +/-   ##
==========================================
- Coverage   82.56%   82.39%   -0.18%     
==========================================
  Files         968      968              
  Lines      273827   273827              
==========================================
- Hits       226074   225607     -467     
- Misses      47753    48220     +467     
Flag Coverage Δ
fuzzcorpus 64.29% <ø> (-0.57%) ⬇️
suricata-verify 60.96% <ø> (+<0.01%) ⬆️
unittests 62.93% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@catenacyber
Copy link
Contributor

Missing SV test ;-p

This commit adds the implementation for the case changing transforms:
to_lowercase and to_uppercase

Issue: 6439
@victorjulien
Copy link
Member

I think we should reject a sig like http.uri; to_uppercase; content:"lowercase"; or http.uri; to_lowercase; content:"UPPERCASE";

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 16438

@jlucovsky
Copy link
Contributor Author

I think we should reject a sig like http.uri; to_uppercase; content:"lowercase"; or http.uri; to_lowercase; content:"UPPERCASE";

Good point. Would you like that addressed in this PR or a separate one?

@jlucovsky jlucovsky marked this pull request as ready for review November 10, 2023 08:50
@jlucovsky
Copy link
Contributor Author

I think we should reject a sig like http.uri; to_uppercase; content:"lowercase"; or http.uri; to_lowercase; content:"UPPERCASE";

Good point. I'll update the PR with additional validation checks.

@jlucovsky
Copy link
Contributor Author

Continued in #9786

@jlucovsky jlucovsky closed this Nov 14, 2023
@jlucovsky jlucovsky deleted the 6439/1 branch November 17, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants