Skip to content

Commit ee1c0d4

Browse files
isaacmbrownCopilot
andauthored
[EDI] Viewing code scanning logs (#59984)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent b799dd3 commit ee1c0d4

File tree

13 files changed

+129
-128
lines changed

13 files changed

+129
-128
lines changed

content/code-security/how-tos/scan-code-for-vulnerabilities/manage-your-configuration/codeql-code-scanning-for-compiled-languages.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ When you enable default setup for a repository that contains C# code, the build
333333

334334
{% data variables.product.prodname_codeql %} restores dependencies and generates a few additional source files, to give more accurate results, before creating a database from all the source files and dependencies.
335335

336-
Dependencies are restored using multiple heuristics and strategies. The following files are the primary source of information: `*.csproj`, `*.sln`, `nuget.config`, `packages.config`, `global.json`, and `project.assets.json`. {% ifversion org-private-registry %}If a private NuGet feed is defined for the organization, this is also used, see [Code scanning default setup access to private registries](/code-security/securing-your-organization/enabling-security-features-in-your-organization/giving-org-access-private-registries#code-scanning-default-setup-access-to-private-registries) and [Diagnostic information for private package registries](/code-security/code-scanning/managing-your-code-scanning-configuration/viewing-code-scanning-logs#diagnostic-information-for-private-package-registries).{% endif %}
336+
Dependencies are restored using multiple heuristics and strategies. The following files are the primary source of information: `*.csproj`, `*.sln`, `nuget.config`, `packages.config`, `global.json`, and `project.assets.json`. {% ifversion org-private-registry %}If a private NuGet feed is defined for the organization, this is also used, see [Code scanning default setup access to private registries](/code-security/securing-your-organization/enabling-security-features-in-your-organization/giving-org-access-private-registries#code-scanning-default-setup-access-to-private-registries) and [AUTOTITLE](/code-security/reference/code-scanning/code-scanning-logs#diagnostic-information-for-private-package-registries).{% endif %}
337337

338338
The following generated source files are optional, but significantly increase the correctness of the {% data variables.product.prodname_codeql %} database:
339339

@@ -464,7 +464,7 @@ If you later add Kotlin code to a repository that uses the `none` build mode, {%
464464

465465
{% data variables.product.prodname_codeql %} will attempt to run Gradle or Maven to extract accurate dependency information (but not to invoke a build), before creating a database from all Java files present. Every root Maven or Gradle project file (a build script without any build script present in an ancestor directory) is queried for dependency information, and more recent dependency versions are preferred if there is a clash. For information about the runner requirements to run Maven or Gradle, see [Runner requirements for Java](#runner-requirements-for-java).
466466

467-
{% ifversion org-private-registry %}If a private Maven registry is defined for the organization, this is also used, see [Code scanning default setup access to private registries](/code-security/securing-your-organization/enabling-security-features-in-your-organization/giving-org-access-private-registries#code-scanning-default-setup-access-to-private-registries) and [Diagnostic information for private package registries](/code-security/code-scanning/managing-your-code-scanning-configuration/viewing-code-scanning-logs#diagnostic-information-for-private-package-registries).{% endif %}
467+
{% ifversion org-private-registry %}If a private Maven registry is defined for the organization, this is also used, see [Code scanning default setup access to private registries](/code-security/securing-your-organization/enabling-security-features-in-your-organization/giving-org-access-private-registries#code-scanning-default-setup-access-to-private-registries) and [AUTOTITLE](/code-security/reference/code-scanning/code-scanning-logs##diagnostic-information-for-private-package-registries).{% endif %}
468468

469469
#### Accuracy of no build analysis for Java
470470

content/code-security/reference/code-scanning/codeql/codeql-for-vs-code/accessing-logs.md renamed to content/code-security/how-tos/scan-code-for-vulnerabilities/scan-from-vs-code/accessing-logs.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Accessing logs
2+
title: Accessing logs for {% data variables.product.prodname_codeql %} in {% data variables.product.prodname_vscode %}
33
shortTitle: Access logs
44
versions:
55
fpt: '*'
@@ -14,28 +14,10 @@ allowTitleToDifferFromFilename: true
1414
redirect_from:
1515
- /code-security/codeql-for-vs-code/troubleshooting-codeql-for-vs-code/accessing-logs
1616
- /code-security/how-tos/scan-code-for-vulnerabilities/troubleshooting/troubleshooting-codeql-for-vs-code/accessing-logs
17-
contentType: reference
17+
- /code-security/reference/code-scanning/codeql/codeql-for-vs-code/accessing-logs
18+
contentType: how-tos
1819
---
1920

20-
## About logs
21-
22-
Progress and error messages are displayed as notifications in the bottom right corner of the {% data variables.product.prodname_vscode %} workspace. These link to more detailed logs and error messages in the "Output" window.
23-
24-
You can access the following logs:
25-
26-
* {% data variables.product.prodname_codeql %} Extension
27-
28-
* {% data variables.product.prodname_codeql %} Language Server
29-
30-
* {% data variables.product.prodname_codeql %} Query Server
31-
32-
* {% data variables.product.prodname_codeql %} Tests
33-
34-
> [!NOTE]
35-
> The {% data variables.product.prodname_codeql %} Language Server log contains more advanced debug logs for {% data variables.product.prodname_codeql %} language maintainers. You should only need these to provide details in a bug report.
36-
37-
## Accessing logs
38-
3921
1. In {% data variables.product.prodname_vscode %}, open the "Output" window.
4022

4123
1. Use the dropdown to select the log view you need. For example, "{% data variables.product.prodname_codeql %} Extension Log".

content/code-security/how-tos/scan-code-for-vulnerabilities/scan-from-vs-code/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ children:
2727
- /customizing-settings
2828
- /setting-up-a-codeql-workspace
2929
- /configuring-access-to-the-codeql-cli
30+
- /accessing-logs
3031
---
32+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ When configuring private registries for the first time, you need to disable and
6161

6262
For languages supporting private package registries, {% data variables.product.prodname_code_scanning %} default setup will produce information on the {% data variables.code-scanning.tool_status_page %}. This shows you which private registry configurations were available to an analysis, but not whether {% data variables.product.prodname_code_scanning %} default setup was able to successfully download private dependencies from them. For more information about the {% data variables.code-scanning.tool_status_page %}, see [AUTOTITLE](/code-security/code-scanning/managing-your-code-scanning-configuration/about-the-tool-status-page).
6363

64-
Alternatively, you can confirm whether private registries were configured for a {% data variables.product.prodname_code_scanning %} analysis by looking in the Actions logs. See [Diagnostic information for private package registries](/code-security/code-scanning/managing-your-code-scanning-configuration/viewing-code-scanning-logs#diagnostic-information-for-private-package-registries).
64+
Alternatively, you can confirm whether private registries were used successfully by {% data variables.product.prodname_code_scanning %} analysis by looking in the Actions log files, see [AUTOTITLE](/code-security/reference/code-scanning/code-scanning-logs#diagnostic-information-for-private-package-registries).
6565

6666
## {% data variables.product.prodname_code_scanning_caps %} advanced setup access to private registries
6767

content/code-security/how-tos/view-and-interpret-data/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ topics:
1717
contentType: how-tos
1818
children:
1919
- /analyze-organization-data
20-
- /viewing-code-scanning-logs
20+
- /view-code-scanning-logs
2121
- /viewing-dependabot-job-logs
2222
- /view-custom-pattern-metrics
2323
- /change-used-by-data
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Viewing code scanning logs from GitHub Actions
3+
intro: View the output from a {% data variables.product.prodname_code_scanning %} analysis in {% data variables.product.prodname_actions %}.
4+
permissions: '{% data reusables.permissions.code-scanning-pr-alerts %}'
5+
redirect_from:
6+
- /code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/viewing-code-scanning-logs
7+
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/viewing-code-scanning-logs
8+
- /code-security/code-scanning/managing-your-code-scanning-configuration/viewing-code-scanning-logs
9+
- /code-security/how-tos/view-and-interpret-data/viewing-code-scanning-logs
10+
versions:
11+
fpt: '*'
12+
ghes: '*'
13+
ghec: '*'
14+
contentType: how-tos
15+
topics:
16+
- Security
17+
shortTitle: View code scanning logs
18+
---
19+
20+
{% data reusables.code-scanning.enterprise-enable-code-scanning-actions %}
21+
22+
After configuring {% data variables.product.prodname_code_scanning %} using default setup or a custom {% data variables.product.prodname_actions %} workflow, you can watch the output of the actions as they run. For information about logs for other {% data variables.product.prodname_code_scanning %} setups, see [AUTOTITLE](/code-security/reference/code-scanning/code-scanning-logs).
23+
24+
{% data reusables.repositories.actions-tab %}
25+
26+
You'll see a list that includes an entry for running the {% data variables.product.prodname_code_scanning %} workflow. The text of the entry is the title you gave your commit message.
27+
28+
![Screenshot of the "All workflows" page. In the list of workflow runs is a run labeled "Create .github/workflows/codeql.yml."](/assets/images/help/repository/code-scanning-actions-list.png)
29+
30+
1. Click the entry for the {% data variables.product.prodname_code_scanning %} workflow.
31+
32+
> [!NOTE]
33+
> If you are looking for the {% data variables.product.prodname_codeql %} workflow run triggered by enabling default setup, the text of the entry is "{% data variables.product.prodname_codeql %}."
34+
35+
1. Click the job name on the left. For example, **Analyze (LANGUAGE)**.
36+
37+
![Screenshot of the log output for the "Analyze (go)" job. In the left sidebar, under the "Jobs" heading, "Analyze (go)" is listed.](/assets/images/help/repository/code-scanning-logging-analyze-action.png)
38+
39+
1. Review the logging output from the actions in this workflow as they run.
40+
41+
1. Optionally, to see more detail about the commit that triggered the workflow run, click the short commit hash. The short commit hash is 7 lowercase characters immediately following the commit author's username.
42+
43+
1. Once all jobs are complete, you can view the details of any {% data variables.product.prodname_code_scanning %} alerts that were identified. For more information, see [AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/assessing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository).
44+
45+
## Further reading
46+
47+
If you're looking for diagnostic information about whether {% data variables.product.prodname_code_scanning %} accessed any private registries, see [AUTOTITLE](/code-security/how-tos/view-and-interpret-data/viewing-code-scanning-logs).

0 commit comments

Comments
 (0)