@mitre/hdf-mappings 3.0.0 → 3.1.0-rc.1

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 (89) hide show
  1. package/LICENSE.md +55 -0
  2. package/README.md +7 -3
  3. package/dist/index.d.ts +504 -21
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +33049 -21
  6. package/dist/index.js.map +1 -1
  7. package/package.json +18 -19
  8. package/dist/awsconfig/index.d.ts +0 -56
  9. package/dist/awsconfig/index.d.ts.map +0 -1
  10. package/dist/awsconfig/index.js +0 -79
  11. package/dist/awsconfig/index.js.map +0 -1
  12. package/dist/awsconfig/types.d.ts +0 -11
  13. package/dist/awsconfig/types.d.ts.map +0 -1
  14. package/dist/awsconfig/types.js +0 -5
  15. package/dist/awsconfig/types.js.map +0 -1
  16. package/dist/cci/index.d.ts +0 -85
  17. package/dist/cci/index.d.ts.map +0 -1
  18. package/dist/cci/index.js +0 -132
  19. package/dist/cci/index.js.map +0 -1
  20. package/dist/cci/types.d.ts +0 -19
  21. package/dist/cci/types.d.ts.map +0 -1
  22. package/dist/cci/types.js +0 -2
  23. package/dist/cci/types.js.map +0 -1
  24. package/dist/cwe/index.d.ts +0 -39
  25. package/dist/cwe/index.d.ts.map +0 -1
  26. package/dist/cwe/index.js +0 -55
  27. package/dist/cwe/index.js.map +0 -1
  28. package/dist/cwe/types.d.ts +0 -12
  29. package/dist/cwe/types.d.ts.map +0 -1
  30. package/dist/cwe/types.js +0 -5
  31. package/dist/cwe/types.js.map +0 -1
  32. package/dist/data/awsconfig-mappings.json +0 -638
  33. package/dist/data/cci-mappings.json +0 -24125
  34. package/dist/data/cwe-nist-mappings.json +0 -1416
  35. package/dist/data/nessus-nist-mappings.json +0 -432
  36. package/dist/data/nikto-nist-mappings.json +0 -8943
  37. package/dist/data/nist-cci-mappings.json +0 -23
  38. package/dist/data/nist-descriptions.json +0 -1684
  39. package/dist/data/owasp-nist-mappings.json +0 -72
  40. package/dist/data/scoutsuite-nist-mappings.json +0 -558
  41. package/dist/data/src/data/awsconfig-mappings.json +0 -638
  42. package/dist/data/src/data/cci-mappings.json +0 -24125
  43. package/dist/data/src/data/cwe-nist-mappings.json +0 -1416
  44. package/dist/data/src/data/nessus-nist-mappings.json +0 -432
  45. package/dist/data/src/data/nikto-nist-mappings.json +0 -8943
  46. package/dist/data/src/data/nist-cci-mappings.json +0 -23
  47. package/dist/data/src/data/nist-descriptions.json +0 -1684
  48. package/dist/data/src/data/owasp-nist-mappings.json +0 -72
  49. package/dist/data/src/data/scoutsuite-nist-mappings.json +0 -558
  50. package/dist/nessus/index.d.ts +0 -34
  51. package/dist/nessus/index.d.ts.map +0 -1
  52. package/dist/nessus/index.js +0 -53
  53. package/dist/nessus/index.js.map +0 -1
  54. package/dist/nessus/types.d.ts +0 -10
  55. package/dist/nessus/types.d.ts.map +0 -1
  56. package/dist/nessus/types.js +0 -5
  57. package/dist/nessus/types.js.map +0 -1
  58. package/dist/nikto/index.d.ts +0 -27
  59. package/dist/nikto/index.d.ts.map +0 -1
  60. package/dist/nikto/index.js +0 -38
  61. package/dist/nikto/index.js.map +0 -1
  62. package/dist/nikto/types.d.ts +0 -5
  63. package/dist/nikto/types.d.ts.map +0 -1
  64. package/dist/nikto/types.js +0 -5
  65. package/dist/nikto/types.js.map +0 -1
  66. package/dist/nist/index.d.ts +0 -75
  67. package/dist/nist/index.d.ts.map +0 -1
  68. package/dist/nist/index.js +0 -103
  69. package/dist/nist/index.js.map +0 -1
  70. package/dist/nist/types.d.ts +0 -5
  71. package/dist/nist/types.d.ts.map +0 -1
  72. package/dist/nist/types.js +0 -2
  73. package/dist/nist/types.js.map +0 -1
  74. package/dist/owasp/index.d.ts +0 -83
  75. package/dist/owasp/index.d.ts.map +0 -1
  76. package/dist/owasp/index.js +0 -104
  77. package/dist/owasp/index.js.map +0 -1
  78. package/dist/owasp/types.d.ts +0 -12
  79. package/dist/owasp/types.d.ts.map +0 -1
  80. package/dist/owasp/types.js +0 -5
  81. package/dist/owasp/types.js.map +0 -1
  82. package/dist/scoutsuite/index.d.ts +0 -33
  83. package/dist/scoutsuite/index.d.ts.map +0 -1
  84. package/dist/scoutsuite/index.js +0 -46
  85. package/dist/scoutsuite/index.js.map +0 -1
  86. package/dist/scoutsuite/types.d.ts +0 -9
  87. package/dist/scoutsuite/types.d.ts.map +0 -1
  88. package/dist/scoutsuite/types.js +0 -5
  89. package/dist/scoutsuite/types.js.map +0 -1
