Description
🚀 Feature Proposal
For all Grid Components (Hub, Node, Router, etc.) it would be beneficial to allow storing request access logs to assist in investigating unauthorized access. Per recommendation of security engineers, these access logs should include (apache combined log format & X-Forwarded-For):
- Client IP
- Timestamp
- HTTP Method
- Path
- HTTP Response Code
- User agent
- Number of byes returned to the client
- Referer
- X-Forwarded-For
These can either be:
- Stored within a file
- Embedded within the OpenTelemetry Data (though I'd need to research how to export it out and into its own dedicated file)
I noticed OpenTelemetry already has some of the data (method, path, status code, IP although unsure if that's the client or the host machine's ip).
If Grid utilized Reactor Netty, access logs likely could be easily enabled.
My search for "netty access logs" only show Reactor Netty, which is why I concluded it's not possible to do with Netty out of the box.
Motivation
Security Engineers may ask for services to log requests. While it's possible to put Nginx (with logs) in front of Grid Hub or Router, the requests to Grid Node are not logged. It's important to see what kinds of requests were made across all nodes, in the event there are unauthorized requests.
In Se3 Grid, it was possible to put Nginx in front of a Node, and launch the node with -remoteHost "http://NODE_IP:80"
(port 80 so that the hub would pass requests through nginx, and nginx forward to 5555). The -remoteHost
flag appears to have been removed in Se4 Alpha.
Example
- Launch
java -jar selenium-server-4.0.0-alpha-7.jar hub --access-log-file access.log
or within the config something like:
[logging]
# Configure logging
# Type: boolean
enable = true
# Store Access Logs within a file
# Type: string
access_log_file = access.log
- Make a request to http://localhost:4444/status
- Within
access.log
a line like:
127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /status HTTP/1.1" 200 2326 "http://localhost:4444/status" "selenium/3.141.59 (java unix)"