azure-devops-extension-api 4.227.0 → 4.229.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.
@@ -0,0 +1,721 @@
1
+ import * as WebApi from "../WebApi/WebApi";
2
+ export interface Alert {
3
+ /**
4
+ * Identifier for the alert. It is unqiue within Azure DevOps organization.
5
+ */
6
+ alertId: number;
7
+ /**
8
+ * Type of the alert. E.g. secret, code, etc.
9
+ */
10
+ alertType: AlertType;
11
+ /**
12
+ * Contains information for the dismissal of the alert if the alert has been dismissed.
13
+ */
14
+ dismissal: Dismissal;
15
+ /**
16
+ * This value is computed and returned by the service. This value represents the first time the service has seen this issue reported in an analysis instance.
17
+ */
18
+ firstSeenDate: Date;
19
+ /**
20
+ * This value is computed and returned by the service. If the issue is fixed, this value represents the time the service has seen this issue fixed in an analysis instance.
21
+ */
22
+ fixedDate: Date;
23
+ /**
24
+ * Reference to a git object, e.g. branch ref.
25
+ */
26
+ gitRef: string;
27
+ /**
28
+ * This value is computed and returned by the service. This value represents the first time the vulnerability was introduced.
29
+ */
30
+ introducedDate: Date;
31
+ /**
32
+ * This value is computed and returned by the service. This value represents the last time the service has seen this issue reported in an analysis instance.
33
+ */
34
+ lastSeenDate: Date;
35
+ /**
36
+ * Logical locations for the alert. This value is computed and returned by the service. It is a value based on the results from all analysis configurations. An example of a logical location is a component.
37
+ */
38
+ logicalLocations: LogicalLocation[];
39
+ /**
40
+ * This value is computed and returned by the service. It is a value based on the results from all analysis configurations. An example of a physical location is a file location.
41
+ */
42
+ physicalLocations: PhysicalLocation[];
43
+ /**
44
+ * Repository URL where the alert was detected.
45
+ */
46
+ repositoryUrl: string;
47
+ /**
48
+ * Severity of the alert.
49
+ */
50
+ severity: Severity;
51
+ /**
52
+ * This value is computed and returned by the service. It is a value based on the results from all analysis configurations.
53
+ */
54
+ state: State;
55
+ /**
56
+ * Title will only be rendered as text and does not support markdown formatting. There is a maximum character limit of 256.
57
+ */
58
+ title: string;
59
+ /**
60
+ * Tools that have detected this issue.
61
+ */
62
+ tools: Tool[];
63
+ }
64
+ /**
65
+ * Summary of the state of the alert for a given analysis configuration.
66
+ */
67
+ export interface AlertAnalysisInstance {
68
+ /**
69
+ * Analysis configuration.
70
+ */
71
+ analysisConfiguration: AnalysisConfiguration;
72
+ /**
73
+ * Analysis instance where the issue was first detected for a given analysis configuration.
74
+ */
75
+ firstSeen: AnalysisInstance;
76
+ /**
77
+ * Analysis instance where the issue was fixed for a given analysis configuration.
78
+ */
79
+ fixedIn: AnalysisInstance;
80
+ /**
81
+ * Analysis instance where the issue was last detected for a given analysis configuration.
82
+ */
83
+ lastSeen: AnalysisInstance;
84
+ /**
85
+ * The most recent instatnce of the analysis.
86
+ */
87
+ recentAnalysisInstance: AnalysisInstance;
88
+ /**
89
+ * Result state for a given analysis configuration.
90
+ */
91
+ state: State;
92
+ }
93
+ export interface AlertStateUpdate {
94
+ dismissedComment: string;
95
+ dismissedReason: DismissalType;
96
+ state: State;
97
+ }
98
+ export declare enum AlertType {
99
+ /**
100
+ * The code has an unspecified vulnerability type
101
+ */
102
+ Unknown = 0,
103
+ /**
104
+ * The code uses a dependency with a known vulnerability.
105
+ */
106
+ Dependency = 1,
107
+ /**
108
+ * The code contains a secret that has now been compromised and must be revoked.
109
+ */
110
+ Secret = 2,
111
+ /**
112
+ * The code contains a weakness determined by static analysis.
113
+ */
114
+ Code = 3
115
+ }
116
+ /**
117
+ * AnalysisConfiguration class models a build definition.
118
+ */
119
+ export interface AnalysisConfiguration {
120
+ /**
121
+ * Details for the configuration. Populated values depend on the type of configuration.
122
+ */
123
+ analysisConfigurationDetails: AnalysisConfigurationDetails;
124
+ /**
125
+ * Identifier for the analysis configuration.
126
+ */
127
+ analysisConfigurationId: number;
128
+ /**
129
+ * Type of the configuration.
130
+ */
131
+ analysisConfigurationType: AnalysisConfigurationType;
132
+ /**
133
+ * Name of the tool that ran on this configuration.
134
+ */
135
+ toolName: string;
136
+ /**
137
+ * The latest version of the tool that ran on this configuration.
138
+ */
139
+ toolVersion: string;
140
+ }
141
+ export interface AnalysisConfigurationDetails {
142
+ /**
143
+ * Reference to a git object, e.g. branch ref.
144
+ */
145
+ gitRef: string;
146
+ /**
147
+ * Is this the default branch?
148
+ */
149
+ isDefaultBranch: boolean;
150
+ /**
151
+ * Phase ID of the pipeline.
152
+ */
153
+ phaseId: string;
154
+ /**
155
+ * Phase name.
156
+ */
157
+ phaseName: string;
158
+ /**
159
+ * AzureDevOps pipeline id.
160
+ */
161
+ pipelineId: number;
162
+ /**
163
+ * Name of the pipeline.
164
+ */
165
+ pipelineName: string;
166
+ }
167
+ export declare enum AnalysisConfigurationType {
168
+ /**
169
+ * Default analysis configuration that is not attached to any other configuration data
170
+ */
171
+ Default = 0,
172
+ /**
173
+ * Ado Pipeline, contains branch, pipeline, phase, and ADOPipelineId
174
+ */
175
+ AdoPipeline = 1
176
+ }
177
+ /**
178
+ * AnalysisInstance class models a build.
179
+ */
180
+ export interface AnalysisInstance {
181
+ /**
182
+ * CommitId is a commit id for that instance
183
+ */
184
+ commitId: string;
185
+ /**
186
+ * Analysis configuration.
187
+ */
188
+ configuration: AnalysisConfiguration;
189
+ /**
190
+ * Date when the analysis was created.
191
+ */
192
+ createdDate: Date;
193
+ /**
194
+ * InstanceIdentifier is a key that uniquely establishes this instance
195
+ */
196
+ instanceIdentifier: string;
197
+ /**
198
+ * Results that were reported by the analysis.
199
+ */
200
+ results: AnalysisResult[];
201
+ /**
202
+ * Url is the permalink to the build.
203
+ */
204
+ url: string;
205
+ }
206
+ export interface AnalysisResult {
207
+ analysisResultId: number;
208
+ firstIntroducedInstanceId: number;
209
+ fixedInstanceId: number;
210
+ introducedInstanceId: number;
211
+ lastSeenInstanceId: number;
212
+ result: Result;
213
+ state: State;
214
+ }
215
+ export interface Branch {
216
+ branchId: number;
217
+ deletedDate: Date;
218
+ name: string;
219
+ }
220
+ /**
221
+ * This enum defines the dependency components.
222
+ */
223
+ export declare enum ComponentType {
224
+ Unknown = 0,
225
+ NuGet = 1,
226
+ /**
227
+ * Indicates the component is an Npm package.
228
+ */
229
+ Npm = 2,
230
+ /**
231
+ * Indicates the component is a Maven artifact.
232
+ */
233
+ Maven = 3,
234
+ /**
235
+ * Indicates the component is a Git repository.
236
+ */
237
+ Git = 4,
238
+ /**
239
+ * Indicates the component is not any of the supported component types by Governance.
240
+ */
241
+ Other = 5,
242
+ /**
243
+ * Indicates the component is a Ruby gem.
244
+ */
245
+ RubyGems = 6,
246
+ /**
247
+ * Indicates the component is a Cargo package.
248
+ */
249
+ Cargo = 7,
250
+ /**
251
+ * Indicates the component is a Pip package.
252
+ */
253
+ Pip = 8,
254
+ /**
255
+ * Indicates the component is a loose file. Not a package as understood by different package managers.
256
+ */
257
+ File = 9,
258
+ Go = 10,
259
+ /**
260
+ * Indicates the component is a Docker Image
261
+ */
262
+ DockerImage = 11,
263
+ /**
264
+ * Indicates the component is a CocoaPods pod.
265
+ */
266
+ Pod = 12,
267
+ /**
268
+ * Indicates the component is found in a linux environment. A package understood by linux based package managers like apt and rpm.
269
+ */
270
+ Linux = 13,
271
+ /**
272
+ * Indicates the component is a Conda package.
273
+ */
274
+ Conda = 14,
275
+ /**
276
+ * Indicates the component is a Docker Reference.
277
+ */
278
+ DockerReference = 15,
279
+ /**
280
+ * Indicates the component is a Vcpkg Package.
281
+ */
282
+ Vcpkg = 16
283
+ }
284
+ /**
285
+ * Information about a vulnerable dependency
286
+ */
287
+ export interface Dependency {
288
+ /**
289
+ * Dependency name
290
+ */
291
+ componentName: string;
292
+ /**
293
+ * Source of the dependency
294
+ */
295
+ componentType: ComponentType;
296
+ /**
297
+ * Version information
298
+ */
299
+ componentVersion: string;
300
+ /**
301
+ * Unique ID for the dependency
302
+ */
303
+ dependencyId: number;
304
+ }
305
+ /**
306
+ * An instance of a vulnerable dependency that was detected
307
+ */
308
+ export interface DependencyResult {
309
+ /**
310
+ * Information about the vulnerable dependency that was found
311
+ */
312
+ dependency: Dependency;
313
+ /**
314
+ * Unique ID for this dependency
315
+ */
316
+ dependencyResultId: number;
317
+ /**
318
+ * ID for the Result that this instance belongs to
319
+ */
320
+ resultId: number;
321
+ /**
322
+ * Heirarchal information when multiple instances are found
323
+ */
324
+ rootDependencyId: number;
325
+ /**
326
+ * Information about where the dependency was found
327
+ */
328
+ versionControlFilePath: VersionControlFilePath;
329
+ }
330
+ /**
331
+ * Information about an alert dismissal
332
+ */
333
+ export interface Dismissal {
334
+ /**
335
+ * Unique ID for this dismissal
336
+ */
337
+ dismissalId: number;
338
+ /**
339
+ * Reason for the dismissal
340
+ */
341
+ dismissalType: DismissalType;
342
+ /**
343
+ * Informational message attached to the dismissal
344
+ */
345
+ message: string;
346
+ requestedOn: Date;
347
+ /**
348
+ * Identity that dismissed the alert
349
+ */
350
+ stateChangedBy: string;
351
+ /**
352
+ * Identity that dismissed the alert
353
+ */
354
+ stateChangedByIdentity: WebApi.IdentityRef;
355
+ }
356
+ export declare enum DismissalType {
357
+ /**
358
+ * Dismissal type unknown
359
+ */
360
+ Unknown = 0,
361
+ /**
362
+ * Dismissal indicating alert has been fixed
363
+ */
364
+ Fixed = 1,
365
+ /**
366
+ * Dismissal indicating user is accepting a risk for the alert
367
+ */
368
+ AcceptedRisk = 2,
369
+ /**
370
+ * Dismissal indicating alert is a false positive and will likely not be fixed.
371
+ */
372
+ FalsePositive = 3
373
+ }
374
+ export interface LogicalLocation {
375
+ fullyQualifiedName: string;
376
+ /**
377
+ * Possible values: "unknown" "rootDependency" and "vulnerableDependency"
378
+ */
379
+ kind: string;
380
+ }
381
+ /**
382
+ * Location in the source control system where the issue was found
383
+ */
384
+ export interface PhysicalLocation {
385
+ /**
386
+ * Path of the file where the issue was found
387
+ */
388
+ filePath: string;
389
+ /**
390
+ * Details about the location where the issue was found including a snippet
391
+ */
392
+ region: Region;
393
+ /**
394
+ * Source control system-specific information about the location
395
+ */
396
+ versionControl: VersionControlDetails;
397
+ }
398
+ export interface Pipeline {
399
+ adoPipelineId: number;
400
+ name: string;
401
+ phase: string;
402
+ phaseId: string;
403
+ }
404
+ export interface Region {
405
+ /**
406
+ * The column where the code snippet ends
407
+ */
408
+ columnEnd: number;
409
+ /**
410
+ * The column where the code snippet starts
411
+ */
412
+ columnStart: number;
413
+ /**
414
+ * A subset of the code snippet highlighting the issue
415
+ */
416
+ highlightSnippet: string;
417
+ /**
418
+ * The line number where the code snippet ends
419
+ */
420
+ lineEnd: number;
421
+ /**
422
+ * The line number where the code snippet starts
423
+ */
424
+ lineStart: number;
425
+ /**
426
+ * The full code snippet
427
+ */
428
+ snippet: string;
429
+ }
430
+ export interface Result {
431
+ /**
432
+ * Additional information about the alert. Valid when ResultType is Dependency
433
+ */
434
+ dependencyResult: DependencyResult;
435
+ /**
436
+ * Full fingerprint of the Result. This is used to detect duplicate instances of the same alert
437
+ */
438
+ fingerprint: string;
439
+ /**
440
+ * Unique ID of the fingerprint of the Result
441
+ */
442
+ fingerprintId: number;
443
+ /**
444
+ * Unique ID of the Result
445
+ */
446
+ resultId: number;
447
+ /**
448
+ * This is the index into the SARIF Results array. If we have to do any tool specific insertions, we'll use this key to index back into the SARIF Results array.
449
+ */
450
+ resultIndex: number;
451
+ /**
452
+ * Detailed description of the rule that triggered the alert
453
+ */
454
+ resultMessage: string;
455
+ /**
456
+ * The type of rule that triggered the alert
457
+ */
458
+ resultType: ResultType;
459
+ /**
460
+ * ID of the rule that the triggered the alert
461
+ */
462
+ ruleId: number;
463
+ /**
464
+ * Short description of the rule that triggered the alert
465
+ */
466
+ ruleShortDescription: string;
467
+ /**
468
+ * The severity of the alert
469
+ */
470
+ severity: Severity;
471
+ /**
472
+ * Additional information about the alert. Valid when ResultType is VersionControl
473
+ */
474
+ versionControlResult: VersionControlResult;
475
+ }
476
+ /**
477
+ * This enum defines the different result types.
478
+ */
479
+ export declare enum ResultType {
480
+ /**
481
+ * The result was found from an unspecified analysis type
482
+ */
483
+ Unknown = 0,
484
+ /**
485
+ * The result was found from dependency analysis
486
+ */
487
+ Dependency = 1,
488
+ /**
489
+ * The result was found from static code analysis
490
+ */
491
+ VersionControl = 2
492
+ }
493
+ /**
494
+ * The analysis rule that caused the alert.
495
+ */
496
+ export interface Rule {
497
+ /**
498
+ * Additional properties of this rule
499
+ */
500
+ additionalProperties: {
501
+ [key: string]: any;
502
+ };
503
+ /**
504
+ * Description of what this rule detects
505
+ */
506
+ description: string;
507
+ /**
508
+ * Plain-text rule identifier
509
+ */
510
+ friendlyName: string;
511
+ /**
512
+ * Additional information about this rule
513
+ */
514
+ helpMessage: string;
515
+ /**
516
+ * Tool-specific rule identifier
517
+ */
518
+ opaqueId: string;
519
+ /**
520
+ * Markdown-formatted list of resources to learn more about the Rule. In some cases, RuleInfo.AdditionalProperties.advisoryUrls is used instead.
521
+ */
522
+ resources: string;
523
+ /**
524
+ * Classification tags for this rule
525
+ */
526
+ tags: string[];
527
+ }
528
+ export interface SearchCriteria {
529
+ /**
530
+ * If provided, only return alerts of this type. Otherwise, return alerts of all types.
531
+ */
532
+ alertType: AlertType;
533
+ /**
534
+ * If provided, only alerts for this dependency are returned. \<br /\>Otherwise, return alerts for all dependencies. \<br /\>In a sarif submission, a dependency (or a vulnerable component) is specified in result.RelatedLocations[].logicalLocation.
535
+ */
536
+ dependencyName: string;
537
+ /**
538
+ * If provided, only return alerts last seen after this date. \<br /\>Otherwise return all alerts.
539
+ */
540
+ fromDate: Date;
541
+ /**
542
+ * If provided, only return alerts whose titles match this pattern.
543
+ */
544
+ keywords: string;
545
+ /**
546
+ * If true, only return alerts found on the default branch of the repository. \<br /\>If there have been no runs completed on the default branch, the last run is used instead regardless of the branch used for that run. \<br /\>This option is ignored if ref is provided.
547
+ */
548
+ onlyDefaultBranchAlerts: boolean;
549
+ /**
550
+ * If provided with pipelineName, only return alerts detected in this pipeline phase \<br /\>Otherwise, return alerts detected in all phases.
551
+ */
552
+ phaseId: string;
553
+ /**
554
+ * If provided with pipelineName, only return alerts detected in this pipeline phase \<br /\>Otherwise, return alerts detected in all phases.
555
+ */
556
+ phaseName: string;
557
+ /**
558
+ * If provided, only return alerts detected in this pipeline. \<br /\>Otherwise, return alerts detected in all pipelines.
559
+ */
560
+ pipelineName: string;
561
+ /**
562
+ * If provided, only include alerts for this ref. \<br /\>If not provided and OnlyDefaultBranch is true, only include alerts found on the default branch or last run branch if there is no analysis configuration for the default branch. \<br /\>Otherwise, include alerts from all branches.
563
+ */
564
+ ref: string;
565
+ /**
566
+ * If provided, only return alerts for this rule. \<br /\>Otherwise, return alerts of all rules.
567
+ */
568
+ ruleId: string;
569
+ /**
570
+ * If provided, only return alerts for this rule. \<br /\>Otherwise, return alerts for all rules.
571
+ */
572
+ ruleName: string;
573
+ /**
574
+ * If provided, only return alerts at these severities. \<br /\>Otherwise, return alerts at any serverity.
575
+ */
576
+ severities: Severity[];
577
+ /**
578
+ * If provided, only return alerts in these states. \<br /\>Otherwise, return alerts in any state.
579
+ */
580
+ states: State[];
581
+ /**
582
+ * If provided, only return alerts last seen before this date. \<br /\>Otherwise return all alerts.
583
+ */
584
+ toDate: Date;
585
+ }
586
+ export declare enum Severity {
587
+ Low = 0,
588
+ Medium = 1,
589
+ High = 2,
590
+ Critical = 3
591
+ }
592
+ export declare enum State {
593
+ /**
594
+ * Alert is in an indeterminate state
595
+ */
596
+ Unknown = 0,
597
+ /**
598
+ * Alert has been detected in the code
599
+ */
600
+ Active = 1,
601
+ /**
602
+ * Alert was dismissed by a user
603
+ */
604
+ Dismissed = 2,
605
+ /**
606
+ * The issue is no longer detected in the code
607
+ */
608
+ Fixed = 4,
609
+ /**
610
+ * The tool has determined that the issue is no longer a risk
611
+ */
612
+ AutoDismissed = 8
613
+ }
614
+ /**
615
+ * An Analysis tool that can generate security alerts
616
+ */
617
+ export interface Tool {
618
+ /**
619
+ * Name of the tool
620
+ */
621
+ name: string;
622
+ /**
623
+ * The rules that the tool defines
624
+ */
625
+ rules: Rule[];
626
+ }
627
+ export interface UxFilters {
628
+ /**
629
+ * Branches to display alerts for. If empty, show alerts from all branches
630
+ */
631
+ branches: Branch[];
632
+ packages: Dependency[];
633
+ /**
634
+ * Pipelines to show alerts for. If empty, show alerts for all pipelines
635
+ */
636
+ pipelines: Pipeline[];
637
+ progressPercentage: number;
638
+ rules: Rule[];
639
+ secretTypes: string[];
640
+ /**
641
+ * Alert severities to show. If empty show all alert servities
642
+ */
643
+ severities: Severity[];
644
+ /**
645
+ * Alert states to show. If empty show all alert states
646
+ */
647
+ states: State[];
648
+ }
649
+ /**
650
+ * Information for locating files in a source control system
651
+ */
652
+ export interface VersionControlDetails {
653
+ commitHash: string;
654
+ itemUrl: string;
655
+ }
656
+ export interface VersionControlFilePath {
657
+ /**
658
+ * Path of the file in the version control system
659
+ */
660
+ filePath: string;
661
+ /**
662
+ * Hash of the file in the version control system
663
+ */
664
+ filePathHash: number[];
665
+ /**
666
+ * Unique ID for the file in the version control system
667
+ */
668
+ versionControlFilePathId: number;
669
+ }
670
+ export interface VersionControlResult {
671
+ /**
672
+ * The ID to associate this structure with the cooresponding Result
673
+ */
674
+ resultId: number;
675
+ /**
676
+ * Information about the snippet where the Result was found
677
+ */
678
+ versionControlSnippet: VersionControlSnippet;
679
+ }
680
+ export interface VersionControlSnippet {
681
+ /**
682
+ * column in the code file where the snippet ends
683
+ */
684
+ endColumn: number;
685
+ /**
686
+ * line in the code file where the snippet ends
687
+ */
688
+ endLine: number;
689
+ /**
690
+ * subset of the code snippet highlighting the alert issue
691
+ */
692
+ highlightSnippet: string;
693
+ /**
694
+ * larger code snippet
695
+ */
696
+ snippet: string;
697
+ /**
698
+ * column in the code file where the snippet starts
699
+ */
700
+ startColumn: number;
701
+ /**
702
+ * line in the code file where the snippet starts
703
+ */
704
+ startLine: number;
705
+ /**
706
+ * Version control system where the code was found
707
+ */
708
+ versionControl: string;
709
+ /**
710
+ * path of the code file in the version control system
711
+ */
712
+ versionControlFilePath: VersionControlFilePath;
713
+ /**
714
+ * Unique Id number for the file path
715
+ */
716
+ versionControlFilePathId: number;
717
+ /**
718
+ * Unique Id number for this snippet
719
+ */
720
+ versionControlSnippetId: number;
721
+ }