musubix 1.8.0 → 2.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.
- package/AGENTS.md +23 -11
- package/README.ja.md +10 -4
- package/README.md +49 -19
- package/docs/USER-GUIDE-v1.8.0.md +2371 -0
- package/docs/USER-GUIDE.ja.md +170 -5
- package/docs/USER-GUIDE.md +836 -6
- package/docs/overview/MUSUBIX-Phase1-Complete.md +271 -0
- package/docs/overview/MUSUBIX-Phase2-Complete.md +310 -0
- package/docs/overview/MUSUBIX-Security.md +891 -0
- package/package.json +4 -2
package/docs/USER-GUIDE.ja.md
CHANGED
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
18. [KGPR - Knowledge Graph Pull Request](#kgpr---knowledge-graph-pull-request) *(v1.6.4)*
|
|
25
25
|
19. [YATA プラットフォーム拡張](#yata-プラットフォーム拡張) *(v1.7.0)*
|
|
26
26
|
20. [形式検証](#形式検証) *(v1.7.5)*
|
|
27
|
-
21. [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
21. [セキュリティ分析](#セキュリティ分析) *(v1.8.0)*
|
|
28
|
+
22. [MCPサーバー連携](#mcpサーバー連携)
|
|
29
|
+
23. [YATA知識グラフ](#yata知識グラフ)
|
|
30
|
+
24. [ベストプラクティス](#ベストプラクティス)
|
|
31
|
+
25. [トラブルシューティング](#トラブルシューティング)
|
|
31
32
|
|
|
32
33
|
---
|
|
33
34
|
|
|
@@ -1665,6 +1666,170 @@ console.log(`影響ノード数: ${impact.totalImpacted}`);
|
|
|
1665
1666
|
|
|
1666
1667
|
---
|
|
1667
1668
|
|
|
1669
|
+
## セキュリティ分析
|
|
1670
|
+
|
|
1671
|
+
*(v1.8.0)*
|
|
1672
|
+
|
|
1673
|
+
`@nahisaho/musubix-security` パッケージは、TypeScript/JavaScriptプロジェクト向けの包括的なセキュリティ分析機能を提供します。
|
|
1674
|
+
|
|
1675
|
+
### インストール
|
|
1676
|
+
|
|
1677
|
+
```bash
|
|
1678
|
+
npm install @nahisaho/musubix-security
|
|
1679
|
+
```
|
|
1680
|
+
|
|
1681
|
+
### 脆弱性スキャン
|
|
1682
|
+
|
|
1683
|
+
AST解析によりOWASP Top 10およびCWE Top 25の脆弱性を検出します:
|
|
1684
|
+
|
|
1685
|
+
```typescript
|
|
1686
|
+
import { VulnerabilityScanner, createSecurityService } from '@nahisaho/musubix-security';
|
|
1687
|
+
|
|
1688
|
+
// 単一ファイルのスキャン
|
|
1689
|
+
const scanner = new VulnerabilityScanner();
|
|
1690
|
+
const vulnerabilities = scanner.scanFile('src/api.ts');
|
|
1691
|
+
|
|
1692
|
+
// ディレクトリのスキャン
|
|
1693
|
+
const result = await scanner.scanDirectory('./src');
|
|
1694
|
+
console.log(`検出された脆弱性: ${result.vulnerabilities.length}`);
|
|
1695
|
+
console.log(`スキャンしたファイル: ${result.scannedFiles}`);
|
|
1696
|
+
```
|
|
1697
|
+
|
|
1698
|
+
### 検出可能な脆弱性
|
|
1699
|
+
|
|
1700
|
+
| カテゴリ | CWE | 重要度 |
|
|
1701
|
+
|---------|-----|--------|
|
|
1702
|
+
| SQLインジェクション | CWE-89 | Critical |
|
|
1703
|
+
| コマンドインジェクション | CWE-78 | Critical |
|
|
1704
|
+
| XSS | CWE-79 | High |
|
|
1705
|
+
| パストラバーサル | CWE-22 | High |
|
|
1706
|
+
| コードインジェクション | CWE-94 | Critical |
|
|
1707
|
+
| NoSQLインジェクション | CWE-943 | High |
|
|
1708
|
+
|
|
1709
|
+
### シークレット検出
|
|
1710
|
+
|
|
1711
|
+
ハードコードされた認証情報や機密情報を検出します:
|
|
1712
|
+
|
|
1713
|
+
```typescript
|
|
1714
|
+
import { SecretDetector } from '@nahisaho/musubix-security';
|
|
1715
|
+
|
|
1716
|
+
const detector = new SecretDetector();
|
|
1717
|
+
const secrets = detector.scanContent(content, 'config.ts');
|
|
1718
|
+
const result = await detector.scan('./src');
|
|
1719
|
+
|
|
1720
|
+
console.log(`検出されたシークレット: ${result.summary.total}`);
|
|
1721
|
+
```
|
|
1722
|
+
|
|
1723
|
+
### 検出可能なシークレットタイプ
|
|
1724
|
+
|
|
1725
|
+
| タイプ | パターン |
|
|
1726
|
+
|--------|--------|
|
|
1727
|
+
| AWS Access Key | `AKIA...` |
|
|
1728
|
+
| AWS Secret Key | 40文字のbase64 |
|
|
1729
|
+
| GitHub Token | `ghp_*`, `gho_*`, `ghu_*` |
|
|
1730
|
+
| 秘密鍵 | PEM形式 |
|
|
1731
|
+
| データベースURL | `postgres://`, `mongodb://` |
|
|
1732
|
+
| JWTシークレット | JWT署名シークレット |
|
|
1733
|
+
| Stripe Key | `sk_live_*`, `sk_test_*` |
|
|
1734
|
+
|
|
1735
|
+
### テイント解析
|
|
1736
|
+
|
|
1737
|
+
ユーザー入力(ソース)から危険な関数(シンク)へのデータフローを追跡します:
|
|
1738
|
+
|
|
1739
|
+
```typescript
|
|
1740
|
+
import { TaintAnalyzer } from '@nahisaho/musubix-security';
|
|
1741
|
+
|
|
1742
|
+
const analyzer = new TaintAnalyzer();
|
|
1743
|
+
const result = analyzer.analyze('./src');
|
|
1744
|
+
|
|
1745
|
+
console.log(`ソース: ${result.sources.length}`);
|
|
1746
|
+
console.log(`シンク: ${result.sinks.length}`);
|
|
1747
|
+
console.log(`テイントパス: ${result.paths.length}`);
|
|
1748
|
+
```
|
|
1749
|
+
|
|
1750
|
+
### 依存関係監査
|
|
1751
|
+
|
|
1752
|
+
npm auditと統合して脆弱な依存関係を検出します:
|
|
1753
|
+
|
|
1754
|
+
```typescript
|
|
1755
|
+
import { DependencyAuditor } from '@nahisaho/musubix-security';
|
|
1756
|
+
|
|
1757
|
+
const auditor = new DependencyAuditor();
|
|
1758
|
+
const result = await auditor.audit('./project');
|
|
1759
|
+
|
|
1760
|
+
console.log(`Critical: ${result.summary.critical}`);
|
|
1761
|
+
console.log(`High: ${result.summary.high}`);
|
|
1762
|
+
```
|
|
1763
|
+
|
|
1764
|
+
### 統合セキュリティサービス
|
|
1765
|
+
|
|
1766
|
+
すべてのセキュリティ分析機能を統合:
|
|
1767
|
+
|
|
1768
|
+
```typescript
|
|
1769
|
+
import { createSecurityService } from '@nahisaho/musubix-security';
|
|
1770
|
+
|
|
1771
|
+
const service = createSecurityService();
|
|
1772
|
+
|
|
1773
|
+
// フルセキュリティスキャン
|
|
1774
|
+
const result = await service.scan({
|
|
1775
|
+
target: './src',
|
|
1776
|
+
vulnerabilities: true,
|
|
1777
|
+
taint: true,
|
|
1778
|
+
secrets: true,
|
|
1779
|
+
dependencies: true,
|
|
1780
|
+
generateFixes: true,
|
|
1781
|
+
});
|
|
1782
|
+
|
|
1783
|
+
console.log(`総脆弱性数: ${result.summary.totalVulnerabilities}`);
|
|
1784
|
+
console.log(`総シークレット数: ${result.summary.totalSecrets}`);
|
|
1785
|
+
console.log(`生成された修正: ${result.summary.fixesGenerated}`);
|
|
1786
|
+
```
|
|
1787
|
+
|
|
1788
|
+
### レポート生成
|
|
1789
|
+
|
|
1790
|
+
複数のフォーマットでレポートを生成:
|
|
1791
|
+
|
|
1792
|
+
```typescript
|
|
1793
|
+
// SARIF形式(GitHub Code Scanning対応)
|
|
1794
|
+
const sarifReport = await service.generateReport(result, 'sarif');
|
|
1795
|
+
|
|
1796
|
+
// Markdown形式
|
|
1797
|
+
const mdReport = await service.generateReport(result, 'markdown');
|
|
1798
|
+
|
|
1799
|
+
// HTML形式
|
|
1800
|
+
const htmlReport = await service.generateReport(result, 'html');
|
|
1801
|
+
```
|
|
1802
|
+
|
|
1803
|
+
### CLIの使い方
|
|
1804
|
+
|
|
1805
|
+
```bash
|
|
1806
|
+
# フルセキュリティスキャン
|
|
1807
|
+
npx musubix-security scan ./src
|
|
1808
|
+
|
|
1809
|
+
# 脆弱性スキャンのみ
|
|
1810
|
+
npx musubix-security scan ./src --vulnerabilities-only
|
|
1811
|
+
|
|
1812
|
+
# シークレット検出
|
|
1813
|
+
npx musubix-security secrets ./src
|
|
1814
|
+
|
|
1815
|
+
# テイント解析
|
|
1816
|
+
npx musubix-security taint ./src
|
|
1817
|
+
|
|
1818
|
+
# 依存関係監査
|
|
1819
|
+
npx musubix-security audit ./project
|
|
1820
|
+
|
|
1821
|
+
# SARIFレポート生成
|
|
1822
|
+
npx musubix-security scan ./src --format sarif --output report.sarif
|
|
1823
|
+
```
|
|
1824
|
+
|
|
1825
|
+
### v1.8.0 パッケージ概要
|
|
1826
|
+
|
|
1827
|
+
| パッケージ | 説明 |
|
|
1828
|
+
|-----------|------|
|
|
1829
|
+
| `@nahisaho/musubix-security` | 脆弱性スキャン、シークレット検出、テイント解析、依存関係監査 |
|
|
1830
|
+
|
|
1831
|
+
---
|
|
1832
|
+
|
|
1668
1833
|
## MCPサーバー連携
|
|
1669
1834
|
|
|
1670
1835
|
### MCPサーバーの起動
|
|
@@ -1977,6 +2142,6 @@ const client = createYATAClient({
|
|
|
1977
2142
|
|
|
1978
2143
|
---
|
|
1979
2144
|
|
|
1980
|
-
**バージョン**: 1.
|
|
2145
|
+
**バージョン**: 1.8.0
|
|
1981
2146
|
**最終更新**: 2026-01-06
|
|
1982
2147
|
**MUSUBIX Project**
|