Skip to content

Commit 18e2626

Browse files
authored
Merge pull request #42567 from github/repo-sync
Repo sync
2 parents 09f448f + f08840c commit 18e2626

File tree

3 files changed

+46
-17
lines changed

3 files changed

+46
-17
lines changed

content/code-security/how-tos/scan-code-for-vulnerabilities/troubleshooting/troubleshooting-analysis-errors/logs-not-detailed-enough.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,43 @@ redirect_from:
1313
contentType: how-tos
1414
---
1515

16-
If your logs are not detailed enough, there are several steps you can take to make them more useful.
16+
If your logs are not detailed enough to troubleshoot a problem, there are several steps you can take to obtain extra information and make logs more useful.
1717

1818
## Enable step debug logging
1919

20-
You can enable step debug logging in {% data variables.product.prodname_actions %} to increase the verbosity of a job's logs during and after a job's execution. For more information, see [AUTOTITLE](/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging).
20+
You can enable step debug logging in {% data variables.product.prodname_actions %} to increase the verbosity of a job's logs during a job's execution. For more information, see [AUTOTITLE](/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging).
2121

2222
## Creating {% data variables.product.prodname_codeql %} debugging artifacts
2323

2424
> [!WARNING]
2525
> {% data variables.product.prodname_codeql %} debugging artifacts contain a copy of the source code being analyzed by {% data variables.product.prodname_codeql %}, therefore we suggest sharing these bundles only with people who are authorized to access that source code.
2626
2727
You can obtain artifacts to help you debug {% data variables.product.prodname_codeql %}.
28-
The debug artifacts will be uploaded to the workflow run as an artifact named `debug-artifacts`. The data contains the {% data variables.product.prodname_codeql %} logs, {% data variables.product.prodname_codeql %} database(s), extracted source code files, and any SARIF file(s) produced by the workflow. For more information about downloading {% data variables.product.prodname_codeql %} artifacts, see [AUTOTITLE](/actions/managing-workflow-runs/downloading-workflow-artifacts).
28+
The debug artifacts will be uploaded to the workflow run as artifacts with names starting with `debug-artifacts`. If {% data variables.product.prodname_codeql %} analyzes multiple languages concurrently as part of the workflow run, there will be one such artifact for every language. The data contains the {% data variables.product.prodname_codeql %} logs, {% data variables.product.prodname_codeql %} databases, extracted source code files, and any SARIF files produced by the workflow. For more information about downloading {% data variables.product.prodname_codeql %} artifacts, see [AUTOTITLE](/actions/managing-workflow-runs/downloading-workflow-artifacts).
2929

3030
These artifacts will help you debug problems with {% data variables.product.prodname_codeql %} {% data variables.product.prodname_code_scanning %}. If you contact GitHub support, they might ask for this data.
3131

32-
### Creating {% data variables.product.prodname_codeql %} debugging artifacts by re-running jobs with debug logging enabled
32+
### Creating {% data variables.product.prodname_codeql %} debugging artifacts for {% data variables.product.prodname_codeql %} default setup
3333

34-
You can create {% data variables.product.prodname_codeql %} debugging artifacts by enabling debug logging and re-running the jobs. For more information about re-running {% data variables.product.prodname_actions %} workflows and jobs, see [AUTOTITLE](/actions/managing-workflow-runs/re-running-workflows-and-jobs).
34+
You can create {% data variables.product.prodname_codeql %} debugging artifacts by enabling {% data variables.product.prodname_actions %} step debug logging and triggering a new {% data variables.product.prodname_codeql %} analysis by, for example, pushing a new commit to a pull request branch. For information on how to enable {% data variables.product.prodname_actions %} step debug logging, see [AUTOTITLE](/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging).
3535

36-
You need to ensure that you select **Enable debug logging**. This option enables runner diagnostic logging and step debug logging for the run. You'll then be able to download `debug-artifacts` to investigate further. You do not need to modify the workflow file when creating {% data variables.product.prodname_codeql %} debugging artifacts by re-running jobs.
36+
{% ifversion org-private-registry %}
3737

