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(whitelist): Whitelist logic reformulated again #1061

Conversation

n4ch04
Copy link
Contributor

@n4ch04 n4ch04 commented Mar 8, 2022

Context

Current whitelisting logic did not detect whitelisted element if includes POSIX character classes

Description

Reformulate whitelisting logic to detect POSIX character classes into whitelisted element

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

include/outputs Show resolved Hide resolved
if [[ "${checked_value}" == *"${resource_value}"* ]]; then
# To set WARNING flag checked_value have to include value of resource_value
# If it is treated as only expanse (*[]*) will not detect regex like [:alpha:]
if [[ "${checked_value}" =~ ${resource_value} ]]; then
Copy link

Choose a reason for hiding this comment

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

This look good! Thanks for sorting it out :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're welcome !!

ghost
ghost previously approved these changes Mar 8, 2022
Copy link
Member

@sergargar sergargar left a comment

Choose a reason for hiding this comment

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

Thank you @wobblesprout

Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

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

Good job @n4ch04

🔝

@jfagoagas jfagoagas merged commit f04b174 into master Mar 11, 2022
@jfagoagas jfagoagas deleted the PRWLR-238-whitelisting-doesnt-match-example-in-whitelist-sample-txt branch March 11, 2022 09:15
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.

3 participants