File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change 11import type { Faker } from '../..' ;
22import { toDate } from '../../internal/toDate' ;
33
4+ /**
5+ * The possible definitions related to
6+ * Common Vulnerability Scoring System (CVSS).
7+ */
48export interface Cvss {
9+ /**
10+ * A value ranging from 0 to 10.
11+ */
512 score : number ;
13+
14+ /**
15+ * A compressed textual representation of the values used to derive a score
16+ */
617 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+ */
729 rating : 'none' | 'low' | 'medium' | 'high' | 'critical' ;
830}
931
32+ /**
33+ * Module to generate security related entries.
34+ */
1035export class Security {
1136 constructor ( private readonly faker : Faker ) {
1237 // Bind `this` so namespaced is working correctly
@@ -29,7 +54,7 @@ export class Security {
2954 *
3055 * @example
3156 * 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'
3358 */
3459 cve (
3560 options : {
@@ -55,7 +80,7 @@ export class Security {
5580 * https://cwe.mitre.org/data/index.html
5681 *
5782 * @example
58- * faker.security.cwe() // 'CWE-####'
83+ * faker.security.cwe() // 'CWE-123
5984 */
6085 cwe ( ) : string {
6186 return [ 'CWE' , this . faker . datatype . number ( { min : 0 , max : 1388 } ) ] . join ( '-' ) ;
You can’t perform that action at this time.
0 commit comments