Skip to content

feat: expose only public /health for uptime checks - #101

Merged
hugoalves-dev merged 2 commits into
mainfrom
feature/public-health-check-only
Oct 26, 2026
Merged

hugoalves-dev merged 2 commits into
mainfrom
feature/public-health-check-only

Conversation

@hugoalves-dev

Copy link
Copy Markdown
Owner

Purpose

Expose a single unauthenticated application health endpoint for Uptimely, without routing the Actuator management port (8081) to the public internet.

Changes

  • Define a Spring Boot Actuator uptime health group including all health contributors, with additional-path: server:/health and show-details: never.
  • Permit only GET /health for anonymous callers on the app's existing public port 8080.
  • Preserve management port 8081, existing Docker health checks, internal Prometheus, and the existing Actuator access rules.

Security boundaries

  • Expected public: GET https://jobapply-api.hugojava.dev/health returning a status-only JSON body and HTTP 200 when healthy (503 when DOWN).
  • Not newly published: GET /actuator/health, /actuator/prometheus, /actuator/metrics, or anything else on port 8080. Port 8081 remains private by Docker/ingress topology.
  • The broad /actuator/** permit rule remains for the already-private management port; tighten it separately only after identifying internal telemetry consumers.

Verification after deployment

curl -i https://jobapply-api.hugojava.dev/health
curl -i https://jobapply-api.hugojava.dev/actuator/metrics

Confirm the first returns 200 and status UP; the second must not expose actuator data.

Reference: https://docs.spring.io/spring-boot/4.1/reference/actuator/endpoints.html#actuator.endpoints.health-groups

@github-actions

Copy link
Copy Markdown

Qodana for JVM

It seems all right 👌

No new problems were found according to the checks applied

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2025.3.2
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@hugoalves-dev
hugoalves-dev merged commit 01d398e into main Oct 26, 2026
6 checks passed
@hugoalves-dev
hugoalves-dev deleted the feature/public-health-check-only branch October 26, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant