TL; DR: I have exactly the same problem as “Short lived certificates and browser renderings (https://community.cloudflare.com/t/short-lived-certificates-and-browser-renderings/292326
)”. Is there any workaround?
Situation: Browser SSH doesn’t treat short-lived cert
I’m using Cloudflare Tunnel proxying into my private network via SSH over HTTPS with short-lived certificate authentication enabled.
As the the server and IdP username don’t match, I adapted the workaround with AuthorizedPrincipalsFile
directive in sshd_config.
With this setting, short-lived certs auth works really nicely with ssh
command with cloudflared
as a proxy command.
Then I tried to use it also on Browser SSH, as the documentation states (https://developers.cloudflare.com/cloudflare-one/identity/users/short-lived-certificates/#connect-through-a-browser-based-terminal
):
End users can connect to the SSH session without any configuration by using Cloudflare’s browser-based terminal. Users visit the URL of the application and Cloudflare’s terminal handles the short-lived certificate flow. To enable, follow the instructions here.
As I’ve already set up Browser SSH, I open the tunnel URL in browser (both Safari and Google Chrome tested). But what I came up with is:
- Login Panel (if login info haven’t expired; otherwise this is skipped)
- Username prompt
- Login prompt for SSH, stating that
Alternatively, you can use short-lived certificates for seamless authentication using your SSO.
, although I’ve already setup the server to accept short-lived certs!:
At this point, I have no idea how to proceed with short-lived cert auth with Browser SSH.
I would appreciate if someone provide a hint to enable short-lived certs only on Browser SSH.
I attach the configuration detail below for reference.
Thank you in advance.a
Configuration Details
I have the following configuration (with sub/domain and port details anonymised):
Server: Running SSH on non-well-known port (say, 2222
)
Running cloudflared
daemon.
Tunnel: configured with Cloudflare Web UI
- Binding
tunnel.<my-domain>.com
tossh://127.0.0.1:2222
in Public Hostname pane. Private Network
has no item at all.- At the first try, this was set up solely with cloudflared CLI command, which also did not work. Then I switched to
Application “Tunnel”: Pointing to tunnel.<my-domain>.com
.
- Type: Browser SSH
- Overview:
- Application Appearance:
- Enable App Launcher
- Use default (first domain will be used): tunnel..com
- Use custom domain:
- Block pages:
- Identity failure block page:
Cloudflare default
- Cloudflare error text:
Unauthorized
- Non-identity failure block page:
Cloudflare default
- Identity failure block page:
- Application Appearance:
- Policies: Only 1 (Allow admin)
Allow
,include
my email as the only rule.- Additional settings
- Purpose Justification
- Purpose justification prompt: empty
- Temporary authentication
- Email addresses of the approvers: empty
- Authentication:
- Accept all available identity providers
- Manually select identity providers:
GitHub
only - Instant Auth
- Skip identity provider selection if only one is configured
Settings
- CORS Settigns
- Access-Control-Allow-Credentials
- Access-Control-Max-Age (seconds):
86400
- Access-Control-Allow-Origin:
- Allow all origins
- values:
*
- Access-Control-Allow-Methods: Allow all methods
- Access-Cotrol-Allow-Headers: Allow all headers, header name empty.
- Cookie Settings:
- HTTP Only
- Enable Binding Cookie
- Enforce cookie path attribute
- Same Site Attribute:
- Additional Settings:
- Enable automatic cloudflared authentication
- Browser Rendering: SSH