Skip to content

Latest commit

 

History

History
93 lines (57 loc) · 8.4 KB

File metadata and controls

93 lines (57 loc) · 8.4 KB
title Viewing code scanning logs
intro You can view the output generated during {% data variables.product.prodname_code_scanning %} analysis in {% data variables.product.github %}.
permissions {% data reusables.permissions.code-scanning-pr-alerts %}
redirect_from
/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/viewing-code-scanning-logs
/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/viewing-code-scanning-logs
/code-security/code-scanning/managing-your-code-scanning-configuration/viewing-code-scanning-logs
versions
fpt ghes ghec
*
*
*
contentType how-tos
topics
Security
shortTitle View code scanning logs

{% data reusables.code-scanning.enterprise-enable-code-scanning-actions %}

About your {% data variables.product.prodname_code_scanning %} configuration

You can use a variety of tools to configure {% data variables.product.prodname_code_scanning %} in your repository. For more information, see AUTOTITLE and AUTOTITLE.

The log and diagnostic information available to you depends on the method you use for {% data variables.product.prodname_code_scanning %} in your repository. You can check the type of {% data variables.product.prodname_code_scanning %} you're using in the Security tab of your repository, by using the Tool drop-down menu in the alert list. For more information, see AUTOTITLE.

About analysis and diagnostic information

You can see analysis and diagnostic information for {% data variables.product.prodname_code_scanning %} run using {% data variables.product.prodname_codeql %} analysis on {% data variables.product.prodname_dotcom %}.

Analysis information is shown for the most recent analysis in a header at the top of the list of alerts. For more information, see AUTOTITLE.

Diagnostic information is displayed in the Action workflow logs and consists of summary metrics and extractor diagnostics. For information about accessing {% data variables.product.prodname_code_scanning %} logs on {% data variables.product.prodname_dotcom %}, see Viewing the logging output from {% data variables.product.prodname_code_scanning %} below.

If you're using the {% data variables.product.prodname_codeql_cli %} outside {% data variables.product.prodname_dotcom %}, you'll see diagnostic information in the output generated during database analysis. This information is also included in the SARIF results file you upload to {% data variables.product.prodname_dotcom %} with the {% data variables.product.prodname_code_scanning %} results.

For information about the {% data variables.product.prodname_codeql_cli %}, see AUTOTITLE.

About summary metrics

{% data reusables.code-scanning.summary-metrics %}

About {% data variables.product.prodname_codeql %} source code extraction diagnostics

{% data reusables.code-scanning.extractor-diagnostics %}

You can see more detailed information about {% data variables.product.prodname_codeql %} extractor errors and warnings that occurred during database creation by enabling debug logging. For more information, see AUTOTITLE.

Viewing the logging output from {% data variables.product.prodname_code_scanning %}

This section applies to {% data variables.product.prodname_code_scanning %} run using {% data variables.product.prodname_actions %} ({% data variables.product.prodname_codeql %} or third-party).

After configuring {% data variables.product.prodname_code_scanning %} for your repository, you can watch the output of the actions as they run.

{% data reusables.repositories.actions-tab %}

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.

Screenshot of the "All workflows" page. In the list of workflow runs is a run labeled "Create .github/workflows/codeql.yml."

  1. Click the entry for the {% data variables.product.prodname_code_scanning %} workflow.

    [!NOTE] 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 %}."

  2. Click the job name on the left. For example, Analyze (LANGUAGE).

    Screenshot of the log output for the "Analyze (go)" job. In the left sidebar, under the "Jobs" heading, "Analyze (go)" is listed.

  3. Review the logging output from the actions in this workflow as they run.

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

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

{% ifversion org-private-registry %}

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

{% 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:

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

  • Credentials loaded for the following registries:

    • If no list of configurations follows, then no private registry configurations supported by {% data variables.product.prodname_code_scanning %} default setup were found.
    • 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.
    • 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.

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.

For more information about giving {% data variables.product.prodname_code_scanning %} default setup access to private registries, see AUTOTITLE.

{% endif %}