Skip to content

Commit bbd1341

Browse files
committed
tweak security settings too
1 parent d37e6cf commit bbd1341

File tree

1 file changed

+60
-56
lines changed

1 file changed

+60
-56
lines changed

site/src/pages/DeploySettingsPage/SecuritySettingsPage/SecuritySettingsPageView.tsx

Lines changed: 60 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -23,66 +23,70 @@ export const SecuritySettingsPageView = ({
2323
options: options,
2424
featureAuditLogEnabled,
2525
featureBrowserOnlyEnabled,
26-
}: SecuritySettingsPageViewProps): JSX.Element => (
27-
<>
28-
<Stack direction="column" spacing={6}>
29-
<div>
30-
<Header
31-
title="Security"
32-
description="Ensure your Coder deployment is secure."
33-
/>
26+
}: SecuritySettingsPageViewProps): JSX.Element => {
27+
const tlsOptions = options.filter((o) =>
28+
deploymentGroupHasParent(o.group, "TLS"),
29+
)
3430

35-
<OptionsTable
36-
options={useDeploymentOptions(
37-
options,
38-
"SSH Keygen Algorithm",
39-
"Secure Auth Cookie",
40-
"Disable Owner Workspace Access",
41-
)}
42-
/>
43-
</div>
31+
return (
32+
<>
33+
<Stack direction="column" spacing={6}>
34+
<div>
35+
<Header
36+
title="Security"
37+
description="Ensure your Coder deployment is secure."
38+
/>
4439

45-
<div>
46-
<Header
47-
title="Audit Logging"
48-
secondary
49-
description="Allow auditors to monitor user operations in your deployment."
50-
docsHref={docs("/admin/audit-logs")}
51-
/>
40+
<OptionsTable
41+
options={useDeploymentOptions(
42+
options,
43+
"SSH Keygen Algorithm",
44+
"Secure Auth Cookie",
45+
"Disable Owner Workspace Access",
46+
)}
47+
/>
48+
</div>
5249

53-
<Badges>
54-
{featureAuditLogEnabled ? <EnabledBadge /> : <DisabledBadge />}
55-
<EnterpriseBadge />
56-
</Badges>
57-
</div>
50+
<div>
51+
<Header
52+
title="Audit Logging"
53+
secondary
54+
description="Allow auditors to monitor user operations in your deployment."
55+
docsHref={docs("/admin/audit-logs")}
56+
/>
5857

59-
<div>
60-
<Header
61-
title="Browser Only Connections"
62-
secondary
63-
description="Block all workspace access via SSH, port forward, and other non-browser connections."
64-
docsHref={docs("/networking#browser-only-connections-enterprise")}
65-
/>
58+
<Badges>
59+
{featureAuditLogEnabled ? <EnabledBadge /> : <DisabledBadge />}
60+
<EnterpriseBadge />
61+
</Badges>
62+
</div>
6663

67-
<Badges>
68-
{featureBrowserOnlyEnabled ? <EnabledBadge /> : <DisabledBadge />}
69-
<EnterpriseBadge />
70-
</Badges>
71-
</div>
64+
<div>
65+
<Header
66+
title="Browser Only Connections"
67+
secondary
68+
description="Block all workspace access via SSH, port forward, and other non-browser connections."
69+
docsHref={docs("/networking#browser-only-connections-enterprise")}
70+
/>
7271

73-
<div>
74-
<Header
75-
title="TLS"
76-
secondary
77-
description="Ensure TLS is properly configured for your Coder deployment."
78-
/>
72+
<Badges>
73+
{featureBrowserOnlyEnabled ? <EnabledBadge /> : <DisabledBadge />}
74+
<EnterpriseBadge />
75+
</Badges>
76+
</div>
7977

80-
<OptionsTable
81-
options={options.filter((o) =>
82-
deploymentGroupHasParent(o.group, "TLS"),
83-
)}
84-
/>
85-
</div>
86-
</Stack>
87-
</>
88-
)
78+
{tlsOptions.length > 0 && (
79+
<div>
80+
<Header
81+
title="TLS"
82+
secondary
83+
description="Ensure TLS is properly configured for your Coder deployment."
84+
/>
85+
86+
<OptionsTable options={tlsOptions} />
87+
</div>
88+
)}
89+
</Stack>
90+
</>
91+
)
92+
}

0 commit comments

Comments
 (0)