obl-ong / panel

Multi-tenant domain services built with Ruby on Rails, open source and forever free. Powering the obl.ong domain registry.
https://obl.ong
20 stars 5 forks source link

Dynamic DNS support (DynDNS2) & Automated token flows #67

Open reesericci opened 5 months ago

reesericci commented 5 months ago

I think it makes sense to support dynamic DNS updating with the DynDNS2 spec, since it's the industry standard with routers & applications.

However, DynDNS uses HTTP basic auth and this would require allowing the issuing of permanent access tokens for dynamic DNS updating (not refresh tokens). This could be a security risk as an attacker could gain control of the access token and utilize it to change the IP address of a record indefinitely unless the token is revoked.

I believe that we can mitigate this risk in these ways:

I think this could make more sense even for applications like #51 over the device flow which requires the user to re-auth fairly often. Having an "automated token" flow that allows the user - from the domain dashboard for instance - to make tokens with long expiration dates and without a specific client in mind, like personal access tokens, but are extremely narrow in scope. Like say updating individual records I think would be the most common usecase for this, or for ACME/other TXT verification, only allowing creation & deletion of records that have specific regex like "_acme_challenge". A grant flow to exchange for an automated token also would make sense, like initial ACME.sh setup could use the device grant to then save an automated token. However, this would require integrating with Doorkeeper, rather than being a new API (which might be the way to go).

reesericci commented 5 months ago

We should also probably support the duckdns API with the same automated token flow: http://www.duckdns.org/spec.jsp