Skip to content
fivexlPublic

About

A command-line tool to perform Local Health Check Probes inside Container Images (ECS, Docker)

Topics

Resources

Stars

54 stars

Watchers

1 watching

Forks

Repository files navigation

FivexL

Want practical AWS infrastructure insights?

👉 Subscribe to our newsletter to get:

  • Real stories from real AWS projects
  • No-nonsense DevOps tactics
  • Cost, security & compliance patterns that actually work
  • Expert guidance from engineers in the field

=========================================================================

Why LProbe?

A command-line tool to perform Local Health Check Probes inside Container Images (ECS, Docker, Kubernetes). When your container gets breached, the intruder/attacker can use tools like wget or curl to download more tools for further exploitation and lateral movement within your system. Thus we developed LProbe as wget/curl replacement for hardened and secure container images.

HOW TO

Local Run

./lprobe -port=8080 -endpoint=/

Local Run for gRPC

./lprobe -port=8080 -mode=grpc

Add to a Container Image

You can bundle the statically compiled LProbe in your container image. Choose a binary release and download it in your Dockerfile:

ARG LPROBE_VERSION=v0.0.6
ARG TARGETPLATFORM
RUN case ${TARGETPLATFORM} in \
         "linux/amd64")  LPROBE_ARCH=amd64  ;; \
         "linux/arm64")  LPROBE_ARCH=arm64  ;; \
    esac \
 && wget -qO/bin/lprobe https://github.com/fivexl/lprobe/releases/download/${LPROBE_VERSION}/lprobe-linux-${LPROBE_ARCH} \
 && chmod +x /bin/lprobe \
 && rm -f /usr/bin/wget

Add to a Container Image from the LProbe Container

FROM scratch
COPY --from=ghcr.io/fivexl/lprobe:0.0.6 /lprobe /bin/lprobe

Docker Healthcheck

HEALTHCHECK --interval=15s --timeout=5s --start-period=5s --retries=3 CMD [ "lprobe", "-mode=http", "-port=8080", "-endpoint=/healthz" ]

ECS Healthcheck

[ "CMD", "lprobe", "-port=8080", "-endpoint=/healthz"]

Kubernetes (K8s) Healthcheck

spec:
  containers:
  - name: server
    image: "[YOUR-DOCKER-IMAGE]"
    ports:
    - containerPort: 8080
    readinessProbe:
      exec:
        command: ["/bin/lprobe", "-port=8080", "-endpoint=/readiness"]
      initialDelaySeconds: 5
    livenessProbe:
      exec:
        command: ["/bin/lprobe", "-port=8080", "-endpoint=/liveness"]
      initialDelaySeconds: 10

It is possible to use Lprobe as mounted volume

To use Lprobe via volume mounts, you need to download the Lprobe binary and place it in the volume. Here is how you can do it:

  1. Download the Lprobe binary:
wget -qO ./Lprobe https://github.com/fivexl/lprobe/releases/download/v0.1.5/lprobe-linux-amd64
chmod +x ./Lprobe
  1. Update your Docker Compose file to mount the Lprobe binary:
services:
  nginx:
    image: nginx:latest
    volumes:
      - ./Lprobe:/Lprobe
    healthcheck:
      test: /Lprobe -mode=http -port=80 -endpoint=/
      interval: 60s
      retries: 3
      start_period: 10s
      timeout: 3s

Verify a Release

Releases from v0.2.3 on are signed keylessly by this repository's CI workflow and carry SPDX SBOMs and build provenance.

Binaries: check the checksum file's signature, then the binary against it.

cosign verify-blob checksums.txt \
  --bundle checksums.txt.sigstore.json \
  --certificate-identity-regexp '^https://github\.com/fivexl/lprobe/\.github/workflows/ci\.yml@refs/tags/v' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com
sha256sum --ignore-missing -c checksums.txt
gh attestation verify lprobe-linux-amd64 -R fivexl/lprobe

Container image:

cosign verify ghcr.io/fivexl/lprobe:0.2.3 \
  --certificate-identity-regexp '^https://github\.com/fivexl/lprobe/\.github/workflows/ci\.yml@refs/tags/v' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com
gh attestation verify oci://ghcr.io/fivexl/lprobe:0.2.3 -R fivexl/lprobe

The SBOM is attached to each platform image (0.2.3-amd64, 0.2.3-arm64v8); read it with cosign verify-attestation --type spdxjson and the same identity flags.

Dev Guide

export GO111MODULE=on
go mod init lprobe
go mod tidy
go run .
go mod edit -go=1.21
go get -u -t -x ./...
go mod tidy

Source Code Used

Weekly Review Link

About

A command-line tool to perform Local Health Check Probes inside Container Images (ECS, Docker)

Topics

Resources

Stars

54 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages