-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Only allow HTTP requests authorized by the committee #3427
Conversation
let response = Client::new() | ||
.request(request.method.into(), request.url) | ||
.request(request.method.into(), url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we whitelist also methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's needed. We could make the allow list more complicated, mapping hosts to a set of allowed methods, but where do we draw the line? We could also limit headers, ports, etc. Right now I'm assuming that the allowed HTTP servers will be safe to communicated with.
## Motivation In integration tests, the `ResourceControlPolicy` was hardcoded to use the default value. With the addition of an HTTP allow list (#3427), the tests aren't able to test any HTTP requests. ## Proposal Allow changing the `ResourceControlPolicy` used inside a test, allowing to add hosts to the allow list. For the policy change to work, a new committee and epoch must be published. Therefore the epoch and committee can't be assumed to be constant anymore. ## Test Plan Wrote some (upcoming) tests that try to perform an HTTP request without changing the policy and after adding the host to the policy, and ensured that the former fails while the latter succeeds. ## Release Plan - These changes follow the usual release cycle, because this will help with tests that use a feature that has not yet been released. ## Links - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1438770
to
509c313
Compare
Allow configuring the HTTP allow list for genesis.
Store on chain the HTTP allow list.
Fail if an attempt is made to perform an HTTP request to a host that's not in the `ResourceControlPolicy`.
Ensure that end-to-end tests using local networks can perform HTTP queries to `localhost`.
Move it from the `linera_net_tests` to the `local_net_tests`, so that it is allowed to perform HTTP requests.
Use the new size of the valid block.
509c313
to
397dc90
Compare
Motivation
For security reasons, we would like to initially limit the hosts that applications can send HTTP requests to.
Proposal
Add an allow-list of hosts to the
ResourceControlPolicy
configured by a committee. Only perform HTTP requests in the execution state actor if the target host is in the list.Test Plan
Tests that exercise the allow list were added in PR #3509.
Release Plan
Links