-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCloudGuardModule.affine
More file actions
84 lines (76 loc) · 2.88 KB
/
Copy pathCloudGuardModule.affine
File metadata and controls
84 lines (76 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (c) 2026 Jonathan D.A. Jewell
//
// CloudGuardModule.affine — capability-driven registration for the
// Cloudflare domain security management panel.
//
// Translation of src/modules/CloudGuardModule.res (93 LoC). Same shape
// as the other module files plus an extra `capabilityDescription`
// helper (CloudGuard tooltips include longer prose).
//
// Refs: standards#279, standards#252.
module CloudGuardModule;
use prelude::{Option, Some, None, contains};
type CloudguardCapability =
| DomainInventory
| SecurityHardening
| DnsManagement
| ComplianceAudit
| OfflineConfig
| BulkOperations
| PagesIntegration
| DnssecManagement
type CloudguardModuleConfig = {
id: String,
name: String,
version: String,
description: String,
apiEndpoint: String,
capabilities: [CloudguardCapability],
icon: Option<String>,
}
const config: CloudguardModuleConfig = #{
id: "cloudguard",
name: "CloudGuard",
version: "0.1.0",
description: "Cloudflare domain security management. Automates SSL/TLS hardening, DNS security records, WAF configuration, DNSSEC, and compliance auditing across all domains.",
apiEndpoint: "https://api.cloudflare.com/client/v4",
capabilities: [
DomainInventory,
SecurityHardening,
DnsManagement,
ComplianceAudit,
OfflineConfig,
BulkOperations,
PagesIntegration,
DnssecManagement,
],
icon: Some("shield"),
};
fn hasCapability(cap: CloudguardCapability) -> Bool {
contains(config.capabilities, cap)
}
fn capabilityLabel(cap: CloudguardCapability) -> String {
match cap {
DomainInventory => "Domain Inventory",
SecurityHardening => "Security Hardening",
DnsManagement => "DNS Management",
ComplianceAudit => "Compliance Audit",
OfflineConfig => "Offline Config",
BulkOperations => "Bulk Operations",
PagesIntegration => "Pages Integration",
DnssecManagement => "DNSSEC Management",
}
}
fn capabilityDescription(cap: CloudguardCapability) -> String {
match cap {
DomainInventory => "List and monitor all Cloudflare zones with plan tier, status, and nameserver info",
SecurityHardening => "Apply SSL Full (Strict), HSTS, min TLS 1.2, security headers, and other hardening defaults",
DnsManagement => "Create, update, and delete DNS records with templates for SPF, DMARC, DKIM, CAA, and TLSRPT",
ComplianceAudit => "Evaluate live Cloudflare settings against Trustfile/Nickel security policy constraints",
OfflineConfig => "Download zone configs as JSON, edit offline, upload with three-way diff and dry-run preview",
BulkOperations => "Apply hardening settings across all selected domains with real-time progress tracking",
PagesIntegration => "Set up Cloudflare Pages projects from GitHub repos with auto-detected SSG framework",
DnssecManagement => "Enable DNSSEC, verify DS records at registrar, monitor key rotation status",
}
}