feat(firewall): add IP set blocking convenience API with CIDR interval support and optional rule comments

This commit is contained in:
2026-04-26 15:05:50 +00:00
parent 75dacef68e
commit 6e7c0d90d8
9 changed files with 106 additions and 8 deletions
+20
View File
@@ -73,9 +73,29 @@ export interface INftIPSetConfig {
name: string;
type: 'ipv4_addr' | 'ipv6_addr' | 'inet_service';
elements?: string[];
/** Enable interval sets so CIDR/range elements can be stored. */
interval?: boolean;
comment?: string;
}
export interface INftIPSetBlockOptions {
/** Name of the nftables set to create and match against. */
setName?: string;
/** IPs or CIDR ranges to add to the set. */
ips: string[];
/** Chain to apply the block rule to. Default: input. */
direction?: 'input' | 'forward';
/** Set type. Defaults to ipv4_addr for the default ip family. */
type?: 'ipv4_addr' | 'ipv6_addr';
/** Optional rule comment. */
comment?: string;
}
export interface INftCleanupOptions {
/** Delete the table even when this process did not initialize it. */
force?: boolean;
}
// ─── Rule Group (tracking unit) ───────────────────────────────────
export interface INftRuleGroup {
id: string;