惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Darknet – Hacking Tools, Hacker News & Cyber Security
N
News and Events Feed by Topic
N
News | PayPal Newsroom
SecWiki News
SecWiki News
P
Privacy International News Feed
T
Troy Hunt's Blog
Attack and Defense Labs
Attack and Defense Labs
N
News and Events Feed by Topic
L
LINUX DO - 热门话题
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Security Latest
Security Latest
AWS News Blog
AWS News Blog
S
Secure Thoughts
W
WeLiveSecurity
H
Heimdal Security Blog
T
Threat Research - Cisco Blogs
I
Intezer
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Security @ Cisco Blogs
G
GRAHAM CLULEY
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Spread Privacy
Spread Privacy
L
Lohrmann on Cybersecurity
C
CERT Recently Published Vulnerability Notes
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google Online Security Blog
Google Online Security Blog
Cisco Talos Blog
Cisco Talos Blog
雷峰网
雷峰网
Cloudbric
Cloudbric
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
Latest news
Latest news
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
D
Docker
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
H
Help Net Security
博客园 - 司徒正美
TaoSecurity Blog
TaoSecurity Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Check Point Blog
博客园 - 叶小钗

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Spring Boot Actuator in Production: The Endpoints I Left Open by Accident and How I Closed Them
Juan Torchia · 2026-05-11 · via DEV Community

Spring Boot Actuator in Production: The Endpoints I Left Open by Accident and How I Closed Them

I was reviewing the configuration of a Spring Boot 3.x backend I've been building — the same one I talked about in Jakarta EE vs Spring Boot — when I did something I should have done on day one: a simple curl against /actuator.

The response hit me like a bucket of cold water.

{
  "_links": {
    "self":        { "href": "http://localhost:8080/actuator" },
    "beans":       { "href": "http://localhost:8080/actuator/beans" },
    "health":      { "href": "http://localhost:8080/actuator/health" },
    "info":        { "href": "http://localhost:8080/actuator/info" },
    "env":         { "href": "http://localhost:8080/actuator/env" },
    "loggers":     { "href": "http://localhost:8080/actuator/loggers" },
    "metrics":     { "href": "http://localhost:8080/actuator/metrics" },
    "mappings":    { "href": "http://localhost:8080/actuator/mappings" },
    "threaddump":  { "href": "http://localhost:8080/actuator/threaddump" },
    "heapdump":    { "href": "http://localhost:8080/actuator/heapdump" }
  }
}

Enter fullscreen mode Exit fullscreen mode

Ten endpoints. No authentication. /actuator/env exposing environment variables. /actuator/heapdump serving a full JVM heap dump to anyone who asked for it.

A pure "wait, this is just... open?" moment.

My conclusion, after researching and locking all of this down, is blunt: Spring Boot Actuator's defaults are reasonable for local development, but they're a trap in production, and the official documentation presents them with a tone that softens the real risk. If you don't configure Actuator with intention, you're betting that nobody finds it.


What Gets Exposed by Default

Spring Boot 3.x only exposes two endpoints via HTTP by default: health and info. But that's only half the story.

The problem is:

  1. /actuator (the index) is enabled and public — it enumerates everything that exists.
  2. If you add spring-boot-starter-actuator without additional configuration, the index reveals available endpoints even if not all of them are exposed via HTTP.
  3. In environments with management.endpoints.web.exposure.include=* — which is exactly what appears in a thousand "how to monitor your Spring Boot app" tutorials — you blow the whole board open in one shot.

I ran a simple enumeration script against the backend on a staging environment configured as a production replica:

#!/bin/bash
# Actuator audit script — reproducible on any Spring Boot 3.x
BASE_URL="http://localhost:8080"

echo "=== Enumerating Actuator endpoints ==="
curl -s "$BASE_URL/actuator" | python3 -m json.tool

echo ""
echo "=== Testing /actuator/env (may expose secrets) ==="
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$BASE_URL/actuator/env")
echo "HTTP Status: $STATUS"

echo ""
echo "=== Testing /actuator/heapdump (full heap dump) ==="
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$BASE_URL/actuator/heapdump")
echo "HTTP Status: $STATUS — If this is 200, you have a serious problem."

Enter fullscreen mode Exit fullscreen mode

What I found in the environment with sloppy configuration (the infamous exposure.include=* copied from a Prometheus tutorial):

Endpoint HTTP Status Risk
/actuator/env 200 Critical — exposes environment variables, including partially masked keys
/actuator/beans 200 High — reveals the entire internal Spring bean structure
/actuator/heapdump 200 Critical — downloadable JVM heap dump, may contain in-memory secrets
/actuator/mappings 200 Medium — full mapping of all HTTP endpoints in the app
/actuator/threaddump 200 Medium — state of all threads, useful for fingerprinting
/actuator/loggers 200 Medium — allows changing log levels at runtime via POST
/actuator/health 200 Low (with detail disabled)
/actuator/info 200 Low (with minimal info)

