korext 0.9.11 → 1.0.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.
Files changed (3) hide show
  1. package/README.md +88 -74
  2. package/bin/korext.js +25 -6
  3. package/package.json +23 -12
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
- # Korext CLI
1
+ # KOREXT CLI
2
2
 
3
- Enforce compliance on AI-generated code from the command line and CI/CD pipelines. 478 rules across 44 policy packs with real detection logic. Every violation mapped to specific regulatory clauses. SARIF output for CI scanner integration.
3
+ AI Code Governance for your terminal and CI/CD pipelines.
4
+
5
+ Enforce compliance policies on human written and AI generated code. 72 policy packs. 532 detection rules. 13 languages. Cryptographically signed proof bundles.
4
6
 
5
7
  ## Install
6
8
 
@@ -11,115 +13,127 @@ npm install -g korext
11
13
  ## Quick Start
12
14
 
13
15
  ```bash
16
+ # Sign in
14
17
  korext login
15
- korext enforce ./src --pack web-platform-v2
18
+
19
+ # Initialize your project
20
+ korext init
21
+
22
+ # Enforce policies on your code
23
+ korext enforce .
24
+
25
+ # Enforce with specific packs
26
+ korext enforce . --pack web,pci-dss-v1
27
+
28
+ # Enforce with a specific region
29
+ korext enforce . --region eu --pack web
30
+
31
+ # Generate a signed proof bundle
32
+ korext enforce . --pack web --sign
16
33
  ```
17
34
 
18
35
  ## Commands
19
36
 
20
37
  | Command | Description |
21
38
  |---------|-------------|
22
- | `korext login [token]` | Save API token |
23
- | `korext status` | Check connection and subscription |
24
- | `korext enforce [dir]` | Scan files for violations |
25
- | `korext policy init` | Initialize a policy document |
26
- | `korext policy extract` | AI rule extraction from documents |
27
- | `korext policy review` | Review extracted rules |
28
- | `korext rules sync` | Cache rules for offline use |
29
-
30
- ### Enforce Options
31
-
32
- | Flag | Description |
33
- |------|-------------|
34
- | `--pack <id>` | Select a policy pack |
35
- | `--format text\|json\|sarif` | Output format |
36
- | `--offline` | Use cached rules only |
37
- | `--sync-rules` | Download rule cache before scan |
39
+ | `korext login` | Sign in to your KOREXT account |
40
+ | `korext init` | Initialize a project with korext.json |
41
+ | `korext enforce <path>` | Run policy enforcement on files |
42
+ | `korext packs list` | List all available policy packs |
43
+ | `korext industries` | List industries and their packs |
44
+ | `korext bundle list` | List your recent proof bundles |
45
+ | `korext bundle export <id>` | Download a proof bundle as PDF |
46
+ | `korext bundle verify <id>` | Verify a proof bundle signature |
47
+ | `korext status` | Show current configuration and region |
48
+
49
+ ## Enforce Options
50
+
51
+ | Flag | Description | Default |
52
+ |------|-------------|---------|
53
+ | `--pack <ids>` | Comma separated pack IDs | web |
54
+ | `--region <name>` | Data region (us, eu, apac) | us |
55
+ | `--format <type>` | Output format (text, json, sarif) | text |
56
+ | `--sign` | Request signed proof bundle | false |
57
+ | `--industry <name>` | Select packs by industry | (none) |
58
+ | `--offline` | Run with local engine only | false |
59
+
60
+ ## Output Formats
61
+
62
+ **Text** (default): Human readable violation list with governance context.
63
+
64
+ **JSON**: Machine readable output with full violation details, confidence scores, and proof bundle metadata.
65
+
66
+ **SARIF**: Static Analysis Results Interchange Format for CI/CD integration. Compatible with GitHub Code Scanning, Azure DevOps, and other SARIF consumers.
38
67
 
39
68
  ## CI/CD Integration
40
69
 
