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

Implement ability to send js challenge according custom rules #2104

Open
EvgeniiMekhanik opened this issue Apr 18, 2024 · 1 comment
Open
Assignees
Milestone

Comments

@EvgeniiMekhanik
Copy link
Contributor

Currently if js challenge is enabled in our config we send js challenge to client on challengeble request (request with Accept header text/html). However, in CloudFare this is implemented differently. CloudFare allow the administrator to set up rules (which can be very defferent) according to which a challenge is sent to the client. It is a very good implementation, so we decide to implement the same ability in our config

@krizhanovsky
Copy link
Contributor

krizhanovsky commented Apr 18, 2024

We discussed in the chat that we should add a new ACTION for HTTPtables - jsch. I.e. we can write rules like

http_chain {
    hdr "accept" == '*; */*' -> jsch;
    mark == 1 -> jsch;

Please note that */* in the first rule can be in any place of the the value, so we might need something like '*/*', so we need #496 for this (there is no strict dependency, but we do need regexps for real work with HTTPtables).

Also please create a functional tests for this feature or a task for the tests.

This JSCH usage should be deployed on our website

With the discussion #2025 (comment) need to add a best practice examples to the Wiki how to properly configure JSCH based on Accept header. E.g. see https://developers.cloudflare.com/waf/reference/cloudflare-challenges/

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

When branches are created from issues, their pull requests are automatically linked.

3 participants