38-
### Creating {% data variables.product.prodname_codeql %} debugging artifacts using a workflow flag
38+
If you have given {% data variables.product.prodname_codeql %} access to private registries, additional artifacts whose names start with `proxy-log-file` will be available. These contain logs of the authentication proxy that is used by {% data variables.product.prodname_codeql %} default setup to authenticate requests to private registries and may be used to troubleshoot private registry configurations. To learn more, see [AUTOTITLE](/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries).
39+
40+
{% endif %}
41+
42+
### Creating {% data variables.product.prodname_codeql %} debugging artifacts for {% data variables.product.prodname_codeql %} advanced setup
43+
44+
Debugging artifacts for {% data variables.product.prodname_codeql %} advanced setup can be obtained in several different ways.
45+
46+
#### Re-running jobs with debug logging enabled
47+
48+
The easiest option to create debugging artifacts for {% data variables.product.prodname_codeql %} advanced setup is by re-running jobs with debug logging enabled. For more information about re-running {% data variables.product.prodname_actions %} workflows and jobs, see [AUTOTITLE](/actions/managing-workflow-runs/re-running-workflows-and-jobs).
49+
50+
You need to ensure that you select **Enable debug logging**. This option enables runner diagnostic logging and step debug logging for the run. You'll then be able to download {% data variables.product.prodname_codeql %} debugging artifacts to investigate further. You do not need to modify the workflow file when creating {% data variables.product.prodname_codeql %} debugging artifacts by re-running jobs.
51+
52+
#### Using a workflow flag
3953

4054
You can create {% data variables.product.prodname_codeql %} debugging artifacts by using a flag in your workflow. For this, you need to modify the `init` step of your {% data variables.code-scanning.codeql_workflow %} file and set `debug: true`.
4155

@@ -45,3 +59,7 @@ You can create {% data variables.product.prodname_codeql %} debugging artifacts
4559
with:
4660
debug: true
4761
```
62+
63+
#### Using {% data variables.product.prodname_actions %} step debug logging
64+
65+
If you have enabled {% data variables.product.prodname_actions %} step debug logging, {% data variables.product.prodname_codeql %} will also produce debugging artifacts and upload them. See [AUTOTITLE](/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging).

content/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,28 @@ contentType: how-tos
1616

1717
## About the importance of providing access to private registries
1818

19-
When a repository uses code stored in a private registry, some security features need access to the registry to enable them to work effectively. Without access to all the dependencies of a repository, {% ifversion code-quality %}{% data variables.product.prodname_code_quality_short %} ({% data variables.release-phases.public_preview %}), {% endif %}{% data variables.product.prodname_code_scanning %} default setup and {% data variables.product.prodname_dependabot %} are limited.
19+
When code in a repository has dependencies that are stored in a private registry, some security features need access to the registry to enable them to work effectively. Without access to all the dependencies of a repository, the effectiveness of {% ifversion code-quality %}{% data variables.product.prodname_code_quality_short %} ({% data variables.release-phases.public_preview %}), {% endif %}{% data variables.product.prodname_code_scanning %} default setup and {% data variables.product.prodname_dependabot %} are limited.
2020

2121
## {% data variables.product.prodname_code_scanning_caps %} default setup access to private registries
2222

23-
If you do not define access to the private registries your organization uses, then {% data variables.product.prodname_code_scanning %} will only gather necessary data from dependencies available in public registries. Most times, this is enough for surfacing most of the vulnerabilities. However, in some cases the lack of access can lead to false negative results, that is, {% data variables.product.prodname_code_scanning %} is unable to detect a vulnerability in the code because it does not have all the information it needs to analyze the code. For example, some of the data flow paths may not be detected because steps are defined in dependencies that are not accessible and {% data variables.product.prodname_code_scanning %} does not know how to interpret them.
23+
If you do not define access to the private registries your organization uses, then {% data variables.product.prodname_code_scanning %} will only gather necessary data from dependencies available in public registries. Most times, this is enough for surfacing most of the vulnerabilities. However, in some cases the lack of access can lead to false negative results. In other words, {% data variables.product.prodname_code_scanning %} is unable to detect a vulnerability in the code because it does not have all the information it needs to analyze the code. For example, some of the data flow paths may not be detected because steps are defined in dependencies that are not accessible and {% data variables.product.prodname_code_scanning %} does not know how to interpret them.
2424

2525
When you configure access to the private registries used in your organization, {% data variables.product.prodname_code_scanning %} has access to all the information it needs and is much less likely to miss a vulnerability.
2626

27+
{% data variables.product.prodname_code_scanning_caps %} default setup supports the following registry types:
28+
29+
| Language | Registry types |
30+
|----------|----------------|
31+
| C# | NuGet Feed |
32+
| Go | GOPROXY server, Git Source |
33+
| Java | Maven Repository |
34+
2735
> [!TIP]
28-
> You can define one of each type of registry for each organization. If the codebases in your organization use more than one registry of a given type, you should define access to the most important registry for the codebases in that organization.
36+
> You can define one of each type of registry for each organization. If the codebases in your organization use more than one registry of a given type, you should set up a unified access point or define access to the most important registry for the codebases in that organization.
2937
3038
### Defining registry access for {% data variables.product.prodname_code_scanning %} default setup
3139

32-
You need to be an **organization owner** to set up access to private registries in the user interface. You can also use the REST API with organization owner or `{read,write}_org_private_registries` permission.
40+
You need to be an **organization owner** to set up access to private registries in the user interface. You can also use the REST API with the organization owner or `{read,write}_org_private_registries` permissions.
3341

3442
1. On the **Settings** tab for the organization, scroll down to the "Security" section and select **Secrets and variables**.
3543
1. In the expanded list of secrets and variables, select **Private registries** to display the "Private Registries" page.
@@ -38,6 +46,7 @@ You need to be an **organization owner** to set up access to private registries
3846
* **URL** is the location where you access the private registry. For example, to use the {% data variables.product.prodname_registry %} registry for NuGet: `https://nuget.pkg.github.com/`.
3947
* **Type** is the type of registry.
4048
1. Select either **Token** or **Username and password**, depending on the authentication method, then enter data into the appropriate fields.
49+
Some types of authentication tokens, such as a {% data variables.product.github %} {% data variables.product.pat_generic_title_case %}, are tied to a particular user identity. Select the **Username and password** option for these and enter the relevant username as **Username** and the token as **Password**.
4150
1. Define which repositories in the organization can access the private registry using these details: all, private and internal, or selected repositories only.
4251
1. When you have finished defining the private registry, select **Add Registry** to save the registry information.
4352