41
70
  ### GitHub Actions
42
71
 
43
72
  ```yaml
44
- - name: Korext Compliance Check
45
- run: |
46
- npm install -g korext
47
- korext enforce ./src \
48
- --pack cmmc-level2-v1 \
49
- --format sarif
73
+ - uses: korext/enforce-action@v3
74
+ with:
75
+ pack: web,pci-dss-v1
76
+ region: eu
50
77
  env:
51
78
  KOREXT_API_TOKEN: ${{ secrets.KOREXT_API_TOKEN }}
52
79
  ```
53
80
 
54
- ### Exit Codes
55
-
56
- | Code | Meaning |
57
- |------|---------|
58
- | `0` | Clean (no critical or high violations) |
59
- | `1` | Violations found |
60
- | `2` | Error |
61
-
62
- Writes GitHub Actions Step Summary via `GITHUB_STEP_SUMMARY` when detected.
63
-
64
- ## SARIF Output
81
+ ### Pre-commit Hook
65
82
 
66
83
  ```bash
67
- korext enforce ./src --format sarif > results.sarif
84
+ # .husky/pre-commit
85
+ korext enforce . --pack web
68
86
  ```
69
87
 
70
- Generates OASIS SARIF 2.1.0 for CI scanner integration (GitHub Code Scanning, Azure DevOps, etc.).
71
-
72
- ## Offline Mode
88
+ ### Generic CI
73
89
 
74
90
  ```bash
75
- korext rules sync
76
- korext enforce ./src --offline
91
+ npm install -g korext
92
+ korext login --token $KOREXT_API_TOKEN
93
+ korext enforce . --pack web --format sarif --sign
77
94
  ```
78
95
 
79
- Cached rules enforce locally with zero network calls. Status output shows "Offline (local rules only)".
96
+ ## Exit Codes
97
+
98
+ | Code | Meaning |
99
+ |------|---------|
100
+ | 0 | PASS (no violations) |
101
+ | 1 | BLOCK (violations found) |
102
+ | 2 | ERROR (invalid input, network, auth) |
80
103
 
81
- ## Supported Compliance Frameworks
104
+ CI pipelines should fail on exit code 1 to block non-compliant code from merging.
82
105
 
83
- OWASP Top 10 | PCI-DSS | HIPAA | GDPR | SOC 2 | NIST SP 800-53 | NIST SP 800-171 | CMMC Level 2/3 | FedRAMP | ISO 27001 | DORA | NIS2 | CIS Benchmarks | UK DPA | Australian Privacy Act | APPI (Japan) | PDPA (Singapore, Taiwan) | and 25+ more
106
+ ## Configuration
84
107
 
85
- ## Key Features
108
+ ### korext.json
86
109
 
87
- - 478 rules across 44 policy packs
88
- - Three-layer governance: regulatory, technical standards (CWE, OWASP), security intelligence (MITRE ATT&CK)
89
- - 9 jurisdiction coverage (US, EU, UK, Canada, Australia, New Zealand, Japan, Taiwan, Singapore)
90
- - SARIF 2.1.0 output for CI scanner integration
91
- - GitHub Actions Step Summary generation
92
- - Offline mode with cached rules
93
- - Custom policy packs from uploaded documents
110
+ ```json
111
+ {
112
+ "project": "my-app",
113
+ "targetPacks": ["web", "pci-dss-v1"],
114
+ "region": "eu",
115
+ "industry": "finance"
116
+ }
117
+ ```
94
118
 
95
- ## Environment Variables
119
+ ### Environment Variables
96
120
 
97
121
  | Variable | Description |
98
122
  |----------|-------------|
99
- | `KOREXT_API_TOKEN` | API authentication token (recommended) |
100
- | `KOREXT_TOKEN` | Deprecated alias (shows warning) |
101
-
102
- ## Changelog
123
+ | `KOREXT_API_TOKEN` | API token for CI/CD (from dashboard) |
103
124
 
