Skip to content

Commit 5499a65

Browse files
committed
Merged PR 6427: FIX: Disable BinSkim for Ubuntu and macOS
#### AI description (iteration 2) #### PR Classification This pull request fixes pipeline configuration issues by disabling BinSkim for Ubuntu and macOS builds. #### PR Summary The changes update pipeline YAML files to disable the BinSkim security tool where it is not applicable, adjust variable declaration formats, and refine configuration comments. - **`OneBranchPipelines/stages/build-linux-single-stage.yml`**: Reformats variable definitions and adds a template context to disable BinSkim for Linux with a clear justification. - **`OneBranchPipelines/stages/build-macos-single-stage.yml`**: Revises variable declarations and inserts a template context to disable BinSkim for macOS with an appropriate explanation. - **`OneBranchPipelines/build-release-package-pipeline.yml`**: Updates the APIScan section with modified comments and adds a justification for its disablement. - **`tests/test_006_exceptions.py`**: Contains merge conflict markers, indicating unresolved conflict sections that require attention. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #40398
1 parent 7302bf1 commit 5499a65

File tree

6 files changed

+40
-14
lines changed

6 files changed

+40
-14
lines changed

OneBranchPipelines/build-release-package-pipeline.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,10 @@ extends:
152152
suppressionSet: default
153153

154154
# ApiScan - Scans APIs for security vulnerabilities
155-
# Disabled: Requires specific binary paths and symbols not applicable to Python wheels
155+
# Disabled: Not applicable to Python wheel distribution model
156156
apiscan:
157157
enabled: false
158+
justificationForDisabling: 'APIScan requires PDB symbols for native Windows DLLs. Python wheels primarily contain .pyd files and Python code, better covered by BinSkim. JDBC team also has APIScan disabled for similar reasons.'
158159

159160
# Armory - Security scanning for binaries
160161
armory:

OneBranchPipelines/jobs/consolidate-artifacts-job.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ jobs:
1919
vmImage: 'ubuntu-latest'
2020

2121
variables:
22-
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
22+
# Disable BinSkim - consolidation job only downloads artifacts, no binary builds
23+
- name: ob_sdl_binskim_enabled
24+
value: false
25+
- name: ob_outputDirectory
26+
value: '$(Build.ArtifactStagingDirectory)'
2327

2428
steps:
2529
- checkout: none # No source code needed for consolidation

OneBranchPipelines/stages/build-linux-single-stage.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ stages:
2929
jobs:
3030
- job: ${{ parameters.jobName }}
3131
displayName: 'Build Wheels - ${{ parameters.linuxTag }} ${{ parameters.arch }}'
32+
3233
pool:
3334
type: linux
3435
isCustom: true
@@ -38,11 +39,19 @@ stages:
3839
timeoutInMinutes: 120
3940

4041
variables:
41-
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
42-
LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2204:latest'
43-
LINUX_TAG: ${{ parameters.linuxTag }}
44-
ARCH: ${{ parameters.arch }}
45-
DOCKER_PLATFORM: ${{ parameters.dockerPlatform }}
42+
# Disable BinSkim for Linux - requires ICU libraries not available in containers
43+
- name: ob_sdl_binskim_enabled
44+
value: false
45+
- name: ob_outputDirectory
46+
value: '$(Build.ArtifactStagingDirectory)'
47+
- name: LinuxContainerImage
48+
value: 'onebranch.azurecr.io/linux/ubuntu-2204:latest'
49+
- name: LINUX_TAG
50+
value: ${{ parameters.linuxTag }}
51+
- name: ARCH
52+
value: ${{ parameters.arch }}
53+
- name: DOCKER_PLATFORM
54+
value: ${{ parameters.dockerPlatform }}
4655

