Skip to content

Commit bbc6e38

Browse files
authored
Merge pull request #43192 from github/repo-sync
Repo sync
2 parents 7c721f6 + 95e12c6 commit bbc6e38

File tree

214 files changed

+258
-912
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+258
-912
lines changed

content/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,6 @@ journeyTracks:
290290
- Type: `String`, one of the `overview`, `quick_start`, `tutorial`, `how_to`, `reference`.
291291
- Optional.
292292

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-
298293
### `communityRedirect`
299294
- Purpose: Set a custom link and link name for `Ask the GitHub community` link in the footer.
300295
- Type: `Object`. Properties are `name` and `href`.

content/code-security/concepts/code-scanning/about-code-scanning-alerts.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,6 @@ The severity level for a {% data variables.product.prodname_code_scanning %} ale
113113

114114
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).
115115

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-
124116
### Calculation of security severity levels
125117

126118
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
131123
1. When displaying alerts found by the query, translate the numerical scores to `Critical`, `High`, `Medium`, or `Low` using the CVSS definitions.
132124

133125
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.

content/code-security/how-tos/manage-security-alerts/manage-code-scanning-alerts/triaging-code-scanning-alerts-in-pull-requests.md

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -23,59 +23,25 @@ topics:
2323
- Repositories
2424
---
2525

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).
2627

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
6329

6430
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.
6531

6632
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).
6733

6834
![Screenshot of the {% data variables.product.prodname_code_scanning_caps %} results check on a pull request. The "View all branch alerts" link is highlighted with a dark orange outline.](/assets/images/help/repository/code-scanning-results-check.png)
6935

70-
### {% data variables.product.prodname_code_scanning_caps %} results check failures
36+
## Managing severity levels for check failures
7137

7238
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.
7339

7440
![Screenshot of the merge box for a pull request. The "Code scanning results / CodeQL" check has "1 new alert including 1 high severity security v..."](/assets/images/help/repository/code-scanning-check-failure.png)
7541

7642
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).
7743

78-
### Other {% data variables.product.prodname_code_scanning %} checks
44+
## Diagnosing issues with your {% data variables.product.prodname_code_scanning %} configuration
7945

8046
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.
8147

content/code-security/how-tos/scan-code-for-vulnerabilities/scan-from-the-command-line/specifying-command-options-in-a-codeql-configuration-file.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Specifying command options in a CodeQL configuration file
33
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.
55
product: '{% data reusables.gated-features.codeql %}'
66
versions:
77
fpt: '*'
@@ -18,36 +18,24 @@ redirect_from:
1818
contentType: how-tos
1919
---
2020

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-
3221
## Using a {% data variables.product.prodname_codeql %} configuration file
3322

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:
3725

38-
```shell
39-
<command> <subcommand> <option> <value>
40-
```
26+
```shell
27+
<command> <subcommand> <option> <value>
28+
```
4129

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:
4331

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>`
4634

4735
> [!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 line overrides 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.
5139

5240
### Examples
5341

content/code-security/how-tos/scan-code-for-vulnerabilities/scan-from-vs-code/creating-a-custom-query.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@ redirect_from:
1515
contentType: how-tos
1616
---
1717

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.
2419

2520
## Creating a custom query
2621

22+
You create a new query file from a template for a given language, which imports the standard libraries for analyzing that language.
23+
2724
1. In the extension sidebar, open the "Queries" view, then click the **Create query** icon.
2825

2926
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
3229

3330
## Further reading
3431

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:
3633

3734
* [{% data variables.product.prodname_codeql %} for C and C++](https://codeql.github.com/docs/codeql-language-guides/codeql-for-cpp/)
3835
* [{% data variables.product.prodname_codeql %} for C#](https://codeql.github.com/docs/codeql-language-guides/codeql-for-csharp/)

content/code-security/how-tos/secure-at-scale/configure-enterprise-security/configure-specific-tools/configuring-secret-scanning-for-your-appliance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The SSSE3 set of instructions is required because {% data variables.product.prod
4444
1. Enter the following command:
4545

4646
```shell
47-
grep -iE '^flags.*ssse3' /proc/cpuinfo >/dev/null | echo $?
47+
grep -iE '^flags.*ssse3' /proc/cpuinfo >/dev/null; echo $?
4848
```
4949

5050
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.

content/code-security/reference/code-scanning/sarif-files/sarif-support-for-code-scanning.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ This is where you store details of the rules that are run during analysis. Infor
169169

170170
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.
171171

172-
{% data reusables.code-scanning.upload-sarif-alert-limit %}
173-
174172
| Name | Required | Description |
175173
|----|----|----|
176174
| `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

Comments
 (0)