@sentriflow/core 0.4.0 → 0.4.2
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/README.md +10 -4
- package/package.json +1 -1
- package/src/pack-loader/format-detector.ts +2 -10
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# @sentriflow/core
|
|
2
2
|
|
|
3
|
-
Core engine for SentriFlow - a network configuration
|
|
3
|
+
Core engine for SentriFlow - a network configuration validator.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
`@sentriflow/core` provides the fundamental building blocks for parsing and analyzing network device configurations across multiple vendors,
|
|
7
|
+
`@sentriflow/core` provides the fundamental building blocks for parsing and analyzing network device configurations across multiple vendors, validating them against policy rules—whether industry best practices or your organization's specific requirements.
|
|
8
|
+
|
|
9
|
+
SentriFlow is a validation tool that assesses configuration alignment with policies and standards.
|
|
8
10
|
|
|
9
11
|
## Installation
|
|
10
12
|
|
|
@@ -18,7 +20,7 @@ bun add @sentriflow/core
|
|
|
18
20
|
|
|
19
21
|
- **Multi-vendor support**: Cisco IOS/NX-OS, Juniper JunOS, Arista EOS, Fortinet FortiGate, Palo Alto PAN-OS, and more
|
|
20
22
|
- **AST-based parsing**: Converts configurations into a vendor-agnostic Abstract Syntax Tree
|
|
21
|
-
- **Extensible rule engine**: Define
|
|
23
|
+
- **Extensible rule engine**: Define validation rules for best practices or organization-specific policies
|
|
22
24
|
- **IP/Subnet Extraction**: Extract and deduplicate IP addresses and CIDR subnets from configurations
|
|
23
25
|
- **GRX2 Loader**: Load and decrypt extended encrypted rule packs for offline usage
|
|
24
26
|
- **TypeScript native**: Full type safety with comprehensive type definitions
|
|
@@ -173,9 +175,13 @@ try {
|
|
|
173
175
|
## Related Packages
|
|
174
176
|
|
|
175
177
|
- [`@sentriflow/cli`](https://github.com/sentriflow/sentriflow/tree/main/packages/cli) - Command-line interface
|
|
176
|
-
- [`@sentriflow/rules-default`](https://github.com/sentriflow/sentriflow/tree/main/packages/rules-default) - Default
|
|
178
|
+
- [`@sentriflow/rules-default`](https://github.com/sentriflow/sentriflow/tree/main/packages/rules-default) - Default validation rules
|
|
177
179
|
- [`@sentriflow/rule-helpers`](https://github.com/sentriflow/sentriflow/tree/main/packages/rule-helpers) - Helper functions for rule development
|
|
178
180
|
|
|
181
|
+
## Disclaimer
|
|
182
|
+
|
|
183
|
+
SentriFlow provides automated configuration validation. Validation results do not constitute compliance certification.
|
|
184
|
+
|
|
179
185
|
## License
|
|
180
186
|
|
|
181
187
|
Apache-2.0
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ import { resolve } from 'node:path';
|
|
|
13
13
|
/**
|
|
14
14
|
* Detected pack format
|
|
15
15
|
*/
|
|
16
|
-
export type PackFormat = 'grx2' | '
|
|
16
|
+
export type PackFormat = 'grx2' | 'unencrypted' | 'unknown';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Priority tiers by format.
|
|
@@ -21,13 +21,11 @@ export type PackFormat = 'grx2' | 'grpx' | 'unencrypted' | 'unknown';
|
|
|
21
21
|
*
|
|
22
22
|
* - unknown: 0 (fallback, should not occur in normal operation)
|
|
23
23
|
* - unencrypted: 100 (plain JS/TS modules)
|
|
24
|
-
* -
|
|
25
|
-
* - grx2: 300 (extended encrypted format)
|
|
24
|
+
* - grx2: 300 (GRX2 encrypted format)
|
|
26
25
|
*/
|
|
27
26
|
export const FORMAT_PRIORITIES: Record<PackFormat, number> = {
|
|
28
27
|
unknown: 0,
|
|
29
28
|
unencrypted: 100,
|
|
30
|
-
grpx: 200,
|
|
31
29
|
grx2: 300,
|
|
32
30
|
};
|
|
33
31
|
|
|
@@ -36,7 +34,6 @@ export const FORMAT_PRIORITIES: Record<PackFormat, number> = {
|
|
|
36
34
|
*/
|
|
37
35
|
const MAGIC_BYTES = {
|
|
38
36
|
GRX2: Buffer.from('GRX2', 'ascii'),
|
|
39
|
-
GRPX: Buffer.from('GRPX', 'ascii'),
|
|
40
37
|
} as const;
|
|
41
38
|
|
|
42
39
|
const MAGIC_BYTES_LENGTH = 4;
|
|
@@ -88,11 +85,6 @@ export async function detectPackFormat(filePath: string): Promise<PackFormat> {
|
|
|
88
85
|
return 'grx2';
|
|
89
86
|
}
|
|
90
87
|
|
|
91
|
-
// Check for GRPX magic bytes
|
|
92
|
-
if (buffer.equals(MAGIC_BYTES.GRPX)) {
|
|
93
|
-
return 'grpx';
|
|
94
|
-
}
|
|
95
|
-
|
|
96
88
|
// No magic bytes match - treat as unencrypted module
|
|
97
89
|
return 'unencrypted';
|
|
98
90
|
} catch (error) {
|