feat(security): restrict /admin and /actuator to management port 9090#77
Draft
feat(security): restrict /admin and /actuator to management port 9090#77
Conversation
Agent-Logs-Url: https://github.com/fiap-tech-challenge-java/vigisus/sessions/d77cddbd-c0f0-4a8e-9fa8-d2d267a88ba8 Co-authored-by: rebecanonato89 <38442994+rebecanonato89@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fiap-tech-challenge-java/vigisus/sessions/5382e9a1-3499-4608-ad96-4af8c93601e8 Co-authored-by: rebecanonato89 <38442994+rebecanonato89@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Ensure /admin responds only on port 9090
feat(security): restrict /admin and /actuator to management port 9090
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ensures
/admin/**and/actuator/**endpoints are exclusively served on port 9090 (Spring Boot management context), never reachable on the public port 8080.Security config
/actuator/**fromSecurityConfigpermit-all rules — those routes don't exist on port 8080 whenmanagement.server.portdiffersmanagement.server.port: 9090and exposedhealth,info,metricsactuator endpointsAdmin dashboard (
/admin/**)New
AdminDashboardControllerannotated@Hidden(excluded from public Swagger):GET /admin/resumobuscas_total,buscas_ia,triagens,cache_hits,timestampGET /admin/top-municipios?top=NGET /admin/top-estados?top=NGET /admin/municipios-riscoGET /admin/buscas-iaGET /admin/index.htmlContent-Type: text/htmlset explicitly onResponseEntity)Metrics (
AdminMetricsService)In-memory counters backed by Micrometer — no high-cardinality tags to avoid unbounded registry growth:
BuscaCompletaUseCaseandTriagemServicecall intoAdminMetricsServiceto increment counters on each request.Docker
Added
"9090:9090"port mapping todocker-compose.ymlso the admin port is reachable for operators.⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.