-
Notifications
You must be signed in to change notification settings - Fork 1
Add Microsoft Security DevOps workflow for IaC scanning #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,66 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# | ||
# Microsoft Security DevOps (MSDO) is a command line application which integrates static analysis tools into the development cycle. | ||
# MSDO installs, configures and runs the latest versions of static analysis tools | ||
# (including, but not limited to, SDL/security and compliance tools). | ||
# | ||
# The Microsoft Security DevOps action is currently in beta and runs on the windows-latest queue, | ||
# as well as Windows self hosted agents. ubuntu-latest support coming soon. | ||
# | ||
# https://learn.microsoft.com/en-us/azure/defender-for-cloud/github-action | ||
# | ||
# For more information about the action , check out https://github.com/microsoft/security-devops-action | ||
# | ||
# Please note this workflow do not integrate your GitHub Org with Microsoft Defender For DevOps. You have to create an integration | ||
# and provide permission before this can report data back to azure. | ||
# Read the official documentation here : https://learn.microsoft.com/en-us/azure/defender-for-cloud/quickstart-onboard-github | ||
|
||
name: "IaC Scanning - Microsoft Security DevOps (MSDO) - Defender for DevOps" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '15 03 * * 5' | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
actions: read | ||
# Write access for security-events is only required for customers looking for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS) | ||
security-events: write | ||
|
||
jobs: | ||
MSDO: | ||
# Windows and Linux agents are supported | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run Microsoft Security DevOps | ||
uses: microsoft/security-devops-action@v1.12.0 | ||
id: msdo | ||
with: | ||
# config: string. Optional. A file path to an MSDO configuration file ('*.gdnconfig'). | ||
# policy: 'GitHub' | 'microsoft' | 'none'. Optional. The name of a well-known Microsoft policy. If no configuration file or list of tools is provided, the policy may instruct MSDO which tools to run. Default: GitHub. | ||
categories: 'IaC' #string. Optional. A comma-separated list of analyzer categories to run. Values: 'code', 'artifacts', 'IaC', 'containers'. Example: 'IaC, containers'. Defaults to all. | ||
# languages: string. Optional. A comma-separated list of languages to analyze. Example: 'javascript,typescript'. Defaults to all. | ||
# tools: string. Optional. A comma-separated list of analyzer tools to run. Values: 'bandit', 'binskim', 'checkov', 'eslint', 'templateanalyzer', 'terrascan', 'trivy'. | ||
|
||
# Upload alerts to the Security tab - required for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS) | ||
- name: Upload results to Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: ${{ steps.msdo.outputs.sarifFile }} | ||
|
||
# Upload alerts file as a workflow artifact - required for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS) | ||
- name: Upload alerts file as a workflow artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: alerts | ||
path: ${{ steps.msdo.outputs.sarifFile }} |
This file contains hidden or 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,54 @@ | ||
# https://learn.microsoft.com/en-us/azure/defender-for-cloud/github-action | ||
# | ||
# For more information about the action , check out https://github.com/microsoft/security-devops-action | ||
# | ||
# Please note this workflow do not integrate your GitHub Org with Microsoft Defender For DevOps. You have to create an integration | ||
# and provide permission before this can report data back to azure. | ||
# Read the official documentation here : https://learn.microsoft.com/en-us/azure/defender-for-cloud/quickstart-onboard-github | ||
|
||
name: "Microsoft Security DevOps (MSDO) - Microsoft Defender For Devops" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '42 13 * * 5' | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
actions: read | ||
# Write access for security-events is only required for customers looking for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS) | ||
security-events: write | ||
|
||
jobs: | ||
MSDO: | ||
# Windows and Linux agents are supported | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run Microsoft Security DevOps | ||
uses: microsoft/security-devops-action@v1.12.0 | ||
|
||
id: msdo | ||
# with: | ||
# config: string. Optional. A file path to an MSDO configuration file ('*.gdnconfig'). | ||
# policy: 'GitHub' | 'microsoft' | 'none'. Optional. The name of a well-known Microsoft policy. If no configuration file or list of tools is provided, the policy may instruct MSDO which tools to run. Default: GitHub. | ||
# categories: string. Optional. A comma-separated list of analyzer categories to run. Values: 'code', 'artifacts', 'IaC', 'containers'. Example: 'IaC, containers'. Defaults to all. | ||
# languages: string. Optional. A comma-separated list of languages to analyze. Example: 'javascript,typescript'. Defaults to all. | ||
# tools: string. Optional. A comma-separated list of analyzer tools to run. Values: 'bandit', 'binskim', 'checkov', 'eslint', 'templateanalyzer', 'terrascan', 'trivy'. | ||
|
||
# Upload alerts to the Security tab - required for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS) | ||
- name: Upload results to Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: ${{ steps.msdo.outputs.sarifFile }} | ||
|
||
# Upload alerts file as a workflow artifact - required for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS) | ||
- name: Upload alerts file as a workflow artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: alerts | ||
path: ${{ steps.msdo.outputs.sarifFile }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.