Repository navigation
Make agent IP mandatory #89
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| id: no-uds-listener | ||
| language: Rust | ||
| severity: error | ||
| message: | | ||
| HTTP servers here listen on TCP only. A Unix-domain-socket listener gives requests no peer address, and the | ||
| handlers take the client address from the socket peer rather than from client-supplied `Forwarded` / | ||
| `X-Forwarded-For` headers -- so `ws_handler` refuses every request arriving on one. Bind a TCP address instead. | ||
| rule: | ||
| pattern: $SERVER.$METHOD($$$ARGS) | ||
|
Check warning on line 9 in config/ast-grep/rules/no-uds-listener.yaml
|
||
| constraints: | ||
| METHOD: | ||
| regex: ^(bind_uds|listen_uds)$ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| id: no-uds-listener | ||
| valid: | ||
| - | | ||
| fn serve() { | ||
| let _server = HttpServer::new(app).bind(("127.0.0.1", 8080)); | ||
| } | ||
| - | | ||
| fn serve(listener: std::net::TcpListener) { | ||
| let _server = HttpServer::new(app).listen(listener); | ||
| } | ||
| invalid: | ||
| - | | ||
| fn serve() { | ||
| let _server = HttpServer::new(app).bind_uds("/run/et.sock"); | ||
| } | ||
| - | | ||
| fn serve(listener: std::os::unix::net::UnixListener) { | ||
| let _server = HttpServer::new(app).listen_uds(listener); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.