Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Comments on Best practices for company internal Swagger Docs in production

Parent

Best practices for company internal Swagger Docs in production

+5
−0

The current project I am working on consists of a bunch of microservices (Web APIs) accessible only internally using Entra ID (formerly Azure ID).

To simplify the development, all services expose Swagger Docs, but our SRE told us that Swagger Docs should be disabled in production.

I understand the risks of publicly exposing Swagger Docs in production (increased attack surface, information exposure, unauthorized access risks), but I think none of these apply to the case of having an internal Swagger Docs:

  • access is limited to internal users
  • non-prod Swagger Docs is accessible. That means that even with Prod Swagger Docs disabled, anyone with prod access can use a bearer token and Postman (or similar) to call an accessible endpoint

Does disabling Swagger Docs for the production environment make sense when all endpoints are accessible internally only?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Maybe host swagger separately? (4 comments)
Post
+1
−2

Disabling Swagger docs is a terrible idea even for a public API. Swagger saves the consumer an enormous amount of development and testing. We're talking weeks or months of work done in seconds, with far less opportunity for human error than a hand-coded client. Swagger is so valuable that if you don't publish Swagger docs for your API, you don't have a minimum viable product.

Also note that your title differs from your question body. Swagger docs and the Swagger UI are different things. My answer applies to your question body.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

1 comment thread

Yes, for public APIs (2 comments)
Yes, for public APIs
Alexei‭ wrote 12 months ago

I agree about publicly available APIs (where the API is the product). I guess the referenced question dealt with not explicitly exposed APIs (e.g., those consumed by a SPA).

My question deals with internally accessible ones though.

Kevin Krumwiede‭ wrote 12 months ago

My answer applies even more to internal APIs because it's your own time and money that you're saving.