/actuator/env was the one that worried me most. It was returning something like this:

{
  "propertySources": [
    {
      "name": "systemEnvironment",
      "properties": {
        "DATABASE_URL": {
          "value": "jdbc:postgresql://****:5432/mydb",
          "origin": "System Environment Property"
        },
        "JWT_SECRET": {
          "value": "******",
          "origin": "System Environment Property"
        }
      }
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Spring masks values with ****** for properties it detects as sensitive — but the detection is name-based. If the variable is called MY_SIGNING_KEY instead of JWT_SECRET, the value shows up in plain text. It's not a guarantee, it's a heuristic.


The Lockdown Process: application.properties + Spring Security

After mapping the attack surface, I built the hardening in two layers. The first layer is pure configuration; the second is Spring Security.

Layer 1 — application.properties

# ============================================================
# Actuator — Production hardening
# ============================================================

# Only expose the endpoints we actually need operationally
management.endpoints.web.exposure.include=health,info,metrics

# The /actuator index enumerates available endpoints — close it
management.endpoints.web.exposure.exclude=beans,env,heapdump,threaddump,loggers,mappings,sessions

# Health: details only for authenticated requests
management.endpoint.health.show-details=when-authorized
management.endpoint.health.show-components=when-authorized

# Info: only expose what we explicitly configure
management.info.env.enabled=false
management.info.java.enabled=false
management.info.os.enabled=false

# Move Actuator to an internal port (not exposed on the load balancer)
# Optional but recommended if your infrastructure allows it
management.server.port=8081

# Disable endpoints we don't use even if they're not exposed via HTTP
management.endpoint.heapdump.enabled=false
management.endpoint.threaddump.enabled=false
management.endpoint.env.enabled=false
management.endpoint.beans.enabled=false

Enter fullscreen mode Exit fullscreen mode

The separate port option (management.server.port=8081) is the cleanest approach if your infrastructure allows it. On Railway, for example, the publicly exposed port is the PORT env var — if Actuator runs on 8081 and you only expose PORT externally, the management endpoints are unreachable from the internet directly.

I covered more about JVM configuration and Railway in Spring Boot in production: what the documentation omits.

Layer 2 — Spring Security

The properties configuration is necessary but not sufficient. If Security is misconfigured, or if someone touches that config in the future without context, everything can reopen. The second layer is the seatbelt:

@Configuration
@EnableWebSecurity
public class ActuatorSecurityConfig {

    @Bean
    public SecurityFilterChain actuatorFilterChain(HttpSecurity http) throws Exception {
        http
            // Apply this config only to Actuator paths
            .securityMatcher("/actuator/**")
            .authorizeHttpRequests(auth -> auth
                // Health and info are public — for load balancer health checks
                .requestMatchers("/actuator/health/**").permitAll()
                .requestMatchers("/actuator/info").permitAll()
                // Metrics only for users with MONITORING role
                .requestMatchers("/actuator/metrics/**").hasRole("MONITORING")
                // Any other Actuator endpoint requires ADMIN
                .anyRequest().hasRole("ADMIN")
            )
            // Actuator doesn't need CSRF — it's an internal API
            .csrf(csrf -> csrf
                .ignoringRequestMatchers("/actuator/**")
            )
            // No sessions for Actuator — stateless
            .sessionManagement(session -> session
                .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
            )
            .httpBasic(Customizer.withDefaults());

        return http.build();
    }
}

Enter fullscreen mode Exit fullscreen mode

This approach uses the multiple SecurityFilterChain pattern that Spring Boot 3.x recommends. The Actuator chain has its own logic and doesn't interfere with the rest of the app's security.


The Gotchas Nobody Mentions in Tutorials

After locking everything down and running the audit again, I hit three situations that caught me off guard and are worth documenting.

1. Detailed /actuator/health breaks load balancer health checks

When you configure show-details=when-authorized, the /actuator/health endpoint returns 200 OK with a minimal body for unauthenticated requests — which is correct. But some corporate health checkers expect to see "status": "UP" in the body and parse the JSON. Verify that whatever health checker you're using works with the reduced body:

{ "status": "UP" }

Enter fullscreen mode Exit fullscreen mode

Railway uses the HTTP status code (200 = healthy), not the body — so there's no drama there. But if you're coming from a setup with an AWS ALB or a Kubernetes probe that validates the body, test it before deploying.

2. management.endpoint.X.enabled=false vs exposure.exclude — they're not the same thing

  • exposure.exclude removes the endpoint from the HTTP list but leaves it enabled internally (JMX, etc.)
  • enabled=false disables it completely across all transports

For endpoints like heapdump and env, use both. The reason: if someone in the future adds a monitoring dependency that enables JMX, an endpoint that's only excluded from HTTP can reappear.

3. The /actuator/loggers POST is a write endpoint

/actuator/loggers/{name} accepts POST to change log levels at runtime. If that endpoint stays open, any attacker can crank logging up to TRACE and potentially generate enormous logs (disk exhaustion), or dial security-relevant levels down to OFF. Closing it isn't optional.


Attack Surface Comparison: Before and After

I ran the same audit script before and after hardening. The result:

# Before hardening (with exposure.include=*)
Endpoints accessible without auth: 10
Endpoints with sensitive information: 3 (env, beans, heapdump)
Endpoints with write capability: 2 (loggers, shutdown*)

# After hardening
Endpoints accessible without auth: 2 (basic health, info)
Endpoints with sensitive information accessible without auth: 0
Endpoints with write capability accessible without auth: 0

Enter fullscreen mode Exit fullscreen mode

The shutdown endpoint deserves a special mention: it's disabled by default in Spring Boot 3.x, but if you ever enabled it for testing and forgot to revert it, it's a POST /actuator/shutdown that kills the JVM. I check for it explicitly in the audit script.

This kind of attack surface is relevant if you're thinking about end-to-end security, including encryption of data in transit — something I explored in more depth in the Themis vs Web Crypto API post.


FAQ — Spring Boot Actuator Security in Production

Which Actuator endpoints does Spring Boot expose via HTTP by default?

In Spring Boot 3.x, only health and info are exposed via HTTP by default. However, if you use management.endpoints.web.exposure.include=* (common in Prometheus or Grafana setups copied from tutorials), all available endpoints get exposed at once. The /actuator index is always visible and enumerates what's there.

What sensitive information can /actuator/env expose?

/actuator/env exposes all of Spring's configuration sources: system environment variables, application.properties properties, JVM system properties, and more. Spring masks values whose names contain words like password, secret, or key, but the detection is name-convention-based — it's not foolproof. Variables with non-standard names can show up in plain text.

Is management.endpoints.web.exposure.exclude enough to protect endpoints?

No. exclude only controls HTTP exposure. The endpoints remain enabled for other transports (JMX) and remain discoverable if you know the direct path. Complete protection requires combining exclude, enabled=false for the most critical endpoints, and Spring Security for the ones you leave open.

How do I protect /actuator/health without breaking load balancer health checks?

Configure management.endpoint.health.show-details=when-authorized. Unauthenticated requests get {"status":"UP"} or {"status":"DOWN"} with HTTP 200/503 — enough for most HTTP-status-based health checkers. Verify that yours doesn't parse the body before deploying.

What's the best practice for Actuator in a microservices architecture?

Move Actuator to an internal port (management.server.port=8081) and don't expose that port on the load balancer or public ingress. Monitoring tools (Prometheus, Grafana) access it from the internal network; external users never have direct access. Combined with Spring Security on that port, the attack surface gets very small.

Is /actuator/heapdump as dangerous as it sounds?

Yes. A heap dump contains the complete state of JVM memory at the moment of capture: objects in memory, strings, internal data structures. In an app that handles JWT tokens, database connections, or any user session data, a heap dump captured by an attacker is essentially a data breach. Disable it in production unless you need it for active debugging under controlled access.


The Official Docs Soften the Real Risk

The official Spring Boot Actuator documentation does say clearly that "for production, we recommend ensuring that only the health and info endpoints are exposed." But the tone is a recommendation, not a strong warning. And the viral "integrate Prometheus with Spring Boot" tutorials jump straight to exposure.include=* without mentioning that it opens the heapdump to the world.

My point after building this checklist: Actuator is a powerful observability tool, but it ships configured for development convenience, not production resilience. The cost of not auditing it is high; the cost of locking it down properly is low — an afternoon of work, two configuration files.

If you've been reading my posts on pnpm vs npm in my monorepo or functional programming in TypeScript, you already know my approach is to validate in concrete scenarios before making recommendations. Same thing applies here: don't trust the default. Run the audit script, see what it returns, then decide what to close.

The final checklist I use now for any Spring Boot backend before going to production:

# Actuator pre-production checklist — Spring Boot 3.x
# 1. Check which endpoints are exposed
curl -s http://localhost:8080/actuator | python3 -m json.tool

# 2. Confirm /actuator/env returns 401 or 404
curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/actuator/env

# 3. Confirm /actuator/heapdump returns 401 or 404
curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/actuator/heapdump

# 4. Confirm /actuator/beans returns 401 or 404
curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/actuator/beans

# 5. Verify basic health still responds for the load balancer
curl -s http://localhost:8080/actuator/health

# Expected result in production:
# env → 401 or 404 ✓
# heapdump → 401 or 404 ✓
# beans → 401 or 404 ✓
# health → 200 with {"status":"UP"} ✓

Enter fullscreen mode Exit fullscreen mode

If any of the first three returns 200 without authentication, you stop the deploy and fix it. No excuses.


Sources:


This article was originally published on juanchi.dev