0
# DevOps Security Integration
1
2
Comprehensive DevOps security integration for Azure Security Center, providing security management for Azure DevOps, GitHub, and GitLab repositories. Enables security scanning, policy enforcement, and configuration management across development platforms.
3
4
**Important**: DevOps operations require API version 2024-04-01 or 2023-09-01-preview and are not available in the default LATEST_PROFILE. Use a version-specific client:
5
6
```python
7
from azure.mgmt.security.v2024_04_01 import SecurityCenter as SecurityCenter_v2024_04_01
8
devops_client = SecurityCenter_v2024_04_01(credential, subscription_id)
9
```
10
11
## Capabilities
12
13
### DevOps Configurations
14
15
Manage DevOps security configurations and integration settings across supported platforms.
16
17
```python { .api }
18
def list(
19
**kwargs: Any
20
) -> Iterator[DevOpsConfiguration]:
21
"""
22
List DevOps configurations for the subscription.
23
24
Returns:
25
Iterator[DevOpsConfiguration]: Iterator of DevOpsConfiguration objects
26
"""
27
28
def get(
29
resource_group_name: str,
30
security_connector_name: str,
31
**kwargs: Any
32
) -> DevOpsConfiguration:
33
"""
34
Get details of a specific DevOps configuration.
35
36
Parameters:
37
- resource_group_name (str): Name of the resource group
38
- security_connector_name (str): Name of the security connector
39
40
Returns:
41
DevOpsConfiguration: DevOps configuration details
42
"""
43
44
def create_or_update(
45
resource_group_name: str,
46
security_connector_name: str,
47
dev_ops_configuration: DevOpsConfiguration,
48
**kwargs: Any
49
) -> DevOpsConfiguration:
50
"""
51
Create or update a DevOps configuration.
52
53
Parameters:
54
- resource_group_name (str): Name of the resource group
55
- security_connector_name (str): Name of the security connector
56
- dev_ops_configuration (DevOpsConfiguration): Configuration data
57
58
Returns:
59
DevOpsConfiguration: Created or updated configuration
60
"""
61
62
def update(
63
resource_group_name: str,
64
security_connector_name: str,
65
dev_ops_configuration: DevOpsConfiguration,
66
**kwargs: Any
67
) -> DevOpsConfiguration:
68
"""
69
Update a DevOps configuration.
70
71
Parameters:
72
- resource_group_name (str): Name of the resource group
73
- security_connector_name (str): Name of the security connector
74
- dev_ops_configuration (DevOpsConfiguration): Updated configuration data
75
76
Returns:
77
DevOpsConfiguration: Updated configuration
78
"""
79
80
def delete(
81
resource_group_name: str,
82
security_connector_name: str,
83
**kwargs: Any
84
) -> None:
85
"""
86
Delete a DevOps configuration.
87
88
Parameters:
89
- resource_group_name (str): Name of the resource group
90
- security_connector_name (str): Name of the security connector
91
92
Returns:
93
None
94
"""
95
```
96
97
### DevOps Operation Results
98
99
Track the results and status of DevOps security operations.
100
101
```python { .api }
102
def get(
103
resource_group_name: str,
104
security_connector_name: str,
105
operation_result_id: str,
106
**kwargs: Any
107
) -> OperationResult:
108
"""
109
Get the result of a DevOps operation.
110
111
Parameters:
112
- resource_group_name (str): Name of the resource group
113
- security_connector_name (str): Name of the security connector
114
- operation_result_id (str): ID of the operation result
115
116
Returns:
117
OperationResult: Operation result details
118
"""
119
```
120
121
### Azure DevOps Organizations
122
123
Manage Azure DevOps organization security integration and monitoring.
124
125
```python { .api }
126
def list(
127
resource_group_name: str,
128
security_connector_name: str,
129
**kwargs: Any
130
) -> Iterator[AzureDevOpsOrg]:
131
"""
132
List Azure DevOps organizations connected to the security connector.
133
134
Parameters:
135
- resource_group_name (str): Name of the resource group
136
- security_connector_name (str): Name of the security connector
137
138
Returns:
139
Iterator[AzureDevOpsOrg]: Iterator of Azure DevOps organization objects
140
"""
141
142
def get(
143
resource_group_name: str,
144
security_connector_name: str,
145
org_name: str,
146
**kwargs: Any
147
) -> AzureDevOpsOrg:
148
"""
149
Get details of a specific Azure DevOps organization.
150
151
Parameters:
152
- resource_group_name (str): Name of the resource group
153
- security_connector_name (str): Name of the security connector
154
- org_name (str): Name of the Azure DevOps organization
155
156
Returns:
157
AzureDevOpsOrg: Azure DevOps organization details
158
"""
159
160
def create_or_update(
161
resource_group_name: str,
162
security_connector_name: str,
163
org_name: str,
164
azure_dev_ops_org: AzureDevOpsOrg,
165
**kwargs: Any
166
) -> AzureDevOpsOrg:
167
"""
168
Create or update an Azure DevOps organization configuration.
169
170
Parameters:
171
- resource_group_name (str): Name of the resource group
172
- security_connector_name (str): Name of the security connector
173
- org_name (str): Name of the Azure DevOps organization
174
- azure_dev_ops_org (AzureDevOpsOrg): Organization configuration data
175
176
Returns:
177
AzureDevOpsOrg: Created or updated organization configuration
178
"""
179
180
def update(
181
resource_group_name: str,
182
security_connector_name: str,
183
org_name: str,
184
azure_dev_ops_org: AzureDevOpsOrg,
185
**kwargs: Any
186
) -> AzureDevOpsOrg:
187
"""
188
Update an Azure DevOps organization configuration.
189
190
Parameters:
191
- resource_group_name (str): Name of the resource group
192
- security_connector_name (str): Name of the security connector
193
- org_name (str): Name of the Azure DevOps organization
194
- azure_dev_ops_org (AzureDevOpsOrg): Updated organization data
195
196
Returns:
197
AzureDevOpsOrg: Updated organization configuration
198
"""
199
```
200
201
### Azure DevOps Projects
202
203
Manage Azure DevOps project security settings and monitoring.
204
205
```python { .api }
206
def list(
207
resource_group_name: str,
208
security_connector_name: str,
209
org_name: str,
210
**kwargs: Any
211
) -> Iterator[AzureDevOpsProject]:
212
"""
213
List Azure DevOps projects in an organization.
214
215
Parameters:
216
- resource_group_name (str): Name of the resource group
217
- security_connector_name (str): Name of the security connector
218
- org_name (str): Name of the Azure DevOps organization
219
220
Returns:
221
Iterator[AzureDevOpsProject]: Iterator of Azure DevOps project objects
222
"""
223
224
def get(
225
resource_group_name: str,
226
security_connector_name: str,
227
org_name: str,
228
project_name: str,
229
**kwargs: Any
230
) -> AzureDevOpsProject:
231
"""
232
Get details of a specific Azure DevOps project.
233
234
Parameters:
235
- resource_group_name (str): Name of the resource group
236
- security_connector_name (str): Name of the security connector
237
- org_name (str): Name of the Azure DevOps organization
238
- project_name (str): Name of the Azure DevOps project
239
240
Returns:
241
AzureDevOpsProject: Azure DevOps project details
242
"""
243
244
def create_or_update(
245
resource_group_name: str,
246
security_connector_name: str,
247
org_name: str,
248
project_name: str,
249
azure_dev_ops_project: AzureDevOpsProject,
250
**kwargs: Any
251
) -> AzureDevOpsProject:
252
"""
253
Create or update an Azure DevOps project configuration.
254
255
Parameters:
256
- resource_group_name (str): Name of the resource group
257
- security_connector_name (str): Name of the security connector
258
- org_name (str): Name of the Azure DevOps organization
259
- project_name (str): Name of the Azure DevOps project
260
- azure_dev_ops_project (AzureDevOpsProject): Project configuration data
261
262
Returns:
263
AzureDevOpsProject: Created or updated project configuration
264
"""
265
266
def update(
267
resource_group_name: str,
268
security_connector_name: str,
269
org_name: str,
270
project_name: str,
271
azure_dev_ops_project: AzureDevOpsProject,
272
**kwargs: Any
273
) -> AzureDevOpsProject:
274
"""
275
Update an Azure DevOps project configuration.
276
277
Parameters:
278
- resource_group_name (str): Name of the resource group
279
- security_connector_name (str): Name of the security connector
280
- org_name (str): Name of the Azure DevOps organization
281
- project_name (str): Name of the Azure DevOps project
282
- azure_dev_ops_project (AzureDevOpsProject): Updated project data
283
284
Returns:
285
AzureDevOpsProject: Updated project configuration
286
"""
287
```
288
289
### Azure DevOps Repositories
290
291
Manage Azure DevOps repository security scanning and policy enforcement.
292
293
```python { .api }
294
def list(
295
resource_group_name: str,
296
security_connector_name: str,
297
org_name: str,
298
project_name: str,
299
**kwargs: Any
300
) -> Iterator[AzureDevOpsRepository]:
301
"""
302
List Azure DevOps repositories in a project.
303
304
Parameters:
305
- resource_group_name (str): Name of the resource group
306
- security_connector_name (str): Name of the security connector
307
- org_name (str): Name of the Azure DevOps organization
308
- project_name (str): Name of the Azure DevOps project
309
310
Returns:
311
Iterator[AzureDevOpsRepository]: Iterator of repository objects
312
"""
313
314
def get(
315
resource_group_name: str,
316
security_connector_name: str,
317
org_name: str,
318
project_name: str,
319
repo_name: str,
320
**kwargs: Any
321
) -> AzureDevOpsRepository:
322
"""
323
Get details of a specific Azure DevOps repository.
324
325
Parameters:
326
- resource_group_name (str): Name of the resource group
327
- security_connector_name (str): Name of the security connector
328
- org_name (str): Name of the Azure DevOps organization
329
- project_name (str): Name of the Azure DevOps project
330
- repo_name (str): Name of the repository
331
332
Returns:
333
AzureDevOpsRepository: Repository details
334
"""
335
336
def create_or_update(
337
resource_group_name: str,
338
security_connector_name: str,
339
org_name: str,
340
project_name: str,
341
repo_name: str,
342
azure_dev_ops_repository: AzureDevOpsRepository,
343
**kwargs: Any
344
) -> AzureDevOpsRepository:
345
"""
346
Create or update an Azure DevOps repository configuration.
347
348
Parameters:
349
- resource_group_name (str): Name of the resource group
350
- security_connector_name (str): Name of the security connector
351
- org_name (str): Name of the Azure DevOps organization
352
- project_name (str): Name of the Azure DevOps project
353
- repo_name (str): Name of the repository
354
- azure_dev_ops_repository (AzureDevOpsRepository): Repository configuration data
355
356
Returns:
357
AzureDevOpsRepository: Created or updated repository configuration
358
"""
359
360
def update(
361
resource_group_name: str,
362
security_connector_name: str,
363
org_name: str,
364
project_name: str,
365
repo_name: str,
366
azure_dev_ops_repository: AzureDevOpsRepository,
367
**kwargs: Any
368
) -> AzureDevOpsRepository:
369
"""
370
Update an Azure DevOps repository configuration.
371
372
Parameters:
373
- resource_group_name (str): Name of the resource group
374
- security_connector_name (str): Name of the security connector
375
- org_name (str): Name of the Azure DevOps organization
376
- project_name (str): Name of the Azure DevOps project
377
- repo_name (str): Name of the repository
378
- azure_dev_ops_repository (AzureDevOpsRepository): Updated repository data
379
380
Returns:
381
AzureDevOpsRepository: Updated repository configuration
382
"""
383
```
384
385
### GitHub Owners
386
387
Manage GitHub organization (owner) security integration and monitoring.
388
389
```python { .api }
390
def list(
391
resource_group_name: str,
392
security_connector_name: str,
393
**kwargs: Any
394
) -> Iterator[GitHubOwner]:
395
"""
396
List GitHub owners connected to the security connector.
397
398
Parameters:
399
- resource_group_name (str): Name of the resource group
400
- security_connector_name (str): Name of the security connector
401
402
Returns:
403
Iterator[GitHubOwner]: Iterator of GitHub owner objects
404
"""
405
406
def get(
407
resource_group_name: str,
408
security_connector_name: str,
409
owner_name: str,
410
**kwargs: Any
411
) -> GitHubOwner:
412
"""
413
Get details of a specific GitHub owner.
414
415
Parameters:
416
- resource_group_name (str): Name of the resource group
417
- security_connector_name (str): Name of the security connector
418
- owner_name (str): Name of the GitHub owner
419
420
Returns:
421
GitHubOwner: GitHub owner details
422
"""
423
424
def create_or_update(
425
resource_group_name: str,
426
security_connector_name: str,
427
owner_name: str,
428
git_hub_owner: GitHubOwner,
429
**kwargs: Any
430
) -> GitHubOwner:
431
"""
432
Create or update a GitHub owner configuration.
433
434
Parameters:
435
- resource_group_name (str): Name of the resource group
436
- security_connector_name (str): Name of the security connector
437
- owner_name (str): Name of the GitHub owner
438
- git_hub_owner (GitHubOwner): Owner configuration data
439
440
Returns:
441
GitHubOwner: Created or updated owner configuration
442
"""
443
444
def update(
445
resource_group_name: str,
446
security_connector_name: str,
447
owner_name: str,
448
git_hub_owner: GitHubOwner,
449
**kwargs: Any
450
) -> GitHubOwner:
451
"""
452
Update a GitHub owner configuration.
453
454
Parameters:
455
- resource_group_name (str): Name of the resource group
456
- security_connector_name (str): Name of the security connector
457
- owner_name (str): Name of the GitHub owner
458
- git_hub_owner (GitHubOwner): Updated owner data
459
460
Returns:
461
GitHubOwner: Updated owner configuration
462
"""
463
```
464
465
### GitHub Repositories
466
467
Manage GitHub repository security scanning and policy enforcement.
468
469
```python { .api }
470
def list(
471
resource_group_name: str,
472
security_connector_name: str,
473
owner_name: str,
474
**kwargs: Any
475
) -> Iterator[GitHubRepository]:
476
"""
477
List GitHub repositories for an owner.
478
479
Parameters:
480
- resource_group_name (str): Name of the resource group
481
- security_connector_name (str): Name of the security connector
482
- owner_name (str): Name of the GitHub owner
483
484
Returns:
485
Iterator[GitHubRepository]: Iterator of GitHub repository objects
486
"""
487
488
def get(
489
resource_group_name: str,
490
security_connector_name: str,
491
owner_name: str,
492
repo_name: str,
493
**kwargs: Any
494
) -> GitHubRepository:
495
"""
496
Get details of a specific GitHub repository.
497
498
Parameters:
499
- resource_group_name (str): Name of the resource group
500
- security_connector_name (str): Name of the security connector
501
- owner_name (str): Name of the GitHub owner
502
- repo_name (str): Name of the repository
503
504
Returns:
505
GitHubRepository: Repository details
506
"""
507
508
def create_or_update(
509
resource_group_name: str,
510
security_connector_name: str,
511
owner_name: str,
512
repo_name: str,
513
git_hub_repository: GitHubRepository,
514
**kwargs: Any
515
) -> GitHubRepository:
516
"""
517
Create or update a GitHub repository configuration.
518
519
Parameters:
520
- resource_group_name (str): Name of the resource group
521
- security_connector_name (str): Name of the security connector
522
- owner_name (str): Name of the GitHub owner
523
- repo_name (str): Name of the repository
524
- git_hub_repository (GitHubRepository): Repository configuration data
525
526
Returns:
527
GitHubRepository: Created or updated repository configuration
528
"""
529
530
def update(
531
resource_group_name: str,
532
security_connector_name: str,
533
owner_name: str,
534
repo_name: str,
535
git_hub_repository: GitHubRepository,
536
**kwargs: Any
537
) -> GitHubRepository:
538
"""
539
Update a GitHub repository configuration.
540
541
Parameters:
542
- resource_group_name (str): Name of the resource group
543
- security_connector_name (str): Name of the security connector
544
- owner_name (str): Name of the GitHub owner
545
- repo_name (str): Name of the repository
546
- git_hub_repository (GitHubRepository): Updated repository data
547
548
Returns:
549
GitHubRepository: Updated repository configuration
550
"""
551
```
552
553
### GitLab Groups
554
555
Manage GitLab group security integration and monitoring.
556
557
```python { .api }
558
def list(
559
resource_group_name: str,
560
security_connector_name: str,
561
**kwargs: Any
562
) -> Iterator[GitLabGroup]:
563
"""
564
List GitLab groups connected to the security connector.
565
566
Parameters:
567
- resource_group_name (str): Name of the resource group
568
- security_connector_name (str): Name of the security connector
569
570
Returns:
571
Iterator[GitLabGroup]: Iterator of GitLab group objects
572
"""
573
574
def get(
575
resource_group_name: str,
576
security_connector_name: str,
577
group_fq_name: str,
578
**kwargs: Any
579
) -> GitLabGroup:
580
"""
581
Get details of a specific GitLab group.
582
583
Parameters:
584
- resource_group_name (str): Name of the resource group
585
- security_connector_name (str): Name of the security connector
586
- group_fq_name (str): Fully qualified name of the GitLab group
587
588
Returns:
589
GitLabGroup: GitLab group details
590
"""
591
592
def create_or_update(
593
resource_group_name: str,
594
security_connector_name: str,
595
group_fq_name: str,
596
git_lab_group: GitLabGroup,
597
**kwargs: Any
598
) -> GitLabGroup:
599
"""
600
Create or update a GitLab group configuration.
601
602
Parameters:
603
- resource_group_name (str): Name of the resource group
604
- security_connector_name (str): Name of the security connector
605
- group_fq_name (str): Fully qualified name of the GitLab group
606
- git_lab_group (GitLabGroup): Group configuration data
607
608
Returns:
609
GitLabGroup: Created or updated group configuration
610
"""
611
612
def update(
613
resource_group_name: str,
614
security_connector_name: str,
615
group_fq_name: str,
616
git_lab_group: GitLabGroup,
617
**kwargs: Any
618
) -> GitLabGroup:
619
"""
620
Update a GitLab group configuration.
621
622
Parameters:
623
- resource_group_name (str): Name of the resource group
624
- security_connector_name (str): Name of the security connector
625
- group_fq_name (str): Fully qualified name of the GitLab group
626
- git_lab_group (GitLabGroup): Updated group data
627
628
Returns:
629
GitLabGroup: Updated group configuration
630
"""
631
```
632
633
### GitLab Projects
634
635
Manage GitLab project security settings and repository scanning.
636
637
```python { .api }
638
def list(
639
resource_group_name: str,
640
security_connector_name: str,
641
group_fq_name: str,
642
**kwargs: Any
643
) -> Iterator[GitLabProject]:
644
"""
645
List GitLab projects in a group.
646
647
Parameters:
648
- resource_group_name (str): Name of the resource group
649
- security_connector_name (str): Name of the security connector
650
- group_fq_name (str): Fully qualified name of the GitLab group
651
652
Returns:
653
Iterator[GitLabProject]: Iterator of GitLab project objects
654
"""
655
656
def get(
657
resource_group_name: str,
658
security_connector_name: str,
659
group_fq_name: str,
660
project_name: str,
661
**kwargs: Any
662
) -> GitLabProject:
663
"""
664
Get details of a specific GitLab project.
665
666
Parameters:
667
- resource_group_name (str): Name of the resource group
668
- security_connector_name (str): Name of the security connector
669
- group_fq_name (str): Fully qualified name of the GitLab group
670
- project_name (str): Name of the GitLab project
671
672
Returns:
673
GitLabProject: GitLab project details
674
"""
675
676
def create_or_update(
677
resource_group_name: str,
678
security_connector_name: str,
679
group_fq_name: str,
680
project_name: str,
681
git_lab_project: GitLabProject,
682
**kwargs: Any
683
) -> GitLabProject:
684
"""
685
Create or update a GitLab project configuration.
686
687
Parameters:
688
- resource_group_name (str): Name of the resource group
689
- security_connector_name (str): Name of the security connector
690
- group_fq_name (str): Fully qualified name of the GitLab group
691
- project_name (str): Name of the GitLab project
692
- git_lab_project (GitLabProject): Project configuration data
693
694
Returns:
695
GitLabProject: Created or updated project configuration
696
"""
697
698
def update(
699
resource_group_name: str,
700
security_connector_name: str,
701
group_fq_name: str,
702
project_name: str,
703
git_lab_project: GitLabProject,
704
**kwargs: Any
705
) -> GitLabProject:
706
"""
707
Update a GitLab project configuration.
708
709
Parameters:
710
- resource_group_name (str): Name of the resource group
711
- security_connector_name (str): Name of the security connector
712
- group_fq_name (str): Fully qualified name of the GitLab group
713
- project_name (str): Name of the GitLab project
714
- git_lab_project (GitLabProject): Updated project data
715
716
Returns:
717
GitLabProject: Updated project configuration
718
"""
719
```
720
721
### GitLab Subgroups
722
723
Manage GitLab subgroup security configurations and nested group structures.
724
725
```python { .api }
726
def list(
727
resource_group_name: str,
728
security_connector_name: str,
729
group_fq_name: str,
730
**kwargs: Any
731
) -> Iterator[GitLabSubgroup]:
732
"""
733
List GitLab subgroups in a parent group.
734
735
Parameters:
736
- resource_group_name (str): Name of the resource group
737
- security_connector_name (str): Name of the security connector
738
- group_fq_name (str): Fully qualified name of the parent GitLab group
739
740
Returns:
741
Iterator[GitLabSubgroup]: Iterator of GitLab subgroup objects
742
"""
743
744
def get(
745
resource_group_name: str,
746
security_connector_name: str,
747
group_fq_name: str,
748
subgroup_name: str,
749
**kwargs: Any
750
) -> GitLabSubgroup:
751
"""
752
Get details of a specific GitLab subgroup.
753
754
Parameters:
755
- resource_group_name (str): Name of the resource group
756
- security_connector_name (str): Name of the security connector
757
- group_fq_name (str): Fully qualified name of the parent GitLab group
758
- subgroup_name (str): Name of the subgroup
759
760
Returns:
761
GitLabSubgroup: GitLab subgroup details
762
"""
763
764
def create_or_update(
765
resource_group_name: str,
766
security_connector_name: str,
767
group_fq_name: str,
768
subgroup_name: str,
769
git_lab_subgroup: GitLabSubgroup,
770
**kwargs: Any
771
) -> GitLabSubgroup:
772
"""
773
Create or update a GitLab subgroup configuration.
774
775
Parameters:
776
- resource_group_name (str): Name of the resource group
777
- security_connector_name (str): Name of the security connector
778
- group_fq_name (str): Fully qualified name of the parent GitLab group
779
- subgroup_name (str): Name of the subgroup
780
- git_lab_subgroup (GitLabSubgroup): Subgroup configuration data
781
782
Returns:
783
GitLabSubgroup: Created or updated subgroup configuration
784
"""
785
786
def update(
787
resource_group_name: str,
788
security_connector_name: str,
789
group_fq_name: str,
790
subgroup_name: str,
791
git_lab_subgroup: GitLabSubgroup,
792
**kwargs: Any
793
) -> GitLabSubgroup:
794
"""
795
Update a GitLab subgroup configuration.
796
797
Parameters:
798
- resource_group_name (str): Name of the resource group
799
- security_connector_name (str): Name of the security connector
800
- group_fq_name (str): Fully qualified name of the parent GitLab group
801
- subgroup_name (str): Name of the subgroup
802
- git_lab_subgroup (GitLabSubgroup): Updated subgroup data
803
804
Returns:
805
GitLabSubgroup: Updated subgroup configuration
806
"""
807
```
808
809
## Types
810
811
```python { .api }
812
class DevOpsConfiguration:
813
id: Optional[str]
814
name: Optional[str]
815
type: Optional[str]
816
system_data: Optional[SystemData]
817
properties: Optional[DevOpsConfigurationProperties]
818
819
class DevOpsConfigurationProperties:
820
provisioning_state: Optional[str] # Succeeded, Failed, Canceled
821
provisioning_status_message: Optional[str]
822
provisioning_status_update_time_utc: Optional[datetime]
823
top_level_inventory_list: Optional[List[str]]
824
auto_discovery: Optional[str] # Disabled, Enabled
825
826
class AzureDevOpsOrg:
827
id: Optional[str]
828
name: Optional[str]
829
type: Optional[str]
830
system_data: Optional[SystemData]
831
properties: Optional[AzureDevOpsOrgProperties]
832
833
class AzureDevOpsOrgProperties:
834
provisioning_state: Optional[str]
835
provisioning_status_message: Optional[str]
836
provisioning_status_update_time_utc: Optional[datetime]
837
onboarding_state: Optional[str] # NotOnboarded, Onboarded, NotApplicable
838
auto_discovery: Optional[str] # Disabled, Enabled
839
840
class AzureDevOpsProject:
841
id: Optional[str]
842
name: Optional[str]
843
type: Optional[str]
844
system_data: Optional[SystemData]
845
properties: Optional[AzureDevOpsProjectProperties]
846
847
class AzureDevOpsProjectProperties:
848
provisioning_state: Optional[str]
849
provisioning_status_message: Optional[str]
850
provisioning_status_update_time_utc: Optional[datetime]
851
parent_org_name: Optional[str]
852
project_id: Optional[str]
853
onboarding_state: Optional[str]
854
auto_discovery: Optional[str]
855
856
class AzureDevOpsRepository:
857
id: Optional[str]
858
name: Optional[str]
859
type: Optional[str]
860
system_data: Optional[SystemData]
861
properties: Optional[AzureDevOpsRepositoryProperties]
862
863
class AzureDevOpsRepositoryProperties:
864
provisioning_state: Optional[str]
865
provisioning_status_message: Optional[str]
866
provisioning_status_update_time_utc: Optional[datetime]
867
parent_org_name: Optional[str]
868
parent_project_name: Optional[str]
869
repo_id: Optional[str]
870
repo_url: Optional[str]
871
onboarding_state: Optional[str]
872
action_able_remediation: Optional[ActionableRemediation]
873
874
class GitHubOwner:
875
id: Optional[str]
876
name: Optional[str]
877
type: Optional[str]
878
system_data: Optional[SystemData]
879
properties: Optional[GitHubOwnerProperties]
880
881
class GitHubOwnerProperties:
882
provisioning_state: Optional[str]
883
provisioning_status_message: Optional[str]
884
provisioning_status_update_time_utc: Optional[datetime]
885
owner_url: Optional[str]
886
git_hub_internal_id: Optional[str]
887
onboarding_state: Optional[str]
888
889
class GitHubRepository:
890
id: Optional[str]
891
name: Optional[str]
892
type: Optional[str]
893
system_data: Optional[SystemData]
894
properties: Optional[GitHubRepositoryProperties]
895
896
class GitHubRepositoryProperties:
897
provisioning_state: Optional[str]
898
provisioning_status_message: Optional[str]
899
provisioning_status_update_time_utc: Optional[datetime]
900
parent_owner_name: Optional[str]
901
repo_id: Optional[str]
902
repo_url: Optional[str]
903
onboarding_state: Optional[str]
904
905
class GitLabGroup:
906
id: Optional[str]
907
name: Optional[str]
908
type: Optional[str]
909
system_data: Optional[SystemData]
910
properties: Optional[GitLabGroupProperties]
911
912
class GitLabGroupProperties:
913
provisioning_state: Optional[str]
914
provisioning_status_message: Optional[str]
915
provisioning_status_update_time_utc: Optional[datetime]
916
fully_qualified_name: Optional[str]
917
fully_qualified_friendly_name: Optional[str]
918
url: Optional[str]
919
onboarding_state: Optional[str]
920
921
class GitLabProject:
922
id: Optional[str]
923
name: Optional[str]
924
type: Optional[str]
925
system_data: Optional[SystemData]
926
properties: Optional[GitLabProjectProperties]
927
928
class GitLabProjectProperties:
929
provisioning_state: Optional[str]
930
provisioning_status_message: Optional[str]
931
provisioning_status_update_time_utc: Optional[datetime]
932
fully_qualified_name: Optional[str]
933
fully_qualified_friendly_name: Optional[str]
934
fully_qualified_parent_group_name: Optional[str]
935
url: Optional[str]
936
onboarding_state: Optional[str]
937
938
class GitLabSubgroup:
939
id: Optional[str]
940
name: Optional[str]
941
type: Optional[str]
942
system_data: Optional[SystemData]
943
properties: Optional[GitLabSubgroupProperties]
944
945
class GitLabSubgroupProperties:
946
provisioning_state: Optional[str]
947
provisioning_status_message: Optional[str]
948
provisioning_status_update_time_utc: Optional[datetime]
949
fully_qualified_name: Optional[str]
950
fully_qualified_friendly_name: Optional[str]
951
fully_qualified_parent_group_name: Optional[str]
952
url: Optional[str]
953
onboarding_state: Optional[str]
954
955
class OperationResult:
956
id: Optional[str]
957
name: Optional[str]
958
status: Optional[str] # InProgress, Succeeded, Failed
959
start_time_utc: Optional[datetime]
960
end_time_utc: Optional[datetime]
961
error: Optional[ErrorDetail]
962
properties: Optional[Any]
963
964
class ActionableRemediation:
965
state: Optional[str] # None, Enabled, Disabled
966
category_configurations: Optional[List[CategoryConfiguration]]
967
branch_configurations: Optional[List[TargetBranchConfiguration]]
968
969
class CategoryConfiguration:
970
minimum_severity_level: Optional[str]
971
category: Optional[str]
972
973
class TargetBranchConfiguration:
974
names: Optional[List[str]]
975
annotation_details: Optional[List[AnnotationDetails]]
976
```
977
978
## Usage Examples
979
980
### Setting Up DevOps Security Integration
981
982
```python
983
from azure.identity import DefaultAzureCredential
984
from azure.mgmt.security import SecurityCenter
985
986
credential = DefaultAzureCredential()
987
client = SecurityCenter(credential, "subscription-id")
988
989
# Create DevOps configuration
990
devops_config = {
991
"properties": {
992
"auto_discovery": "Enabled",
993
"top_level_inventory_list": ["organization1", "organization2"]
994
}
995
}
996
997
config = client.dev_ops_configurations.create_or_update(
998
"security-rg",
999
"devops-connector",
1000
devops_config
1001
)
1002
print(f"Created DevOps configuration: {config.name}")
1003
1004
# List all configurations
1005
configs = client.dev_ops_configurations.list()
1006
for config in configs:
1007
print(f"Config: {config.name}")
1008
print(f"Auto Discovery: {config.properties.auto_discovery}")
1009
print(f"State: {config.properties.provisioning_state}")
1010
```
1011
1012
### Azure DevOps Integration
1013
1014
```python
1015
# Configure Azure DevOps organization
1016
ado_org_config = {
1017
"properties": {
1018
"auto_discovery": "Enabled",
1019
"onboarding_state": "Onboarded"
1020
}
1021
}
1022
1023
org = client.azure_dev_ops_orgs.create_or_update(
1024
"security-rg",
1025
"devops-connector",
1026
"myorganization",
1027
ado_org_config
1028
)
1029
print(f"Configured Azure DevOps org: {org.name}")
1030
1031
# List projects in the organization
1032
projects = client.azure_dev_ops_projects.list(
1033
"security-rg",
1034
"devops-connector",
1035
"myorganization"
1036
)
1037
1038
for project in projects:
1039
print(f"Project: {project.name}")
1040
print(f"Project ID: {project.properties.project_id}")
1041
print(f"Onboarding State: {project.properties.onboarding_state}")
1042
1043
# List repositories in this project
1044
repos = client.azure_dev_ops_repos.list(
1045
"security-rg",
1046
"devops-connector",
1047
"myorganization",
1048
project.name
1049
)
1050
1051
for repo in repos:
1052
print(f" Repository: {repo.name}")
1053
print(f" URL: {repo.properties.repo_url}")
1054
print(f" Remediation State: {repo.properties.action_able_remediation.state}")
1055
```
1056
1057
### GitHub Integration
1058
1059
```python
1060
# Configure GitHub organization
1061
github_owner_config = {
1062
"properties": {
1063
"onboarding_state": "Onboarded"
1064
}
1065
}
1066
1067
owner = client.git_hub_owners.create_or_update(
1068
"security-rg",
1069
"devops-connector",
1070
"myorg",
1071
github_owner_config
1072
)
1073
print(f"Configured GitHub owner: {owner.name}")
1074
1075
# List repositories for the owner
1076
repos = client.git_hub_repos.list(
1077
"security-rg",
1078
"devops-connector",
1079
"myorg"
1080
)
1081
1082
for repo in repos:
1083
print(f"GitHub Repository: {repo.name}")
1084
print(f"Repository URL: {repo.properties.repo_url}")
1085
print(f"Repository ID: {repo.properties.repo_id}")
1086
print(f"Onboarding State: {repo.properties.onboarding_state}")
1087
1088
# Configure specific repository settings
1089
repo_config = {
1090
"properties": {
1091
"onboarding_state": "Onboarded"
1092
}
1093
}
1094
1095
repo = client.git_hub_repos.create_or_update(
1096
"security-rg",
1097
"devops-connector",
1098
"myorg",
1099
"myrepository",
1100
repo_config
1101
)
1102
```
1103
1104
### GitLab Integration
1105
1106
```python
1107
# Configure GitLab group
1108
gitlab_group_config = {
1109
"properties": {
1110
"onboarding_state": "Onboarded"
1111
}
1112
}
1113
1114
group = client.git_lab_groups.create_or_update(
1115
"security-rg",
1116
"devops-connector",
1117
"mygroup",
1118
gitlab_group_config
1119
)
1120
print(f"Configured GitLab group: {group.name}")
1121
1122
# List projects in the group
1123
projects = client.git_lab_projects.list(
1124
"security-rg",
1125
"devops-connector",
1126
"mygroup"
1127
)
1128
1129
for project in projects:
1130
print(f"GitLab Project: {project.name}")
1131
print(f"Fully Qualified Name: {project.properties.fully_qualified_name}")
1132
print(f"URL: {project.properties.url}")
1133
print(f"Parent Group: {project.properties.fully_qualified_parent_group_name}")
1134
1135
# Configure subgroups
1136
subgroups = client.git_lab_subgroups.list(
1137
"security-rg",
1138
"devops-connector",
1139
"mygroup"
1140
)
1141
1142
for subgroup in subgroups:
1143
print(f"Subgroup: {subgroup.name}")
1144
print(f"Fully Qualified Name: {subgroup.properties.fully_qualified_name}")
1145
```
1146
1147
### Monitoring DevOps Operations
1148
1149
```python
1150
# Check operation results for async operations
1151
try:
1152
result = client.dev_ops_operation_results.get(
1153
"security-rg",
1154
"devops-connector",
1155
"operation-id"
1156
)
1157
1158
print(f"Operation Status: {result.status}")
1159
print(f"Start Time: {result.start_time_utc}")
1160
print(f"End Time: {result.end_time_utc}")
1161
1162
if result.status == "Failed":
1163
print(f"Error: {result.error}")
1164
1165
except Exception as e:
1166
print(f"Operation not found or completed: {e}")
1167
1168
# Monitor onboarding states across all platforms
1169
print("\nOnboarding Summary:")
1170
print("==================")
1171
1172
# Azure DevOps
1173
ado_orgs = client.azure_dev_ops_orgs.list("security-rg", "devops-connector")
1174
for org in ado_orgs:
1175
print(f"Azure DevOps - {org.name}: {org.properties.onboarding_state}")
1176
1177
# GitHub
1178
gh_owners = client.git_hub_owners.list("security-rg", "devops-connector")
1179
for owner in gh_owners:
1180
print(f"GitHub - {owner.name}: {owner.properties.onboarding_state}")
1181
1182
# GitLab
1183
gl_groups = client.git_lab_groups.list("security-rg", "devops-connector")
1184
for group in gl_groups:
1185
print(f"GitLab - {group.name}: {group.properties.onboarding_state}")
1186
```