-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add official Docker image and optional CORS filter #225
Conversation
Needs further testing but is ready for a draft review. One thing not addressed here is SSL/TLS/HTTPS. Users wanting to configure Tomcat for HTTPS directly will need to mount an alternate |
803852b
to
f369605
Compare
Another piece to figure out: on the Axiom docker-erddap repo, @ocefpaf asked that some public indication that an ERDDAP is running in Docker be added for auditing purposes. axiom-data-science/docker-erddap#90 Since the plan is to move to an official ERDDAP docker image, that should be implemented in this repo. If the Axiom image continues to be maintained with experimental features it will inherit from the official base image. @ChrisJohnNOAA Any thoughts on adding such an indicator? It could only live on |
I think having the (Docker) in the footer version string would be good. |
This (SSL/https configuration) should definitely be at least explained in a readme. I want to look more into it, but I'm wondering if the default should be a setup with ssl/https (one of my goals is to make it easy for folks to get a well configured secure server up and running), and then an advanced configuration for setups with a web proxy layer that handles the ssl (even if "advanced" is what 90% of people end up using). Also just for clarification, is the cors configuration here needed because it's assumed to be behind a web proxy or is there another reason it's needed? |
I haven't looked at the cors configuration in the Docker image, but I can tell you that any site scanned by either Qualys or Nessus scans, which include at least most NOAA sites, will have that flagged immediately, and if memory serves as a high-risk vulnerability with only a short time-line to remedy it. I think the best default setup is CORS disabled, with instructions on how to enable it if needed and/or desired, and those instructions should also point out that it can create a vulnerability and failure to pass security scans. As an aside, the test implementation of ERDDAP 2.25 passed both sets of scans. |
@ChrisJohnNOAA Are you thinking of having a self-signed cert be used as the default if an external cert isn't provided? I think the easiest way to get users to proper SSL if they're not handling it in a web proxy or buying/generating a cert out of band is to provide a letsencrypt example using an HTTP-01 challenge. That should be doable in a docker-compose.yml example using nginx-proxy and acme-companion. And maybe the fallback is a self signed cert? @rmendels Absolutely CORS will be disabled by default. I think it's helpful to have it available because there are a growing number of in-browser apps which pull data from ERDDAP APIs directly and require CORS to be configured. I will add some options to limit the allowed domains which will hopefully appease the scanners somewhat when it's enabled. |
I hadn't thought through the how to do it yet. Your idea to provide a letsencrypt example sounds good. If the goal is to be as simple to setup as possible, it'd be better to not require the users provide a cert. |
@ChrisJohnNOAA If possible I'd like to split the SSL/letsencrypt example to a separate issue. I have the Docker image and CORS support in a fairly good place (pending a few small updates) and IMO the cert management is related but enough of a separate concern to handle in its own PR. Thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A separate change for ssl/let's encrypt sounds good.
I believe you need to make EDStatic.enableCors not final so that you can set it in tests. |
Yeah, I have some local changes that I haven’t yet had the opportunity to finalize. Please hold off on merging for now…
…________________________________
From: Chris John ***@***.***>
Sent: Friday, January 17, 2025 7:09:57 AM
To: ERDDAP/erddap ***@***.***>
Cc: St Savage, Shane ***@***.***>; Author ***@***.***>
Subject: Re: [ERDDAP/erddap] Add official Docker image and optional CORS filter (PR #225)
⚠ CAUTION: This email originated from an external sender. Verify the source before opening links or attachments. ⚠
I believe you need to make EDStatic.enableCors not final so that you can set it in tests.
—
Reply to this email directly, view it on GitHub<#225 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAIWBTF43SIPMLZVZ4J67S32LEMMLAVCNFSM6AAAAABQ7YKUROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJYGU3TGNZQG4>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
8457375
to
17985df
Compare
Ok, this is ready for final review/merging. Summary of changes:
|
@ocefpaf Please see previous comment for a description of a new deployment metadata setting which the official Dockerfile will set to
|
…setting Adapts development Dockerfile from @roje-bodc and @MattHopsonNOC and Axiom Dockerfile to a new official ERDDAP Docker image. Also adds an optional internally managed CORS filter (enabled by setting `enableCors=true` in settings). CORS filter behavior can be modified using settings variables corsAllowHeaders and corsAllowOrigin. Also adds deploymentInfo setting and a json format of ERDDAP version information, which can be used to add deployment metadata (e.g. docker) viewable in an ERDDAP version json response (set header "Accept: application/json" or query parameter "format=json" to /erddap/version
I'm also planning to add this information as a Prometheus info metric. |
Description
Type of change
Checklist before requesting a review