Add support for HTTP Basic authentication over TLS-protected connections (RFC 7617) - #812
Add support for HTTP Basic authentication over TLS-protected connections (RFC 7617)#812bsriramprasad wants to merge 12 commits into
Conversation
| protect bearer tokens against replay attacks.</para> | ||
| <para>An ONVIF compliant device should authenticate an RTSP request at the RTSP level. If HTTP is used to tunnel the RTSP request the device shall not authenticate on the HTTP level.</para> | ||
| <para>When authenticating RTSP or HTTP methods, an ONVIF compliant device shall use digest authentication [RFC 2617] or JWT-based authorization. The credentials shall be managed with the GetUsers, CreateUsers, DeleteUsers and SetUser methods. If the device also supports WS-Security, the same set of credentials shall be used.</para> | ||
| <para>When authenticating RTSP or HTTP methods, an ONVIF compliant device shall use digest authentication [RFC 2617], HTTP Basic authentication [RFC 7617] or JWT-based authorization. The credentials shall be managed with the GetUsers, CreateUsers, DeleteUsers and SetUser methods. If the device also supports WS-Security, the same set of credentials shall be used.</para> |
There was a problem hiding this comment.
Is HTTP Basic authentication really to be applicable for RTSP?
There was a problem hiding this comment.
RTSP 1.0 mandates Basic
RTSP2.0 does not mention Basic
|
General note: It could a bit of backward compatibility issue for clients. They could expect no HTTP digest for HTTPS connection (as it was required before). Also for all currently existing profiles using of HTTP digest for HTTPS to be the expected behavior. There were no exceptions before. |
Latest changes addresses your concern. |
|
@bsriramprasad what problem are we trying to? I am not a fan of HTTP basic auth, de facto it is equivalent of removing the password. We already had issues in the past with profile Q, I have the feeling we are repeating the story here. Small provocation: isn't certificate based client authentication enough? Adding Basic Auth will imply that by mistake vendor will implement HTTP + Basic Auth, you can take this for granted. |
|
@ocampana-videotec — taking your points in turn.
Agreed, and that is why the constraint has to be testable rather than advisory. Profile Q's mitigation was deployment guidance. This one is normative and checkable. The requirements now in the PR:
Each maps to a conformance assertion:
We can work with the tool vendor to test it well.
I would argue the comparison does not hold on the points that mattered. Profile Q mandated anonymous access to all commands in the factory default state, and because profile specifications cannot be amended without breaking interoperability, deprecation was the only remedy available. This is optional, capability-gated, requires the full credential rather than removing authentication, and sits in Core — revisable in any future release. The lesson I do take from Profile Q is the one above: advisory mitigation is insufficient, so the constraint belongs in conformance testing.
Core already permits JWT bearer tokens over HTTPS, and a bearer token is equally a plaintext credential in a header protected solely by the transport. The Security Service also specifies The one case where Basic is genuinely worse is a client that does not validate the server certificate: a MITM can present a Basic-only challenge and recover the password, where Digest would yield only a spent nonce. That is a real gap and I would propose closing it explicitly:
mTLS binds authentication to the TLS connection, so it survives only where TLS is passed through to the device. Any intermediary that terminates TLS breaks it — which is the deployment this addresses. It also carries per-client certificate issuance, renewal, and revocation overhead. It is already permitted in Core and has not displaced digest in practice.
Interoperability with TLS-only deployments and with architectures where digest cannot be forwarded. Digest binds its response hash to the request URI, so it survives an intermediary that preserves the path but breaks under path rewriting — which is how most multi-tenant cloud fleets are addressed. It also degrades in stateless environments such as autoscaled gateways and serverless invocations, where the nonce counter has nowhere to live. Authentication mechanisms in ONVIFClient → Device (inbound)
Device → Authorization Server (outbound)Defined in the ONVIF Security Service Specification for OAuth 2.0 client registration:
Gap addressed by this proposal. No existing inbound mechanism survives both TLS termination and path rewriting at an intermediary without requiring external infrastructure:
Basic is the only mechanism that clears both conditions using device-local credentials with no external infrastructure. It is additive — digest remains mandatory in every 401 — so no existing deployment or client is affected. |

Add support for HTTP Basic authentication only over TLS-protected connections (RFC 7617)
Motivation
As ONVIF devices increasingly operate in cloud-connected and TLS-only deployments, the current specification's exclusive reliance on HTTP Digest authentication creates friction for modern integration patterns:
Cloud and proxy architectures: - Digest binds its response hash to the request URI, so it breaks whenever a gateway rewrites paths. A cloud service addressing cameras as
/devices/cam-42/onvif/device_serviceand forwarding to/onvif/device_serviceinvalidates every Digest response. The gateway must then authenticate to each device itself, which means storing anHA1per device. Basic is stateless and path-independent, so it forwards unchanged. The trade-off is that it requires TLS with validated certificates.Regulatory direction: The EU Cyber Resilience Act and NIS2 push deployments toward encrypted-by-default transport, making TLS-everywhere a common baseline.
Interoperability with standard HTTP clients and tooling: HTTP Basic works out of the box in every HTTP client library, browser, and automation tool. Digest needs custom handling and is missing from many stacks.
This change introduces HTTP Basic authentication as an optional, TLS-only feature with an explicit capability signal (
HttpBasic).Compatibility Analysis
HttpBasicis optional; per existing Core convention, an omitted capability indicates the device does not support it.WWW-Authenticatechallenge as HTTP requires; the capability is for configuration and planning, not negotiation.HttpBasicboolean attribute indevicemgmt.wsdl(GetServiceCapabilities path).Normative Requirements
A device that supports HTTP Basic authentication shall signal the
HttpBasiccapability as true and shall:Authorizationheader using the Basic scheme over a TLS-protected connection, even if no challenge was sent;WWW-Authenticateheader of each 401 response sent over a TLS-protected connection;WWW-Authenticateheader offering only digest authentication when Basic credentials are received over a connection that is not TLS-protected;WWW-Authenticateheader of each 401 response.Each requirement maps to a conformance assertion:
Summary of Changes
doc/Core.xmlHttpBasicrow to Security capabilities (updatedmorerowscount)wsdl/ver10/device/wsdl/devicemgmt.wsdlSecurityCapabilitiesHttpBasicboolean attributeReferences