You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/README.md
-5Lines changed: 0 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -290,11 +290,6 @@ journeyTracks:
290
290
- Type: `String`, one of the `overview`, `quick_start`, `tutorial`, `how_to`, `reference`.
291
291
- Optional.
292
292
293
-
### `topics`
294
-
- Purpose: Indicate the topics covered by the article. Refer to the content models for more details about adding topics. A full list of existing topics is located in the [allowed topics file](/data/allowed-topics.ts). If topics in article frontmatter and the allow-topics list become out of sync, the [topics CI test](/src/search/tests/topics.ts) will fail.
295
-
- Type: Array of `String`s
296
-
- Optional: Topics are preferred for each article, but, there may be cases where existing articles don't yet have topics, or adding a topic to a new article may not add value.
297
-
298
293
### `communityRedirect`
299
294
- Purpose: Set a custom link and link name for `Ask the GitHub community` link in the footer.
300
295
- Type: `Object`. Properties are `name` and `href`.
Copy file name to clipboardExpand all lines: content/code-security/concepts/code-scanning/about-code-scanning-alerts.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,14 +113,6 @@ The severity level for a {% data variables.product.prodname_code_scanning %} ale
113
113
114
114
When an alert has a security severity level, {% data variables.product.prodname_code_scanning %} displays and uses this level in preference to the `severity`. Security severity levels follow the industry-standard Common Vulnerability Scoring System (CVSS) that is also used for advisories in the {% data variables.product.prodname_advisory_database %}. For more information, see [CVSS: Qualitative Severity Rating Scale](https://www.first.org/cvss/v3.1/specification-document#Qualitative-Severity-Rating-Scale).
115
115
116
-
### Pull request check failures for {% data variables.product.prodname_code_scanning %} alerts
117
-
118
-
You can use rulesets to prevent pull requests from being merged when one of the following conditions is met:
119
-
120
-
{% data reusables.code-scanning.merge-protection-rulesets-conditions %}
121
-
122
-
For more information, see [AUTOTITLE](/code-security/code-scanning/managing-your-code-scanning-configuration/set-code-scanning-merge-protection). For more general information about rulesets, see [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets).
123
-
124
116
### Calculation of security severity levels
125
117
126
118
When a security query is added to the {% data variables.product.prodname_codeql %} Default or Extended query suite, the {% data variables.product.prodname_codeql %} engineering team calculates the security severity as follows.
@@ -131,3 +123,14 @@ When a security query is added to the {% data variables.product.prodname_codeql
131
123
1. When displaying alerts found by the query, translate the numerical scores to `Critical`, `High`, `Medium`, or `Low` using the CVSS definitions.
132
124
133
125
For more information, see [{% data variables.product.prodname_codeql %} CWE coverage](https://codeql.github.com/codeql-query-help/codeql-cwe-coverage/) on the {% data variables.product.prodname_codeql %} documentation site.
126
+
127
+
## About alerts in pull requests
128
+
129
+
{% data variables.product.prodname_code_scanning_caps %} alerts can appear on pull requests as check results and annotations. This happens in repositories where {% data variables.product.prodname_code_scanning %} either:
130
+
131
+
* Is configured as a pull request check (by default, this is limited to pull requests that target the default branch)
132
+
* Is configured to scan each time code is pushed (the results are mapped to any open pull requests)
133
+
134
+
You will only see an alert in a pull request if **all** the lines of code identified by the alert exist in the pull request diff.
135
+
136
+
Depending on branch protection rules, the "{% data variables.product.prodname_code_scanning_caps %} results" check may be a required check that prevents pull requests from being merged until it passes.
Copy file name to clipboardExpand all lines: content/code-security/how-tos/manage-security-alerts/manage-code-scanning-alerts/triaging-code-scanning-alerts-in-pull-requests.md
+4-38Lines changed: 4 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,59 +23,25 @@ topics:
23
23
- Repositories
24
24
---
25
25
26
+
Depending on your configuration, {% data variables.product.prodname_code_scanning %} results may appear as check results and annotations on pull requests. For more information, see [AUTOTITLE](/code-security/concepts/code-scanning/about-code-scanning-alerts#about-alerts-in-pull-requests).
26
27
27
-
## About {% data variables.product.prodname_code_scanning %} results on pull requests
28
-
29
-
In repositories where {% data variables.product.prodname_code_scanning %} is configured as a pull request check, {% data variables.product.prodname_code_scanning %} checks the code in the pull request. By default, this is limited to pull requests that target the default branch, but you can change this configuration within {% data variables.product.prodname_actions %} or in a third-party CI/CD system.
30
-
31
-
If the lines of code changed in the pull request generate {% data variables.product.prodname_code_scanning %} alerts, the alerts are reported in the following places on the pull request.
32
-
33
-
* Check results in the pull request
34
-
* The **Conversation** tab of the pull request, as part of a pull request review
35
-
* The **Files changed** tab of the pull request
36
-
37
-
> [!NOTE]
38
-
> {% data variables.product.prodname_code_scanning_caps %} displays alerts in pull requests only when all the lines of code identified by the alert exist in the pull request diff. For more information, see [AUTOTITLE](/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#source-file-locations).
39
-
40
-
{% ifversion code-scanning-autofix %}
41
-
42
-
{% data variables.copilot.copilot_autofix %} will suggest fixes for alerts from {% data variables.product.prodname_code_scanning %} analysis (including {% data variables.product.prodname_codeql %} analysis) in private repositories. For more information on working with suggestions from {% data variables.copilot.copilot_autofix_short %} in pull requests, see [Working with {% data variables.copilot.copilot_autofix_short %} suggestions for alerts on a pull request](#working-with-copilot-autofix-suggestions-for-alerts-on-a-pull-request).
43
-
44
-
{% endif %}
45
-
46
-
If you have write permission for the repository, you can see any existing {% data variables.product.prodname_code_scanning %} alerts on the **Security** tab. For information about repository alerts, see [AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/assessing-code-scanning-alerts-for-your-repository).
47
-
48
-
In repositories where {% data variables.product.prodname_code_scanning %} is configured to scan each time code is pushed, {% data variables.product.prodname_code_scanning %} will also map the results to any open pull requests and add the alerts as annotations in the same places as other pull request checks. For more information, see [AUTOTITLE](/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push).
49
-
50
-
If your pull request targets a protected branch that uses {% data variables.product.prodname_code_scanning %}, and the repository owner has configured required status checks, then the "{% data variables.product.prodname_code_scanning_caps %} results" check must pass before you can merge the pull request. For more information, see [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-status-checks-before-merging).
51
-
52
-
{% ifversion copilot-chat-ghas-alerts %}
53
-
54
-
With a {% data variables.copilot.copilot_enterprise %} license, you can also ask {% data variables.copilot.copilot_chat %} for help to better understand {% data variables.product.prodname_code_scanning %} alerts in repositories in your organization. For more information, see [AUTOTITLE](/copilot/using-github-copilot/asking-github-copilot-questions-in-githubcom#asking-questions-about-alerts-from-github-advanced-security-features).
55
-
56
-
{% endif %}
57
-
58
-
## About {% data variables.product.prodname_code_scanning %} as a pull request check
59
-
60
-
There are many options for configuring {% data variables.product.prodname_code_scanning %} as a pull request check, so the exact configuration of each repository will vary and some will have more than one check.
61
-
62
-
### {% data variables.product.prodname_code_scanning_caps %} results check
28
+
## Viewing results of the {% data variables.product.prodname_code_scanning %} check
63
29
64
30
For all configurations of {% data variables.product.prodname_code_scanning %}, the check that contains the results of {% data variables.product.prodname_code_scanning %} is: **{% data variables.product.prodname_code_scanning_caps %} results**. The results for each analysis tool used are shown separately. Any new alerts on lines of code changed in the pull request are shown as annotations.
65
31
66
32
To see the full set of alerts for the analyzed branch, click **View all branch alerts**. This opens the full alert view where you can filter all the alerts on the branch by type, severity, tag, etc. For more information, see [AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/assessing-code-scanning-alerts-for-your-repository#filtering-and-searching-for-code-scanning-alerts).
67
33
68
34

69
35
70
-
### {% data variables.product.prodname_code_scanning_caps %} results check failures
36
+
##Managing severity levels for check failures
71
37
72
38
If the {% data variables.product.prodname_code_scanning %} results check finds any problems with a severity of `error`, `critical`, or `high`, the check fails and the error is reported in the check results. If all the results found by {% data variables.product.prodname_code_scanning %} have lower severities, the alerts are treated as warnings or notes and the check succeeds.
73
39
74
40

75
41
76
42
You can override the default behavior in your repository settings, by specifying the level of severities and security severities that will cause a pull request check failure. For more information, see [AUTOTITLE](/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#defining-the-severities-causing-pull-request-check-failure).
77
43
78
-
### Other {% data variables.product.prodname_code_scanning %} checks
44
+
##Diagnosing issues with your {% data variables.product.prodname_code_scanning %} configuration
79
45
80
46
Depending on your configuration, you may see additional checks running on pull requests with {% data variables.product.prodname_code_scanning %} configured. These are usually workflows that analyze the code or that upload {% data variables.product.prodname_code_scanning %} results. These checks are useful for troubleshooting when there are problems with the analysis.
Copy file name to clipboardExpand all lines: content/code-security/how-tos/scan-code-for-vulnerabilities/scan-from-the-command-line/specifying-command-options-in-a-codeql-configuration-file.md
+12-24Lines changed: 12 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Specifying command options in a CodeQL configuration file
3
3
shortTitle: Specify command options in a CodeQL configuration file
4
-
intro: You can save default command options in a {% data variables.product.prodname_codeql %} configuration file.
4
+
intro: Save time by adding your frequently used command options and custom {% data variables.product.prodname_codeql %} packs to a {% data variables.product.prodname_codeql %} configuration file.
5
5
product: '{% data reusables.gated-features.codeql %}'
6
6
versions:
7
7
fpt: '*'
@@ -18,36 +18,24 @@ redirect_from:
18
18
contentType: how-tos
19
19
---
20
20
21
-
## About specifying command options in a {% data variables.product.prodname_codeql %} configuration file
22
-
23
-
You can save default or frequently used options for your commands in a per-user configuration file.
24
-
25
-
You can specify {% data variables.product.prodname_codeql_cli %} command options in two ways:
26
-
27
-
* Directly in the command line, using the appropriate flag.
28
-
* In a configuration (or `config`) file that {% data variables.product.prodname_codeql %} scans for relevant options each time a command is executed.
29
-
30
-
For options that are likely to change each time you execute a command, specifying the value on the command line is the most convenient way of passing the information to {% data variables.product.prodname_codeql %}. Saving options in a `config` file is a good way to specify options you use frequently. It’s also a good way to add custom {% data variables.product.prodname_codeql %} packs that you use regularly to your search path.
31
-
32
21
## Using a {% data variables.product.prodname_codeql %} configuration file
33
22
34
-
You need to save the `config` file under your home (Linux and macOS) or user profile (Windows) directory in the `.config/codeql/` subdirectory. For example, `$HOME/.config/codeql/config`.
35
-
36
-
The syntax for specifying options is as follows:
23
+
1. Create and save a `config` file under your home (Linux and macOS) or user profile (Windows) directory in the `.config/codeql/` subdirectory. For example, `$HOME/.config/codeql/config`.
24
+
1. In the `config` file, specify the options you want to apply to your {% data variables.product.prodname_codeql %} commands. The syntax for specifying options is as follows:
37
25
38
-
```shell
39
-
<command><subcommand><option><value>
40
-
```
26
+
```shell
27
+
<command><subcommand><option><value>
28
+
```
41
29
42
-
To apply the same options to more than one command you can:
30
+
1. To apply the same options to more than one command, you can:
43
31
44
-
* Omit the `<subcommand>`, which will specify the option for every `<subcommand>` to which it’s relevant.
45
-
* Omit both `<command>` and `<subcommand>`, which will globally specify the option for every `<command>` and `<subcommand>` to which it’s relevant.
32
+
* Omit `<subcommand>`, which will specify the option for every relevant `<subcommand>`
33
+
* Omit both `<command>` and `<subcommand>`, which will specify the option globally for every relevant `<command>` and `<subcommand>`
46
34
47
35
> [!NOTE]
48
-
> *`config` files only accept spaces between option flags and values—{% data variables.product.prodname_codeql %} will throw an error if you use `=` to specify an option value.
49
-
> *If you specify an option in the command line, this overrides the`config` value defined for that option.
50
-
> *If you want to specify more than one option for a `<command>`, `<subcommand>` or globally, use one line per option.
36
+
>*`config` files only accept spaces, not `=`, between option flags and values.
37
+
>*Specifying an option on the command lineoverrides any`config` value defined for that option.
38
+
>*To specify more than one option for a `<command>`, `<subcommand>`, or globally, use one line per option.
Copy file name to clipboardExpand all lines: content/code-security/how-tos/scan-code-for-vulnerabilities/scan-from-vs-code/creating-a-custom-query.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,15 +15,12 @@ redirect_from:
15
15
contentType: how-tos
16
16
---
17
17
18
-
## About custom queries
19
-
20
-
> [!NOTE]
21
-
> Creating a custom query is optional, and the [`github/codeql`](https://github.com/github/codeql) repository contains a large number of example queries you can use instead.
22
-
23
-
You create a new query file from a template for a given language, which imports the standard libraries for analyzing that language. For more information, see [About {% data variables.product.prodname_codeql %} queries](https://codeql.github.com/docs/writing-codeql-queries/about-codeql-queries/) in the {% data variables.product.prodname_codeql %} documentation.
18
+
You can write custom {% data variables.product.prodname_codeql %} queries to find specific issues relevant to your own project. This is optional, and the [`github/codeql`](https://github.com/github/codeql) repository contains a large number of example queries you can use instead.
24
19
25
20
## Creating a custom query
26
21
22
+
You create a new query file from a template for a given language, which imports the standard libraries for analyzing that language.
23
+
27
24
1. In the extension sidebar, open the "Queries" view, then click the **Create query** icon.
28
25
29
26
1. In the {% data variables.product.prodname_vscode_command_palette_shortname %}, select the target language for your query. If you've chosen not to create your custom query in an existing directory, selecting a language will autogenerate a directory labeled `codeql-custom-queries-LANGUAGE`, where `LANGUAGE` is the name of the selected language. A query template labeled `example.ql` will then be added to the existing or autogenerated directory.
@@ -32,7 +29,7 @@ You create a new query file from a template for a given language, which imports
32
29
33
30
## Further reading
34
31
35
-
You can read about how to create queries for supported languages in the {% data variables.product.prodname_codeql %} documentation:
32
+
You can read about how to write queries for supported languages in the {% data variables.product.prodname_codeql %} documentation:
36
33
37
34
*[{% data variables.product.prodname_codeql %} for C and C++](https://codeql.github.com/docs/codeql-language-guides/codeql-for-cpp/)
38
35
*[{% data variables.product.prodname_codeql %} for C#](https://codeql.github.com/docs/codeql-language-guides/codeql-for-csharp/)
Copy file name to clipboardExpand all lines: content/code-security/how-tos/secure-at-scale/configure-enterprise-security/configure-specific-tools/configuring-secret-scanning-for-your-appliance.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ The SSSE3 set of instructions is required because {% data variables.product.prod
If this returns the value `0`, it means that the SSSE3 flag is available and enabled. You can now enable {% data variables.product.prodname_secret_scanning %}. See [Enabling {% data variables.product.prodname_secret_scanning %}](#enabling-secret-scanning) below.
Copy file name to clipboardExpand all lines: content/code-security/reference/code-scanning/sarif-files/sarif-support-for-code-scanning.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,8 +169,6 @@ This is where you store details of the rules that are run during analysis. Infor
169
169
170
170
Each `result` object contains details for one alert in the codebase. Within the `results` object, you can reference the rule that detected the alert. For more information, see [Rules and results](#rules-and-results) above.
171
171
172
-
{% data reusables.code-scanning.upload-sarif-alert-limit %}
173
-
174
172
| Name | Required | Description |
175
173
|----|----|----|
176
174
| `ruleId`| {% octicon "x" aria-label="Optional" %} | The unique identifier of the rule (`reportingDescriptor.id`). For more information, see the [`reportingDescriptor` object](#reportingdescriptor-object). {% data variables.product.prodname_code_scanning_caps %} uses the rule identifier to filter results by rule on {% data variables.product.prodname_dotcom %}.
0 commit comments