-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from JFolberth/feature/ghazdo
Feature/ghazdo
- Loading branch information
Showing
8 changed files
with
146 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
parameters: | ||
- name: directoryExclusionList | ||
type: string | ||
default: '' | ||
- name: dependsOn | ||
type: object | ||
default: [] | ||
- name: serviceName | ||
type: string | ||
|
||
jobs: | ||
- job: '${{ parameters.serviceName }}_ghazdo_dependency_scanning' | ||
displayName: '${{ parameters.serviceName }} GHAzDO Dependency Scanning' | ||
dependsOn: ${{ parameters.dependsOn }} | ||
steps: | ||
- template: ../tasks/ado_ghazdo_dependency_scanning_task.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
parameters: | ||
- name: displayName | ||
type: string | ||
default: 'GitHub Advanced Security Check if Enabled' | ||
- name: dependsOn | ||
type: object | ||
default: [] | ||
|
||
jobs: | ||
- job: GHAzDOCheckJob | ||
displayName: ${{ parameters.displayName }} | ||
steps: | ||
- template: ../tasks/pwsh_ghazdo_enabled_check_task.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
parameters: | ||
- name: displayName | ||
type: string | ||
default: 'GitHub Advanced Security CodeQL Scan' | ||
- name: waitForProcessing | ||
type: boolean | ||
default: false | ||
- name: waitforProcessingInterval | ||
type: string | ||
default: '5' | ||
- name: waitForProcessingTimeout | ||
type: string | ||
default: '120' | ||
- name: GHAzDOEnabled | ||
type: string | ||
default: true | ||
|
||
|
||
|
||
steps: | ||
- task: AdvancedSecurity-Codeql-Analyze@1 | ||
#condition: ${{ eq(parameters.GHAzDOEnabled, 'True') }} | ||
displayName: ${{ parameters.displayName }} | ||
inputs: | ||
WaitForProcessing: ${{ parameters.waitForProcessing }} | ||
WaitForProcessingInterval: ${{ parameters.waitforProcessingInterval }} | ||
WaitForProcessingTimeout: ${{ parameters.waitForProcessingTimeout }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
parameters: | ||
- name: languages | ||
type: string | ||
default: '' | ||
- name: querySuite | ||
type: string | ||
default: 'security-and-quality' | ||
- name: ram | ||
type: string | ||
default: '' | ||
- name: threads | ||
type: string | ||
default: '0' | ||
- name: codeqlPathsToIgnore | ||
type: string | ||
default: '' | ||
- name: codeqlPathsToInclude | ||
type: string | ||
default: '*' | ||
- name: sourcesFolder | ||
type: string | ||
default: $(Build.SourcesDirectory) | ||
- name: logLevel | ||
type: string | ||
default: '_' | ||
- name: configFilepath | ||
type: string | ||
default: '' | ||
- name: displayName | ||
type: string | ||
default: 'Init CodeQL' | ||
- name: GHAzDOEnabled | ||
type: string | ||
default: true | ||
|
||
steps: | ||
- task: AdvancedSecurity-Codeql-Init@1 | ||
displayName: ${{ parameters.displayName }} | ||
#condition: and(succeeded(), ${{ eq(parameters.GHAzDOEnabled, 'True')}}) | ||
inputs: | ||
languages: ${{ parameters.languages }} | ||
ram: ${{ parameters.ram }} | ||
threads: ${{ parameters.threads }} | ||
codeqlpathstoignore: ${{ parameters.codeqlPathsToIgnore }} | ||
codeqlpathstoinclude: ${{ parameters.codeqlPathsToInclude }} | ||
sorucesFolder: ${{ parameters.sourcesFolder }} | ||
loglevel: ${{ parameters.logLevel }} | ||
configfilepath: ${{ parameters.configFilePath }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
parameters: | ||
- name: directoryExclusionList | ||
type: string | ||
default: '' | ||
- name: displayName | ||
type: string | ||
default: 'Advanced Security Dependency Scanning' | ||
|
||
steps: | ||
- task: AdvancedSecurity-Dependency-Scanning@1 | ||
displayName: ${{ parameters.displayName }} | ||
inputs: | ||
directoryExclusionList: ${{ parameters.directoryExclusionList }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
parameters: | ||
- name: displayName | ||
type: string | ||
default: 'Check if GitHub Advanced Security for ADO is enabled on the repository' | ||
steps: | ||
- task: PowerShell@2 | ||
displayName: ${{ parameters.displayName }} | ||
name: GHAzDOCheck | ||
inputs: | ||
failOnStderr: true | ||
targetType: 'inline' | ||
script: | | ||
$contentType = "application/json"; | ||
$headers = @{ Authorization = 'Bearer $(System.AccessToken)' }; | ||
$uri = "https://advsec.dev.azure.com/JFGHAzDO/$(System.TeamProject)/_apis/management/repositories/$(Build.Repository.Name)/enablement?includeAllProperties=true&api-version=7.2-preview.1"; | ||
$response = Invoke-RestMethod -uri $uri -method GET -Headers $headers -ContentType $contentType; | ||
$GHAzDOEnabled = $response.advSecEnabled | ||
Write-Host "##vso[task.setvariable variable=GHAzDOEnabled;isOutput=true]$GHAzDOEnabled" |