Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Keep TLS policy honest for an explicitly plain-HTTP endpoint

pulse-triage[bot]a66ae5ce862e
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/__tests__/NodeCredentialSlot.test.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/__tests__/NodeCredentialSlot.test.tsx
index 30f21bfaf6..ec6476f4af 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/__tests__/NodeCredentialSlot.test.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/__tests__/NodeCredentialSlot.test.tsx
@@ -319,7 +319,9 @@ describe('NodeCredentialSlot', () => {
));
expect(screen.getByText('Cluster members')).toBeInTheDocument();
- expect(screen.getByText('Unreachable')).toBeInTheDocument();
+ expect(screen.getByText(/Unreachable — details/, { selector: 'summary' })).toHaveTextContent(
+ 'Unreachable — details for pve2',
+ );
const pve1Input = screen.getByLabelText('Connection address for pve1') as HTMLInputElement;
const pve2Input = screen.getByLabelText('Connection address for pve2') as HTMLInputElement;
diff --git a/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx b/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
index 97731c57ae..27426343e4 100644
--- a/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
+++ b/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
@@ -28,11 +28,20 @@ export const NodeModalMonitoringSection: Component<NodeModalMonitoringSectionPro
const tlsPolicy = createMemo(() => {
// Match the TLS client's precedence, not the checkbox alone. This is a
// description of form inputs, never evidence that a peer was verified.
+ if (state.formData().host.trim().toLowerCase().startsWith('http://')) {
+ return {
+ title: 'TLS is not used for HTTP',
+ description:
+ 'This HTTP URL does not use TLS: neither the checkbox nor a fingerprint authenticates the server or protects credentials in transit. Do not switch to HTTP to bypass a certificate error.',
+ tone: 'danger' as const,
+ };
+ }
if (state.formData().fingerprint !== '') {
return {
title: 'Certificate fingerprint required',
description:
'The fingerprint takes precedence over the checkbox. This endpoint must present the matching certificate, even if its certificate chain is trusted or verification is unchecked.',
+ tone: 'info' as const,
};
}
if (state.formData().verifySSL) {
@@ -40,12 +49,14 @@ export const NodeModalMonitoringSection: Component<NodeModalMonitoringSectionPro
title: 'Trusted certificate chain required',
description:
'With no fingerprint set, this endpoint must present a valid, hostname-matching certificate with a chain trusted by the Pulse runtime.',
+ tone: 'info' as const,
};
}
return {
title: 'Certificate identity not verified',
description:
'With no fingerprint and verification unchecked, these settings do not authenticate the server. Encryption alone does not protect credentials from an impersonated endpoint.',
+ tone: 'danger' as const,
};
});
@@ -87,9 +98,7 @@ export const NodeModalMonitoringSection: Component<NodeModalMonitoringSectionPro
</p>
</div>
<InlineNotice
- tone={
- state.formData().fingerprint === '' && !state.formData().verifySSL ? 'danger' : 'info'
- }
+ tone={tlsPolicy().tone}
role="status"
aria-label="Form TLS policy"
aria-live="polite"
diff --git a/frontend-modern/src/components/Settings/__tests__/NodeModalMonitoringSection.test.tsx b/frontend-modern/src/components/Settings/__tests__/NodeModalMonitoringSection.test.tsx
index f6cccb71f3..9070db64d1 100644
--- a/frontend-modern/src/components/Settings/__tests__/NodeModalMonitoringSection.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/NodeModalMonitoringSection.test.tsx
@@ -7,7 +7,7 @@ import { NodeModalMonitoringSection } from '../NodeModalMonitoringSection';
function renderMonitoring(
nodeType: NodeModalProps['nodeType'] = 'pve',
- trust: { verifySSL?: boolean; fingerprint?: string } = {},
+ trust: { verifySSL?: boolean; fingerprint?: string; host?: string } = {},
) {
const onSave = vi.fn();
const fetch = vi.fn();
@@ -267,6 +267,29 @@ describe('NodeModalMonitoringSection collection safety', () => {
expect(fetch).not.toHaveBeenCalled();
});
+ it.each(['pve', 'pbs', 'pmg'] as const)(
+ 'does not present a checked box or a pin as TLS protection for an HTTP %s endpoint',
+ (nodeType) => {
+ const { fetch, onSave } = renderMonitoring(nodeType, {
+ host: 'HTTP://fixture.example.invalid',
+ verifySSL: true,
+ fingerprint: 'ab'.repeat(32),
+ });
+ const policy = screen.getByRole('status', { name: 'Form TLS policy' });
+ expect(policy).toHaveTextContent('TLS is not used for HTTP');
+ expect(policy).toHaveTextContent('neither the checkbox nor a fingerprint authenticates');
+ expect(policy).toHaveTextContent('Do not switch to HTTP to bypass a certificate error');
+ const verification = screen.getByRole('checkbox', { name: 'Verify SSL certificate' });
+ expect(verification).toHaveAccessibleDescription(/does not use TLS/);
+ expect(verification).toBeChecked();
+ expect(screen.getByRole('textbox', { name: 'SSL Fingerprint (optional)' })).toHaveValue(
+ 'ab'.repeat(32),
+ );
+ expect(onSave).not.toHaveBeenCalled();
+ expect(fetch).not.toHaveBeenCalled();
+ },
+ );
+
it('updates the policy and descriptions as the operator edits, without silently changing trust', () => {
const { fetch } = renderMonitoring();
const policy = screen.getByRole('status', { name: 'Form TLS policy' });