Sign inSign up

elvenobservability/collector-fe-instrumentation

By elvenobservability

Updated 2 months ago

Secure, lightweight log collector with JWT auth and Loki integration. 🚀

Image
API management
0

4.2K

elvenobservability/collector-fe-instrumentation repository overview

Collector Front-end Instrumentation

Collector Front-end Instrumentation is a lightweight and secure microservice built in Go, designed for efficient log collection and processing. It provides robust authentication and authorization mechanisms using JWT (JSON Web Tokens) to ensure data integrity and access control. This service is optimized for performance and scalability, making it an ideal choice for observability stacks.

Features
  • JWT Authentication Middleware: Implements strict token validation, including support for mandatory claims (role, iss) and optional expiration (exp) validation.
  • Role-Based Access Control (RBAC): Ensures access is granted based on user roles (e.g., admin, user) for fine-grained security.
  • Extensive Logging: Captures detailed security events, including invalid tokens, expired tokens, and unauthorized access attempts.
  • Customizable Configuration: Environment-based settings for secret keys, issuers, token validation preferences, and external integrations.
  • Loki Integration: Securely forwards logs to Loki for centralized log management and observability.
  • Lightweight and Fast: Written in Go for high performance with minimal resource usage.
Use Cases
  • Centralized Logging: Collect logs from distributed services and securely forward them to Loki for analysis.
  • Observability: Enhance your monitoring setup by acting as a secure entry point for telemetry data.
  • Multi-Tenant Security: Enforce tenant isolation and security in multi-user environments.
How to Use
  1. Pull the Docker Image

    docker pull your-username/collector-faro-logs-go
    
  2. Run the Container

    docker run -d \
      -e SECRET_KEY="your-secret-key" \
      -e JWT_ISSUER="trusted-issuer" \
      -e JWT_VALIDATE_EXP="true" \
      -e LOKI_URL="https://your-loki-url/loki/api/v1/push" \
      -e LOKI_TENANT_ID="your-tenant-id" \
      -e LOKI_API_TOKEN="your-loki-api-token" \
      -e ALLOW_ORIGINS="*" \
      -p 8080:8080 \
      your-username/collector-faro-logs-go
    
  3. Access the API Use your API client to send authenticated requests with JWT tokens to the exposed endpoint.

Environment Variables
  • SECRET_KEY: The key used to sign and validate JWTs (minimum 32 characters).
  • JWT_ISSUER: The expected token issuer.
  • JWT_VALIDATE_EXP: Enables or disables token expiration validation (true or false).
  • LOKI_URL: The URL of the Loki endpoint for log forwarding.
  • LOKI_TENANT_ID: The tenant ID used for multi-tenant log forwarding in Loki.
  • LOKI_API_TOKEN: The API token for authentication with Loki.
  • ALLOW_ORIGINS: Specifies allowed origins for cross-origin resource sharing (CORS).
Contribute

Contributions are welcome! Check out the repository and submit a pull request to improve the project.

License

This project is licensed under the Apache 2.0 License.

Tag summary

Content type

Image

Digest

sha256:68f9f95b2

Size

10.1 MB

Last updated

2 months ago

docker pull elvenobservability/collector-fe-instrumentation