content/code-security/how-tos/view-and-interpret-data/viewing-code-scanning-logs.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,17 @@ After configuring {% data variables.product.prodname_code_scanning %} for your r
7777

7878
### Determining whether {% data variables.product.prodname_code_scanning %} default setup used any private registries
7979

80-
{% data variables.product.prodname_code_scanning_caps %} default setup includes a `Setup proxy or registries` step. When you are looking at a log file for default setup, you can expand this step. If the step includes:
80+
{% data variables.product.prodname_code_scanning_caps %} default setup workflows include a `Setup proxy for registries` step. When you are looking at a workflow run for default setup, you can expand this step to view the corresponding log and look for the following messages:
8181

82-
* `Using registries_credentials input.` At least one private registry is configured for the organization.
82+
* `Using registries_credentials input.` At least one private registry is configured for the organization. This includes configurations for private registry types which are not supported by {% data variables.product.prodname_code_scanning %} default setup. For more details about supported registry types, see [AUTOTITLE](/code-security/securing-your-organization/enabling-security-features-in-your-organization/giving-org-access-private-registries#code-scanning-default-setup-access-to-private-registries).
8383

8484
* `Credentials loaded for the following registries:`
85-
* No further output in the step. Access was unsuccessful.
86-
* `Type: nuget_feed;` Default set up accessed a private Nuget feed.
87-
* `Type: maven_repository;` Default set up accessed a private Maven repository.
85+
* If no list of configurations follows, then no private registry configurations supported by {% data variables.product.prodname_code_scanning %} default setup were found.
86+
* Otherwise, one line for each supported configuration that was successfully loaded is shown. For example, a line containing `Type: nuget_feed; Host: undefined; Url: https://nuget.pkg.github.com/; Username: undefined; Password: true; Token: false` indicates that a private NuGet Feed configuration was loaded.
87+
* The information about the configuration in the log may not match exactly what is configured for the organization in the UI. For example, the log may indicate that a `Password` is set, even though a `Token` is configured in the UI.
8888

89-
For more information, see [AUTOTITLE](/code-security/securing-your-organization/enabling-security-features-in-your-organization/giving-org-access-private-registries).
89+
If the output from the `Setup proxy for registries` step is as expected, but {% data variables.product.prodname_code_scanning %} default setup is unable to successfully access dependencies in the private registries, you can obtain additional troubleshooting information. See [AUTOTITLE](/code-security/how-tos/scan-code-for-vulnerabilities/troubleshooting/troubleshooting-analysis-errors/logs-not-detailed-enough#creating-codeql-debugging-artifacts-for-codeql-default-setup).
90+
91+
For more information about giving {% data variables.product.prodname_code_scanning %} default setup access to private registries, see [AUTOTITLE](/code-security/securing-your-organization/enabling-security-features-in-your-organization/giving-org-access-private-registries).
9092

9193
{% endif %}

0 commit comments

Comments
 (0)