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

[cisco asa] grok processor warnings shown to user after installing assets #9489

Closed
jsvd opened this issue Apr 2, 2024 · 3 comments · Fixed by #9549
Closed

[cisco asa] grok processor warnings shown to user after installing assets #9489

jsvd opened this issue Apr 2, 2024 · 3 comments · Fixed by #9549
Assignees
Labels
bug Something isn't working, use only for issues Integration:cisco_asa Cisco ASA Team:Security-Deployment and Devices Deployment and Devices Security team [elastic/sec-deployment-and-devices]

Comments

@jsvd
Copy link
Member

jsvd commented Apr 2, 2024

Users installing the cisco asa integration assets will see a ton of warnings from the grok processors of the ingest pipeline like these:

{"@timestamp":"2024-04-02T08:31:15.388Z", "log.level": "WARN", "message":"character class has '-' without escape", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"elasticsearch[842c754572cb][clusterApplierService#updateTask][T#1]","log.logger":"org.elasticsearch.ingest.common.GrokProcessor","trace.id":"d5081cdf94809442f375412f6cc67640","elasticsearch.cluster.uuid":"VAsFZ8L2QguoE-lnApbNWA","elasticsearch.node.id":"UkMqtRt-RsScdsarV3IAxw","elasticsearch.node.name":"842c754572cb","elasticsearch.cluster.name":"elasticsearch"}
{"@timestamp":"2024-04-02T08:31:15.391Z", "log.level": "WARN", "message":"nested repeat operator '+' and '?' was replaced with '*' in regular expression /(?:(?<CISCO_DOMAIN_USER:_temp_.cisco.source_username>((?:(LOCAL\\\\)?((?:\\b(?:[0-9A-Za-z][0-9A-Za-z-]{0,62})(?:\\.(?:[0-9A-Za-z][0-9A-Za-z-]{0,62}))*(\\.?|\\b))\\\\)?))?(?:[^,$)]+)?)\\$?\\)?(?:(, *((?:((?<NUMBER:_temp_.cisco.source_user_security_group_tag>(?:(?:(?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+)))))))):(?:((?<WORD:_temp_.cisco.source_user_security_group_tag_name>\\b\\w+\\b)))|(?:((?<NUMBER:_temp_.cisco.source_user_security_group_tag>(?:(?:(?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))))))))))|((?:((?<NUMBER:_temp_.cisco.source_user_security_group_tag>(?:(?:(?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+)))))))):(?:((?<WORD:_temp_.cisco.source_user_security_group_tag_name>\\b\\w+\\b))))))|(?:(?<CISCO_DOMAIN_USER:_temp_.cisco.source_username>((?:(LOCAL\\\\)?((?:\\b(?:[0-9A-Za-z][0-9A-Za-z-]{0,62})(?:\\.(?:[0-9A-Za-z][0-9A-Za-z-]{0,62}))*(\\.?|\\b))\\\\)?))?(?:[^,$)]+)?)\\$?\\)?)/", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"elasticsearch[842c754572cb][clusterApplierService#updateTask][T#1]","log.logger":"org.elasticsearch.ingest.common.GrokProcessor","trace.id":"d5081cdf94809442f375412f6cc67640","elasticsearch.cluster.uuid":"VAsFZ8L2QguoE-lnApbNWA","elasticsearch.node.id":"UkMqtRt-RsScdsarV3IAxw","elasticsearch.node.name":"842c754572cb","elasticsearch.cluster.name":"elasticsearch"}

Seems related to elastic/beats#36326, and overall lack of escaping of certain characters and non-optimal design of the regexes.

@jsvd jsvd changed the title [cisco] grok processor warnings shown to user after installing assets [cisco asa] grok processor warnings shown to user after installing assets Apr 2, 2024
@ebeahan ebeahan added Integration:cisco_asa Cisco ASA Team:Security-Deployment and Devices Deployment and Devices Security team [elastic/sec-deployment-and-devices] labels Apr 2, 2024
@elasticmachine
Copy link

Pinging @elastic/sec-deployment-and-devices (Team:Security-Deployment and Devices)

@pkoutsovasilis pkoutsovasilis self-assigned this Apr 8, 2024
@pkoutsovasilis pkoutsovasilis added the enhancement New feature or request label Apr 8, 2024
@pkoutsovasilis
Copy link
Contributor

pkoutsovasilis commented Apr 8, 2024

So after investigating this one, I can see why regex engine on Elasticsearch side is throwing the respective warnings

so a basic regex example

regex ([^,$)]+)?:

  • with + we match the previous token between one and unlimited times
  • with ? we match the previous token between zero and one times

so essentially the regex engine is saying to us hey I will replace the combo of +)? with * as it is effectively the same.

about the hyphen warning this is not escaped inside the [...] so again it makes total sense

Preparing a fix to mitigate the warnings

@pkoutsovasilis pkoutsovasilis added bug Something isn't working, use only for issues and removed enhancement New feature or request labels Apr 8, 2024
@elasticmachine
Copy link

Package cisco_asa - 2.32.1 containing this change is available at https://epr.elastic.co/search?package=cisco_asa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, use only for issues Integration:cisco_asa Cisco ASA Team:Security-Deployment and Devices Deployment and Devices Security team [elastic/sec-deployment-and-devices]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants