Skip to content

Commit a7bc3b6

Browse files
authored
Add CodeQL (#78)
As in title, part of 1ES migration
1 parent 55111a5 commit a7bc3b6

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

.github/workflows/codeQL.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This workflow generates weekly CodeQL reports for this repo, a security requirements.
2+
# The workflow is adapted from the following reference: https://github.com/Azure-Samples/azure-functions-python-stream-openai/pull/2/files
3+
# Generic comments on how to modify these file are left intactfor future maintenance.
4+
5+
name: "CodeQL"
6+
7+
on:
8+
push:
9+
branches: [ "main", "*" ] # TODO: remove development branch after approval
10+
pull_request:
11+
branches: [ "main", "*"] # TODO: remove development branch after approval
12+
schedule:
13+
- cron: '0 0 * * 1' # Weekly Monday run, needed for weekly reports
14+
workflow_call: # allows to be invoked as part of a larger workflow
15+
workflow_dispatch: # allows for the workflow to run manually see: https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow
16+
17+
jobs:
18+
19+
analyze:
20+
name: Analyze
21+
runs-on: windows-latest
22+
permissions:
23+
actions: read
24+
contents: read
25+
security-events: write
26+
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: ['csharp'] # note: There are no powershell CodeQL queries, so powershell is not a requirement for CodeQL (at time of writing)
32+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
33+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
34+
35+
steps:
36+
# Initializes the CodeQL tools for scanning.
37+
- name: Initialize CodeQL
38+
uses: github/codeql-action/init@v3
39+
with:
40+
languages: ${{ matrix.language }}
41+
# If you wish to specify custom queries, you can do so here or in a config file.
42+
# By default, queries listed here will override any specified in a config file.
43+
# Prefix the list here with "+" to use these queries and those in the config file.
44+
45+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
46+
# queries: security-extended,security-and-quality
47+
48+
- uses: actions/checkout@v3
49+
with:
50+
submodules: true
51+
52+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
53+
# If this step fails, then you should remove it and run the build manually (see below)
54+
- name: Autobuild
55+
uses: github/codeql-action/autobuild@v2
56+
57+
# Run CodeQL analysis
58+
- name: Perform CodeQL Analysis
59+
uses: github/codeql-action/analyze@v3
60+
with:
61+
category: "/language:${{matrix.language}}"

eng/ci/official-build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ trigger:
1010
# CI only, does not trigger on PRs.
1111
pr: none
1212

13+
schedules:
14+
# Build nightly to catch any new CVEs and report SDL often.
15+
# We are also required to generated CodeQL reports weekly, so this
16+
# helps us meet that.
17+
- cron: "0 0 * * *"
18+
displayName: Nightly Build
19+
branches:
20+
include:
21+
- main
22+
always: true
23+
1324
resources:
1425
repositories:
1526
- repository: 1es

0 commit comments

Comments
 (0)