pmcf 2.35.5 → 2.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/network-address.mjs +14 -4
- package/src/services/dns.mjs +10 -3
- package/types/network-address.d.mts +1 -1
package/package.json
CHANGED
package/src/network-address.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { familyIP, formatCIDR, decodeIP } from "ip-utilties";
|
|
2
2
|
import { Subnet } from "./subnet.mjs";
|
|
3
|
+
import { Owner } from "pmcf";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
*
|
|
@@ -32,12 +33,21 @@ export class NetworkAddress {
|
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
export function addresses(
|
|
36
|
+
export function addresses(sources, options) {
|
|
36
37
|
return [
|
|
37
38
|
...new Set(
|
|
38
|
-
[...
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
[...sources]
|
|
40
|
+
.map(s => {
|
|
41
|
+
if (options?.aggregate && s instanceof Owner && s.subnets) {
|
|
42
|
+
return [...s.subnets()];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return s.networkAddresses
|
|
46
|
+
? [...s.networkAddresses(options?.filter)]
|
|
47
|
+
: s;
|
|
48
|
+
})
|
|
49
|
+
.flat()
|
|
50
|
+
.map(object => decodeIP(object.address))
|
|
41
51
|
)
|
|
42
52
|
];
|
|
43
53
|
}
|
package/src/services/dns.mjs
CHANGED
|
@@ -224,10 +224,17 @@ export class DNSService extends ExtraSourceService {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
const acls = [
|
|
227
|
-
addressesStatement(
|
|
228
|
-
|
|
227
|
+
addressesStatement(
|
|
228
|
+
"acl trusted",
|
|
229
|
+
addresses(this.trusted, { aggregate: true })
|
|
230
|
+
),
|
|
231
|
+
addressesStatement(
|
|
232
|
+
"acl open",
|
|
233
|
+
addresses(this.open, { aggregate: true }),
|
|
234
|
+
true
|
|
235
|
+
),
|
|
229
236
|
addressesStatement("acl protected", [
|
|
230
|
-
...addresses(this.protected),
|
|
237
|
+
...addresses(this.protected, { aggregate: true }),
|
|
231
238
|
"!open"
|
|
232
239
|
])
|
|
233
240
|
].flat();
|