@@ -1,53 +0,0 @@
1
- /**
2
- * Query functions for Nessus to NIST mappings
3
- */
4
- import rawMappings from '../data/nessus-nist-mappings.json';
5
- const mappings = rawMappings;
6
- /**
7
- * Get the NIST control ID for a Nessus plugin family and plugin ID
8
- * @param pluginFamily - The Nessus plugin family
9
- * @param pluginId - The Nessus plugin ID (optional, defaults to "*")
10
- * @returns The NIST control ID or undefined if not found
11
- */
12
- export function getNessusNistControl(pluginFamily, pluginId = '*') {
13
- // First try exact match with plugin ID
14
- const exactMatch = mappings.find((m) => m.pluginFamily === pluginFamily && m.pluginID === pluginId);
15
- if (exactMatch) {
16
- return exactMatch['NIST-ID'];
17
- }
18
- // Fall back to wildcard match
19
- const wildcardMatch = mappings.find((m) => m.pluginFamily === pluginFamily && m.pluginID === '*');
20
- return wildcardMatch?.['NIST-ID'];
21
- }
22
- /**
23
- * Get all mappings for a plugin family
24
- * @param pluginFamily - The Nessus plugin family
25
- * @returns Array of mappings for the plugin family
26
- */
27
- export function getNessusPluginFamilyMappings(pluginFamily) {
28
- return mappings.filter((m) => m.pluginFamily === pluginFamily);
29
- }
30
- /**
31
- * Get all plugin families
32
- * @returns Array of all plugin families
33
- */
34
- export function getAllNessusPluginFamilies() {
35
- const families = new Set(mappings.map((m) => m.pluginFamily));
36
- return Array.from(families);
37
- }
38
- /**
39
- * Check if a plugin family exists in the mappings
40
- * @param pluginFamily - The plugin family to check
41
- * @returns True if the plugin family exists
42
- */
43
- export function nessusPluginFamilyExists(pluginFamily) {
44
- return mappings.some((m) => m.pluginFamily === pluginFamily);
45
- }
46
- /**
47
- * Get all Nessus to NIST mappings
48
- * @returns Array of all mappings
49
- */
50
- export function getAllNessusMappings() {
51
- return [...mappings];
52
- }
53
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nessus/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,WAAW,MAAM,mCAAmC,CAAC;AAE5D,MAAM,QAAQ,GAAG,WAAiC,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,YAAoB,EACpB,QAAQ,GAAG,GAAG;IAEd,uCAAuC;IACvC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAC9B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,YAAY,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAClE,CAAC;IACF,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,8BAA8B;IAC9B,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CACjC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,YAAY,IAAI,CAAC,CAAC,QAAQ,KAAK,GAAG,CAC7D,CAAC;IACF,OAAO,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAC3C,YAAoB;IAEpB,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,YAAY,CAAC,CAAC;AACjE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B;IACxC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9D,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,YAAoB;IAC3D,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,YAAY,CAAC,CAAC;AAC/D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;AACvB,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * TypeScript types for Nessus to NIST mappings
3
- */
4
- export interface NessusNistMapping {
5
- pluginFamily: string;
6
- pluginID: string;
7
- 'NIST-ID': string;
8
- }
9
- export type NessusNistMappings = NessusNistMapping[];
10
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/nessus/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,EAAE,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * TypeScript types for Nessus to NIST mappings
3
- */
4
- export {};
5
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/nessus/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Query functions for Nikto to NIST mappings
3
- */
4
- import type { NiktoNistMappings } from './types.js';
5
- /**
6
- * Get the NIST control ID for a Nikto test ID
7
- * @param niktoId - The Nikto test ID (string or number)
8
- * @returns The NIST control ID or undefined if not found
9
- */
10
- export declare function getNiktoNistControl(niktoId: string | number): string | undefined;
11
- /**
12
- * Get all Nikto test IDs
13
- * @returns Array of all Nikto test IDs
14
- */
15
- export declare function getAllNiktoIds(): string[];
16
- /**
17
- * Check if a Nikto test ID exists in the mappings
18
- * @param niktoId - The Nikto test ID to check
19
- * @returns True if the Nikto test ID exists
20
- */
21
- export declare function niktoExists(niktoId: string | number): boolean;
22
- /**
23
- * Get all Nikto to NIST mappings
24
- * @returns Object mapping Nikto test IDs to NIST control IDs
25
- */
26
- export declare function getAllNiktoMappings(): NiktoNistMappings;
27
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nikto/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAKpD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAGhF;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAG7D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,iBAAiB,CAEvD"}
@@ -1,38 +0,0 @@
1
- /**
2
- * Query functions for Nikto to NIST mappings
3
- */
4
- import rawMappings from '../data/nikto-nist-mappings.json';
5
- const mappings = rawMappings;
6
- /**
7
- * Get the NIST control ID for a Nikto test ID
8
- * @param niktoId - The Nikto test ID (string or number)
9
- * @returns The NIST control ID or undefined if not found
10
- */
11
- export function getNiktoNistControl(niktoId) {
12
- const id = typeof niktoId === 'number' ? niktoId.toString() : niktoId;
13
- return mappings[id];
14
- }
15
- /**
16
- * Get all Nikto test IDs
17
- * @returns Array of all Nikto test IDs
18
- */
19
- export function getAllNiktoIds() {
20
- return Object.keys(mappings);
21
- }
22
- /**
23
- * Check if a Nikto test ID exists in the mappings
24
- * @param niktoId - The Nikto test ID to check
25
- * @returns True if the Nikto test ID exists
26
- */
27
- export function niktoExists(niktoId) {
28
- const id = typeof niktoId === 'number' ? niktoId.toString() : niktoId;
29
- return id in mappings;
30
- }
31
- /**
32
- * Get all Nikto to NIST mappings
33
- * @returns Object mapping Nikto test IDs to NIST control IDs
34
- */
35
- export function getAllNiktoMappings() {
36
- return { ...mappings };
37
- }
38
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nikto/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,WAAW,MAAM,kCAAkC,CAAC;AAE3D,MAAM,QAAQ,GAAG,WAAgC,CAAC;AAElD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAwB;IAC1D,MAAM,EAAE,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACtE,OAAO,QAAQ,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,OAAwB;IAClD,MAAM,EAAE,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACtE,OAAO,EAAE,IAAI,QAAQ,CAAC;AACxB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC;AACzB,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * TypeScript types for Nikto to NIST mappings
3
- */
4
- export type NiktoNistMappings = Record<string, string>;
5
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/nikto/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * TypeScript types for Nikto to NIST mappings
3
- */
4
- export {};
5
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/nikto/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,75 +0,0 @@
1
- /**
2
- * NIST SP 800-53 control description functions
3
- */
4
- /**
5
- * Get the description for a NIST control ID.
6
- *
7
- * @param nistId - The NIST control ID (e.g., 'AC-01', 'AC-01 a', 'AC-01 a 01')
8
- * @returns The NIST control description, or undefined if not found
9
- *
10
- * @example
11
- * ```typescript
12
- * const desc = getNISTDescription('AC-01');
13
- * // Returns: "ACCESS CONTROL POLICY AND PROCEDURES"
14
- * ```
15
- */
16
- export declare function getNISTDescription(nistId: string): string | undefined;
17
- /**
18
- * Get all NIST control IDs available in the database.
19
- *
20
- * @returns Array of all NIST control IDs
21
- *
22
- * @example
23
- * ```typescript
24
- * const ids = getAllNISTIds();
25
- * // Returns: ['AC-01', 'AC-01 a', 'AC-02', ...]
26
- * ```
27
- */
28
- export declare function getAllNISTIds(): string[];
29
- /**
30
- * Check if a NIST control ID exists in the database.
31
- *
32
- * @param nistId - The NIST control ID to check
33
- * @returns true if the NIST control exists, false otherwise
34
- *
35
- * @example
36
- * ```typescript
37
- * if (nistExists('AC-01')) {
38
- * console.log('NIST control found');
39
- * }
40
- * ```
41
- */
42
- export declare function nistExists(nistId: string): boolean;
43
- /**
44
- * Extract the NIST family from a NIST control ID.
45
- *
46
- * @param nistId - The NIST control ID (e.g., 'AC-01', 'AC-01 a')
47
- * @returns The NIST family code (e.g., 'AC'), or undefined if invalid
48
- *
49
- * @example
50
- * ```typescript
51
- * const family = getNISTFamily('AC-01');
52
- * // Returns: 'AC'
53
- *
54
- * const family2 = getNISTFamily('AC-01 a 01');
55
- * // Returns: 'AC'
56
- * ```
57
- */
58
- export declare function getNISTFamily(nistId: string): string | undefined;
59
- /**
60
- * Canonical NIST 800-53 fallback tags for converters when a finding has no
61
- * CWE or the CWE has no NIST mapping. Categories match heimdall2's global.ts.
62
- *
63
- * - SA-11: Developer Security Testing and Evaluation
64
- * - RA-5: Vulnerability Monitoring and Scanning
65
- * - SI-2: Flaw Remediation
66
- * - CM-8: System Component Inventory
67
- */
68
- /** Static analysis and vulnerability scanning tools (SA-11 + RA-5). */
69
- export declare const DEFAULT_STATIC_ANALYSIS_NIST_TAGS: string[];
70
- /** Tools that identify outdated packages or flaws requiring patching (SI-2 + RA-5). */
71
- export declare const DEFAULT_REMEDIATION_NIST_TAGS: string[];
72
- /** Dependency/inventory management tools (CM-8). */
73
- export declare const DEFAULT_COMPONENT_MANAGEMENT_NIST_TAGS: string[];
74
- export type { NISTDescriptions } from './types.js';
75
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nist/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMrE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAExC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAMlD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmBhE;AAED;;;;;;;;GAQG;AAEH,uEAAuE;AACvE,eAAO,MAAM,iCAAiC,EAAE,MAAM,EAAsB,CAAC;AAE7E,uFAAuF;AACvF,eAAO,MAAM,6BAA6B,EAAE,MAAM,EAAqB,CAAC;AAExE,oDAAoD;AACpD,eAAO,MAAM,sCAAsC,EAAE,MAAM,EAAa,CAAC;AAGzE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
@@ -1,103 +0,0 @@
1
- /**
2
- * NIST SP 800-53 control description functions
3
- */
4
- import rawNistData from '../data/nist-descriptions.json';
5
- const nistData = rawNistData;
6
- /**
7
- * Get the description for a NIST control ID.
8
- *
9
- * @param nistId - The NIST control ID (e.g., 'AC-01', 'AC-01 a', 'AC-01 a 01')
10
- * @returns The NIST control description, or undefined if not found
11
- *
12
- * @example
13
- * ```typescript
14
- * const desc = getNISTDescription('AC-01');
15
- * // Returns: "ACCESS CONTROL POLICY AND PROCEDURES"
16
- * ```
17
- */
18
- export function getNISTDescription(nistId) {
19
- if (!nistId || typeof nistId !== 'string') {
20
- return undefined;
21
- }
22
- return nistData[nistId];
23
- }
24
- /**
25
- * Get all NIST control IDs available in the database.
26
- *
27
- * @returns Array of all NIST control IDs
28
- *
29
- * @example
30
- * ```typescript
31
- * const ids = getAllNISTIds();
32
- * // Returns: ['AC-01', 'AC-01 a', 'AC-02', ...]
33
- * ```
34
- */
35
- export function getAllNISTIds() {
36
- return Object.keys(nistData);
37
- }
38
- /**
39
- * Check if a NIST control ID exists in the database.
40
- *
41
- * @param nistId - The NIST control ID to check
42
- * @returns true if the NIST control exists, false otherwise
43
- *
44
- * @example
45
- * ```typescript
46
- * if (nistExists('AC-01')) {
47
- * console.log('NIST control found');
48
- * }
49
- * ```
50
- */
51
- export function nistExists(nistId) {
52
- if (!nistId || typeof nistId !== 'string') {
53
- return false;
54
- }
55
- return nistId in nistData;
56
- }
57
- /**
58
- * Extract the NIST family from a NIST control ID.
59
- *
60
- * @param nistId - The NIST control ID (e.g., 'AC-01', 'AC-01 a')
61
- * @returns The NIST family code (e.g., 'AC'), or undefined if invalid
62
- *
63
- * @example
64
- * ```typescript
65
- * const family = getNISTFamily('AC-01');
66
- * // Returns: 'AC'
67
- *
68
- * const family2 = getNISTFamily('AC-01 a 01');
69
- * // Returns: 'AC'
70
- * ```
71
- */
72
- export function getNISTFamily(nistId) {
73
- if (!nistId || typeof nistId !== 'string') {
74
- return undefined;
75
- }
76
- // Extract family from format like "AC-01" or "AC-01 a"
77
- const match = nistId.match(/^([A-Z]{2})-/);
78
- if (!match) {
79
- return undefined;
80
- }
81
- const family = match[1];
82
- // Validate that this family exists in our database by checking
83
- // if any controls start with this family
84
- const familyPrefix = `${family}-`;
85
- const hasFamily = Object.keys(nistData).some((key) => key.startsWith(familyPrefix));
86
- return hasFamily ? family : undefined;
87
- }
88
- /**
89
- * Canonical NIST 800-53 fallback tags for converters when a finding has no
90
- * CWE or the CWE has no NIST mapping. Categories match heimdall2's global.ts.
91
- *
92
- * - SA-11: Developer Security Testing and Evaluation
93
- * - RA-5: Vulnerability Monitoring and Scanning
94
- * - SI-2: Flaw Remediation
95
- * - CM-8: System Component Inventory
96
- */
97
- /** Static analysis and vulnerability scanning tools (SA-11 + RA-5). */
98
- export const DEFAULT_STATIC_ANALYSIS_NIST_TAGS = ['SA-11', 'RA-5'];
99
- /** Tools that identify outdated packages or flaws requiring patching (SI-2 + RA-5). */
100
- export const DEFAULT_REMEDIATION_NIST_TAGS = ['SI-2', 'RA-5'];
101
- /** Dependency/inventory management tools (CM-8). */
102
- export const DEFAULT_COMPONENT_MANAGEMENT_NIST_TAGS = ['CM-8'];
103
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nist/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,WAAW,MAAM,gCAAgC,CAAC;AAEzD,MAAM,QAAQ,GAAG,WAA+B,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,IAAI,CAAC,MAAM,IAAI,OAAO,M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MAAM,CAAC,CAAC;AAE7E,uFAAuF;AACvF,MAAM,CAAC,MAAM,6BAA6B,GAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExE,oDAAoD;AACpD,MAAM,CAAC,MAAM,sCAAsC,GAAa,CAAC,MAAM,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * NIST control descriptions database structure
3
- */
4
- export type NISTDescriptions = Record<string, string>;
5
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/nist/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/nist/types.ts"],"names":[],"mappings":""}
@@ -1,83 +0,0 @@
1
- /**
2
- * OWASP Top 10 to NIST mapping functions
3
- */
4
- import type { OwaspNistMappings, OwaspNistMapping } from './types.js';
5
- /**
6
- * Get the NIST mapping for an OWASP Top 10 ID.
7
- *
8
- * @param owaspId - The OWASP ID (e.g., 'A1', 'A2')
9
- * @returns The mapping object, or undefined if not found
10
- *
11
- * @example
12
- * ```typescript
13
- * const mapping = getOwaspNistMapping('A1');
14
- * // Returns: { 'OWASP-ID': 'A1', 'OWASP Name': 'Injection', 'NIST-ID': 'SI-10', ... }
15
- * ```
16
- */
17
- export declare function getOwaspNistMapping(owaspId: string): OwaspNistMapping | undefined;
18
- /**
19
- * Get the NIST control ID for an OWASP Top 10 ID.
20
- *
21
- * @param owaspId - The OWASP ID (e.g., 'A1', 'A2')
22
- * @returns The NIST control ID, or undefined if not found
23
- *
24
- * @example
25
- * ```typescript
26
- * const nistId = getOwaspNistControl('A1');
27
- * // Returns: 'SI-10'
28
- * ```
29
- */
30
- export declare function getOwaspNistControl(owaspId: string): string | undefined;
31
- /**
32
- * Get the OWASP vulnerability name for an OWASP ID.
33
- *
34
- * @param owaspId - The OWASP ID (e.g., 'A1', 'A2')
35
- * @returns The OWASP vulnerability name, or undefined if not found
36
- *
37
- * @example
38
- * ```typescript
39
- * const name = getOwaspName('A1');
40
- * // Returns: 'Injection'
41
- * ```
42
- */
43
- export declare function getOwaspName(owaspId: string): string | undefined;
44
- /**
45
- * Get all OWASP IDs available in the database.
46
- *
47
- * @returns Array of all OWASP IDs
48
- *
49
- * @example
50
- * ```typescript
51
- * const ids = getAllOwaspIds();
52
- * // Returns: ['A1', 'A2', 'A3', ..., 'A10']
53
- * ```
54
- */
55
- export declare function getAllOwaspIds(): string[];
56
- /**
57
- * Check if an OWASP ID exists in the database.
58
- *
59
- * @param owaspId - The OWASP ID to check
60
- * @returns true if the OWASP ID exists, false otherwise
61
- *
62
- * @example
63
- * ```typescript
64
- * if (owaspExists('A1')) {
65
- * console.log('OWASP ID found');
66
- * }
67
- * ```
68
- */
69
- export declare function owaspExists(owaspId: string): boolean;
70
- /**
71
- * Get all OWASP to NIST mappings.
72
- *
73
- * @returns Array of all mappings
74
- *
75
- * @example
76
- * ```typescript
77
- * const mappings = getAllOwaspMappings();
78
- * // Returns all 10 OWASP Top 10 mappings
79
- * ```
80
- */
81
- export declare function getAllOwaspMappings(): OwaspNistMappings;
82
- export type { OwaspNistMapping, OwaspNistMappings } from './types.js';
83
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/owasp/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAQtE;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAMjF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGvE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGhE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAMpD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,iBAAiB,CAEvD;AAGD,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
@@ -1,104 +0,0 @@
1
- /**
2
- * OWASP Top 10 to NIST mapping functions
3
- */
4
- import rawOwaspData from '../data/owasp-nist-mappings.json';
5
- const owaspData = rawOwaspData;
6
- const owaspIndex = new Map(owaspData.map(item => [item['OWASP-ID'], item]));
7
- /**
8
- * Get the NIST mapping for an OWASP Top 10 ID.
9
- *
10
- * @param owaspId - The OWASP ID (e.g., 'A1', 'A2')
11
- * @returns The mapping object, or undefined if not found
12
- *
13
- * @example
14
- * ```typescript
15
- * const mapping = getOwaspNistMapping('A1');
16
- * // Returns: { 'OWASP-ID': 'A1', 'OWASP Name': 'Injection', 'NIST-ID': 'SI-10', ... }
17
- * ```
18
- */
19
- export function getOwaspNistMapping(owaspId) {
20
- if (!owaspId || typeof owaspId !== 'string') {
21
- return undefined;
22
- }
23
- return owaspIndex.get(owaspId);
24
- }
25
- /**
26
- * Get the NIST control ID for an OWASP Top 10 ID.
27
- *
28
- * @param owaspId - The OWASP ID (e.g., 'A1', 'A2')
29
- * @returns The NIST control ID, or undefined if not found
30
- *
31
- * @example
32
- * ```typescript
33
- * const nistId = getOwaspNistControl('A1');
34
- * // Returns: 'SI-10'
35
- * ```
36
- */
37
- export function getOwaspNistControl(owaspId) {
38
- const mapping = getOwaspNistMapping(owaspId);
39
- return mapping?.['NIST-ID'];
40
- }
41
- /**
42
- * Get the OWASP vulnerability name for an OWASP ID.
43
- *
44
- * @param owaspId - The OWASP ID (e.g., 'A1', 'A2')
45
- * @returns The OWASP vulnerability name, or undefined if not found
46
- *
47
- * @example
48
- * ```typescript
49
- * const name = getOwaspName('A1');
50
- * // Returns: 'Injection'
51
- * ```
52
- */
53
- export function getOwaspName(owaspId) {
54
- const mapping = getOwaspNistMapping(owaspId);
55
- return mapping?.['OWASP Name'];
56
- }
57
- /**
58
- * Get all OWASP IDs available in the database.
59
- *
60
- * @returns Array of all OWASP IDs
61
- *
62
- * @example
63
- * ```typescript
64
- * const ids = getAllOwaspIds();
65
- * // Returns: ['A1', 'A2', 'A3', ..., 'A10']
66
- * ```
67
- */
68
- export function getAllOwaspIds() {
69
- return Array.from(owaspIndex.keys());
70
- }
71
- /**
72
- * Check if an OWASP ID exists in the database.
73
- *
74
- * @param owaspId - The OWASP ID to check
75
- * @returns true if the OWASP ID exists, false otherwise
76
- *
77
- * @example
78
- * ```typescript
79
- * if (owaspExists('A1')) {
80
- * console.log('OWASP ID found');
81
- * }
82
- * ```
83
- */
84
- export function owaspExists(owaspId) {
85
- if (!owaspId || typeof owaspId !== 'string') {
86
- return false;
87
- }
88
- return owaspIndex.has(owaspId);
89
- }
90
- /**
91
- * Get all OWASP to NIST mappings.
92
- *
93
- * @returns Array of all mappings
94
- *
95
- * @example
96
- * ```typescript
97
- * const mappings = getAllOwaspMappings();
98
- * // Returns all 10 OWASP Top 10 mappings
99
- * ```
100
- */
101
- export function getAllOwaspMappings() {
102
- return owaspData;
103
- }
104
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/owasp/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAE5D,MAAM,SAAS,GAAG,YAAiC,CAAC;AACpD,MAAM,UAAU,GAAG,IAAI,GAAG,CACxB,SA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 'OWASP-ID': string;
6
- 'OWASP Name': string;
7
- 'NIST-ID': string;
8
- Rev: number;
9
- 'NIST Name': string;
10
- }
11
- export type OwaspNistMappings = OwaspNistMapping[];
12
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/owasp/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,EAAE,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * TypeScript types for OWASP Top 10 to NIST mappings
3
- */
4
- export {};
5
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/owasp/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Query functions for ScoutSuite to NIST mappings
3
- */
4
- import type { ScoutsuiteNistMapping, ScoutsuiteNistMappings } from './types.js';
5
- /**
6
- * Get the full mapping for a ScoutSuite rule
7
- * @param rule - The ScoutSuite rule name
8
- * @returns The mapping object or undefined if not found
9
- */
10
- export declare function getScoutsuiteNistMapping(rule: string): ScoutsuiteNistMapping | undefined;
11
- /**
12
- * Get the NIST control ID for a ScoutSuite rule
13
- * @param rule - The ScoutSuite rule name
14
- * @returns The NIST control ID or undefined if not found
15
- */
16
- export declare function getScoutsuiteNistControl(rule: string): string | undefined;
17
- /**
18
- * Get all ScoutSuite rule names
19
- * @returns Array of all rule names
20
- */
21
- export declare function getAllScoutsuiteRules(): string[];
22
- /**
23
- * Check if a ScoutSuite rule exists in the mappings
24
- * @param rule - The rule name to check
25
- * @returns True if the rule exists
26
- */
27
- export declare function scoutsuiteRuleExists(rule: string): boolean;
28
- /**
29
- * Get all ScoutSuite to NIST mappings
30
- * @returns Array of all mappings
31
- */
32
- export declare function getAllScoutsuiteMappings(): ScoutsuiteNistMappings;
33
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scoutsuite/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAQhF;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAExF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGzE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,sBAAsB,CAEjE"}