4756
steps:
4857
- checkout: self
@@ -200,7 +209,7 @@ stages:
200209
# ESRP Malware scanning (Official builds only)
201210
- ${{ if and(eq(parameters.signingEnabled, true), eq(parameters.oneBranchType, 'Official')) }}:
202211
- task: EsrpMalwareScanning@5
203-
displayName: 'ESRP MalwareScanning - Python Wheels'
212+
displayName: 'ESRP MalwareScanning - Python Wheels (Official)'
204213
inputs:
205214
ConnectedServiceName: '$(SigningEsrpConnectedServiceName)'
206215
AppRegistrationClientId: '$(SigningAppRegistrationClientId)'
@@ -209,6 +218,7 @@ stages:
209218
UseMSIAuthentication: true
210219
FolderPath: '$(ob_outputDirectory)/wheels'
211220
Pattern: '*.whl'
221+
SessionTimeout: 60
212222
CleanupTempStorage: 1
213223
VerboseLogin: 1
214224

@@ -224,6 +234,7 @@ stages:
224234
UseMSIAuthentication: true
225235
FolderPath: '$(ob_outputDirectory)/wheels'
226236
Pattern: '*.whl'
237+
SessionTimeout: 60
227238
CleanupTempStorage: 1
228239
VerboseLogin: 1
229240

OneBranchPipelines/stages/build-macos-single-stage.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ stages:
2626
jobs:
2727
- job: ${{ parameters.jobName }}
2828
displayName: 'Build Wheel - Python ${{ parameters.pythonVersion }} universal2'
29+
2930
pool:
3031
type: linux
3132
isCustom: true
@@ -34,10 +35,17 @@ stages:
3435
timeoutInMinutes: 120
3536

3637
variables:
37-
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
38-
LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2204:latest'
39-
pythonVersion: ${{ parameters.pythonVersion }}
40-
shortPyVer: ${{ parameters.shortPyVer }}
38+
# Disable BinSkim for macOS - primarily designed for Windows binaries
39+
- name: ob_sdl_binskim_enabled
40+
value: false
41+
- name: ob_outputDirectory
42+
value: '$(Build.ArtifactStagingDirectory)'
43+
- name: LinuxContainerImage
44+
value: 'onebranch.azurecr.io/linux/ubuntu-2204:latest'
45+
- name: pythonVersion
46+
value: ${{ parameters.pythonVersion }}
47+
- name: shortPyVer
48+
value: ${{ parameters.shortPyVer }}
4149

4250
steps:
4351
- checkout: self
@@ -142,7 +150,7 @@ stages:
142150
# ESRP Malware scanning (Official builds only)
143151
- ${{ if and(eq(parameters.signingEnabled, true), eq(parameters.oneBranchType, 'Official')) }}:
144152
- task: EsrpMalwareScanning@5
145-
displayName: 'ESRP MalwareScanning - Python Wheels'
153+
displayName: 'ESRP MalwareScanning - Python Wheels (Official)'
146154
inputs:
147155
ConnectedServiceName: '$(SigningEsrpConnectedServiceName)'
148156
AppRegistrationClientId: '$(SigningAppRegistrationClientId)'
@@ -151,6 +159,7 @@ stages:
151159
UseMSIAuthentication: true
152160
FolderPath: '$(ob_outputDirectory)/wheels'
153161
Pattern: '*.whl'
162+
SessionTimeout: 60
154163
CleanupTempStorage: 1
155164
VerboseLogin: 1
156165

@@ -166,6 +175,7 @@ stages:
166175
UseMSIAuthentication: true
167176
FolderPath: '$(ob_outputDirectory)/wheels'
168177
Pattern: '*.whl'
178+
SessionTimeout: 60
169179
CleanupTempStorage: 1
170180
VerboseLogin: 1
171181

OneBranchPipelines/stages/build-windows-single-stage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ stages:
200200
UseMSIAuthentication: true
201201
FolderPath: '$(ob_outputDirectory)/wheels'
202202
Pattern: '*.whl'
203+
SessionTimeout: 60
203204
CleanupTempStorage: 1
204205
VerboseLogin: 1
205206

tests/test_006_exceptions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from mssql_python import ConnectionStringParseError
1919

2020

21-
2221
def drop_table_if_exists(cursor, table_name):
2322
"""Drop the table if it exists"""
2423
try:

0 commit comments

Comments
 (0)