104
- ### v0.9.5
125
+ ## Data Sovereignty
105
126
 
106
- Fixed
107
- - Watch mode now detects file changes correctly and scans on startup
108
- - Enforcing a nonexistent directory now prints an error and exits with code 2 instead of silently passing
109
- - Offline enforcement prints how many rules are available versus how many require server analysis
110
- - Policy commands now default to the production API instead of localhost
127
+ Choose your data processing region: US, EU, or Asia Pacific. Set via `--region` flag, `korext.json`, or `korext init`. All enforcement data stays in your chosen region.
111
128
 
112
129
  ## Links
113
130
 
114
- - Website: [korext.com](https://www.korext.com)
115
- - Dashboard: [app.korext.com](https://app.korext.com)
116
- - VS Code Extension: [marketplace.visualstudio.com](https://marketplace.visualstudio.com/items?itemName=Korext.korext)
117
- - LinkedIn: [linkedin.com/company/korext](https://www.linkedin.com/company/korext)
118
- - GitHub: [github.com/Korext](https://github.com/Korext)
119
- - Support: support@korext.com
131
+ - [Website](https://korext.com)
132
+ - [Dashboard](https://app.korext.com)
133
+ - [Documentation](https://korext.com/docs)
134
+ - [GitHub Action](https://github.com/marketplace/actions/korext-enforce)
135
+ - [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=Korext.korext)
120
136
 
121
- ---
137
+ ## License
122
138
 
123
- **Publisher**: Korext
124
- **License**: Proprietary
125
- **Version**: 0.9.5
139
+ Proprietary. See [Terms of Service](https://korext.com/legal).
package/bin/korext.js CHANGED
@@ -296,13 +296,22 @@ async function fetchAndCacheRules() {
296
296
  * Mirrors korext-core/src/engine/localEngine.ts analyzeLocally().
297
297
  */
298
298
  function analyzeLocally(code, packId, definitions) {
299
- const pack = definitions.packs[packId];
300
- if (!pack) return [];
299
+ // Normalize packId to array to support multi-pack (e.g. ["web", "pci-dss-v1"])
300
+ const packIdList = Array.isArray(packId) ? packId : [packId];
301
+ // Merge rules from all requested packs via Set
302
+ const mergedRuleIds = new Set();
303
+ for (const pid of packIdList) {
304
+ const pack = definitions.packs[pid];
305
+ if (pack && pack.rules) {
306
+ for (const rid of pack.rules) mergedRuleIds.add(rid);
307
+ }
308
+ }
309
+ if (mergedRuleIds.size === 0) return [];
301
310
 
302
311
  const violations = [];
303
312
  const lines = code.split('\n');
304
313
 
305
- for (const ruleId of pack.rules) {
314
+ for (const ruleId of mergedRuleIds) {
306
315
  const rule = definitions.rules[ruleId];
307
316
  if (!rule) continue;
308
317
  if (rule.checkMode === 'server-only') continue;
@@ -576,6 +585,7 @@ program
576
585
  .command('init')
577
586
  .description('Initialize a korext.json configuration file for your project')
578
587
  .option('--non-interactive', 'Skip prompts and use defaults', false)
588
+ .option('--region <region>', 'Data processing region (us, eu, apac)')
579
589
  .action(async (options) => {
580
590
  console.log(chalk.bold.hex('#F27D26')('\n\u25b2 KOREXT PROJECT INIT'));
581
591
  console.log(chalk.dim('=======================================\n'));
@@ -604,13 +614,15 @@ program
604
614
  const taxonomy = buildTaxonomyFromPacks(defs.packs);
605
615
 
606
616
  if (options.nonInteractive) {
607
- // Non-interactive: default to web pack
617
+ // Non-interactive: default to web pack, optionally with region
608
618
  const config = {
609
619
  targetPacks: ['web'],
620
+ ...(options.region && { region: options.region }),
610
621
  exclude: ['node_modules', 'dist', 'build', '.next']
611
622
  };
612
623
  fs.writeFileSync(outputPath, JSON.stringify(config, null, 2));
613
- console.log(chalk.green(`Created ${outputPath} with default pack: web\n`));
624
+ const regionNote = options.region ? ` (region: ${options.region})` : '';
625
+ console.log(chalk.green(`Created ${outputPath} with default pack: web${regionNote}\n`));
614
626
  process.exit(0);
615
627
  }
616
628
 
@@ -1030,7 +1042,14 @@ program
1030
1042
  console.log(chalk.yellow('\n⚡ Offline mode: using local rule engine (regex-based analysis)'));
1031
1043
  console.log(chalk.dim(` Cached rules: v${localDefinitions.version} · ${localDefinitions.ruleCount} rules · ${localDefinitions.packCount} packs`));
1032
1044
  // Show rule coverage breakdown
1033
- const packRules = localDefinitions.packs?.[pack]?.rules || [];
1045
+ // Merge rules from all packs for coverage display
1046
+ const coveragePackList = Array.isArray(pack) ? pack : [pack];
1047
+ const allPackRuleIds = new Set();
1048
+ for (const pid of coveragePackList) {
1049
+ const pr = localDefinitions.packs?.[pid]?.rules || [];
1050
+ for (const rid of pr) allPackRuleIds.add(rid);
1051
+ }
1052
+ const packRules = [...allPackRuleIds];
1034
1053
  const availableCount = packRules.filter(r => localDefinitions.rules?.[r]).length;
1035
1054
  const serverOnlyCount = packRules.length - availableCount;
1036
1055
  console.log(chalk.dim(` Offline mode: ${availableCount} of ${packRules.length} rules available. ${serverOnlyCount} rules require server analysis.`));
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "korext",
3
- "version": "0.9.11",
3
+ "version": "1.0.0",
4
4
  "mcpName": "io.github.Korext/governance",
5
- "description": "Korext Command Line Interface",
5
+ "description": "KOREXT CLI. AI Code Governance. Enforce compliance policies on human written and AI generated code. 72 policy packs. 532 rules. 13 languages. Signed proof bundles.",
6
6
  "type": "module",
7
7
  "main": "bin/korext.js",
8
8
  "bin": {
9
9
  "korext": "bin/korext.js"
10
10
  },
11
- "author": "Korext <support@korext.com>",
12
- "license": "ISC",
11
+ "author": "Korext <tombruno@korext.com> (https://korext.com)",
12
+ "license": "SEE LICENSE IN LICENSE",
13
13
  "dependencies": {
14
14
  "chalk": "^4.1.2",
15
15
  "commander": "^14.0.3",
@@ -19,24 +19,35 @@
19
19
  "ora": "^5.4.1"
20
20
  },
21
21
  "files": [
22
- "bin/"
22
+ "bin/",
23
+ "README.md",
24
+ "LICENSE"
23
25
  ],
24
- "homepage": "https://www.korext.com",
26
+ "homepage": "https://korext.com",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://korext.com"
30
+ },
25
31
  "bugs": {
32
+ "url": "https://korext.com/support",
26
33
  "email": "support@korext.com"
27
34
  },
35
+ "engines": {
36
+ "node": ">=18.0.0"
37
+ },
28
38
  "keywords": [
29
39
  "governance",
30
40
  "compliance",
31
41
  "security",
32
- "cli",
33
- "cicd",
34
- "sarif",
42
+ "SAST",
43
+ "linter",
44
+ "code-quality",
35
45
  "AI",
36
- "code review",
46
+ "policy",
37
47
  "PCI-DSS",
38
48
  "HIPAA",
39
- "OWASP",
40
- "korext"
49
+ "GDPR",
50
+ "proof-bundle",
51
+ "sovereignty"
41
52
  ]
42
53
  }