Commit d2dbef0 1 parent e43939f commit d2dbef0 Copy full SHA for d2dbef0
File tree 1 file changed +27
-2
lines changed
1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change 1
1
import type { Faker } from '../..' ;
2
2
import { toDate } from '../../internal/toDate' ;
3
3
4
+ /**
5
+ * The possible definitions related to
6
+ * Common Vulnerability Scoring System (CVSS).
7
+ */
4
8
export interface Cvss {
9
+ /**
10
+ * A value ranging from 0 to 10.
11
+ */
5
12
score : number ;
13
+
14
+ /**
15
+ * A compressed textual representation of the values used to derive a score
16
+ */
6
17
vector : string ;
18
+
19
+ /**
20
+ * A textual representation of the numeric score.
21
+ *
22
+ * Where:
23
+ * - None – 0
24
+ * - Low – 0.1 - 3.9
25
+ * - Medium – 4.0 - 6.9
26
+ * - High – 7.0 - 8.9
27
+ * - Critical – 9.0 - 10.0
28
+ */
7
29
rating : 'none' | 'low' | 'medium' | 'high' | 'critical' ;
8
30
}
9
31
32
+ /**
33
+ * Module to generate security related entries.
34
+ */
10
35
export class Security {
11
36
constructor ( private readonly faker : Faker ) {
12
37
// Bind `this` so namespaced is working correctly
@@ -29,7 +54,7 @@ export class Security {
29
54
*
30
55
* @example
31
56
* faker.security.cve() // 'CVE-2011-0762'
32
- * faker.security.cve({from:'2020-01-01T00:00:00.000Z', to: '2030-01-01T00:00:00.000Z'}) // 'CVE-2028-0762'
57
+ * faker.security.cve({ from:'2020-01-01T00:00:00.000Z', to: '2030-01-01T00:00:00.000Z' }) // 'CVE-2028-0762'
33
58
*/
34
59
cve (
35
60
options : {
@@ -55,7 +80,7 @@ export class Security {
55
80
* https://cwe.mitre.org/data/index.html
56
81
*
57
82
* @example
58
- * faker.security.cwe() // 'CWE-####'
83
+ * faker.security.cwe() // 'CWE-123
59
84
*/
60
85
cwe ( ) : string {
61
86
return [ 'CWE' , this . faker . datatype . number ( { min : 0 , max : 1388 } ) ] . join ( '-' ) ;
You can’t perform that action at this time.
0 commit comments