v3: Close unauthenticated remote access to the CachedDataServer
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- authentication, backend-api-design, security
Research direction
Start by reading server/cached_data_server.py and utils/install_openrvdas.sh to trace the open WebSocket and HTTP paths. Then inspect the listed Django and display consumers, logger host configurations, and UDPReader behavior to resolve the compatibility decisions. Done means remote access is protected, supported consumers still work through the authenticated proxy, and external users are told how to migrate.
Written by the indexing model from the issue text.
Description
Problem
The CachedDataServer has no authentication, and anyone on the network can reach it in two ways:
- Port 8766 directly.
server/cached_data_server.pybinds withwebsockets.serve(..., host='', port=...), which listens on all interfaces. It serves both the WebSocket protocol and the plain-HTTP/fieldsand/latest/<fields>routes. - nginx
/cds-ws.utils/install_openrvdas.shproxies/cds-wsstraight tolocalhost:8766with no auth, in both the Django and React nginx configs.
Any client that can reach either path can read every cached value and write to the cache with {"type": "publish", ...}. Published values are pushed to every subscriber (display widgets, Grafana and so on), and they look the same as real instrument data.
Authenticated path is now available
The FastAPI backend provides /api/v1/ws/data-server, an authenticated proxy to the CDS that accepts a JWT or an API key with the WEBSOCKET permission. It refuses publish (OceanDataTools/fastapi-template#39, #40). Remote clients have a protected way in, but it doesn't protect anything while the two open paths above remain.
Proposed change (v3, once the Django UI is retired)
- Bind the CDS to
127.0.0.1by default, with a setting or flag for installs that need otherwise. - Remove the
/cds-wslocation from the nginx configs generated byinstall_openrvdas.sh. - Point remaining remote consumers at
/api/v1/ws/data-server. - Document the change for anyone with external tools on 8766 or
/cds-ws.
Things that will break or need a decision
- Django GUI.
django_gui/static/django_gui/websocket.jsconnects to/cds-ws(WEBSOCKET_PATHindjango_gui/settings.py). That's why this waits for v3. - Standalone display widgets.
display/js/widgets/settings.js.distalso uses/cds-ws. These need to move to the authenticated proxy, which means a token or API key in the page, or a decision that they're retired with Django. - Loggers on other hosts.
CachedDataReaderandCachedDataWritertake adata_serverhost:port, and logger configs can run on hosts other than the one running the CDS. A logger on another machine that reads from or writes to the CDS breaks if the CDS binds only to localhost. Writes can't move to the proxy, since it refusespublish. Options: keep an opt-in non-localhost bind for multi-host installs, or add an authenticated write path for logger hosts. - UDP input. If the CDS runs with
--udp,UDPReaderlistens on all interfaces, which is another unauthenticated write path. The installer doesn't enable it by default, but it should be covered by the same setting or documented. - External tools (Grafana datasources, scripts using
/latest/...) that hit 8766 or/cds-wsdirectly need to switch to the proxy and an API key.
- Dominant language
- Python
- Stars
- 57
- Forks
- 30
- Avg merge
- 3h 14m
- Merged PRs (30d)
- 56
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OceanDataTools/openrvdas
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
OceanDataTools/openrvdas#760 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
OceanDataTools/openrvdas#758 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 58/100
OceanDataTools/openrvdas#743 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
OceanDataTools/openrvdas#721 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 54/100
OceanDataTools/openrvdas#717 ·
Maintainers usually reply within 1 day
All issues in OceanDataTools/openrvdas
Similar issues
-
automated endpoint-dead needs-curation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
almanac-data/climate-almanac#138 ·
Maintainers usually reply within 1 day
-
level/subtask type/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
wazuh/wazuh-virtual-machines#1091 ·
Maintainers usually reply within 1 day
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentPossibly taken @halcyon-past claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/semantic-kernel#14824 · 1 comment ·
Maintainers usually reply within 3 days
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
stack314/django-neolith#142 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
LedgerHQ/app-bitcoin-legacy#306 ·