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

Add allowed subnets constraint #204

Closed
wants to merge 1 commit into from
Closed

Conversation

i7an
Copy link

@i7an i7an commented Mar 18, 2023

To secure webhooks

@printercu
Copy link
Member

I believe you can implement it using rails routing or rack middleware. This doesn't seem to be related to the bot itself.

@i7an
Copy link
Author

i7an commented Mar 20, 2023

Yes you are right. But it would be more convenient if the constraint rule was included into the gem. Wdyt?

@printercu
Copy link
Member

I think secret_token is a better option for checking that request comes from telegram.

@printercu
Copy link
Member

printercu commented Mar 20, 2023

Although route path is already secret which provides enough security.

@i7an
Copy link
Author

i7an commented Mar 21, 2023

Im not a security expect. I just think that this is not a bad idea to add this IP constraint. For example Stripe webhooks security guide suggests the same thing:

Verify webhook signatures to confirm that received events are sent from Stripe. Additionally, Stripe sends webhook events from a set list of IP addresses. Only trust events coming from these IP addresses.

What concerns you? This could be simply an optional constraint which would come out of the box.

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.

2 participants