A simple and efficient logging server designed to run inside the host machine to stream logs from the AWS Nitro Enclave.
- GET
logs/stream
-- Creates an SSE connection which can be listened by the client to access realtime logs - GET
/logs/history?log_id=50&offset=10
-- Responds with the logs starting withoffset
number of logs starting from log id =log_id-1
- GET
/logs
-- Server html file in response to both stream and view log history out of the box
-
Clone the repository:
git clone https://github.com/your-repo/nitro-enclave-logger.git
-
Navigate to the project directory:
cd nitro-enclave-logger
-
Build the project in release mode:
cargo build --release
Before running the server, you need to grant it permission to bind to server port (default = 516). This is required because ports below 1024 are privileged, and binding to them normally requires root access.
-
Since the program by default uses port 516, run the command below to allow the program to bind to this privileged port:
sudo setcap 'cap_net_bind_service=+ep' ./target/release/logger
-
After setting the capabilities, you can run the server:
./target/release/logger
-
The server will start and listen for http requests on port 516.
- Ensure your firewall and security groups allow traffic on port 516 if you intend to access the server from outside the host machine.
- To reapply the capability (
setcap
) on the binary, run the command again after each rebuild.