The Wayback Machine - https://web.archive.org./web/20201019104632/https://docs.github.com/de/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-code-scanning-alerts-for-your-repository
Hallo, Entdecker! An dieser Seite wird aktiv gearbeitet, oder sie wird noch übersetzt. Die neuesten und genauesten Informationen findest Du in unserer englischsprachigen Dokumentation.

Managing code scanning alerts for your repository

You can view, fix, and close alerts for potential vulnerabilities or errors in your project's code.

People with write permission to a repository can manage code scanning alerts for the repository.

Code scanning is available in public repositories, and in public and private repositories owned by organizations with a license for Advanced Security. For more information, see "GitHub's products."

Inhalt dieses Artikels

Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Oder, learn how to contribute.

About alerts from code scanning

You can set up code scanning to check the code in a repository using the default CodeQL analysis, a third-party analysis, or multiple types of analysis. When the analysis is complete, the resulting alerts are displayed alongside each other in the security view of the repository. Results from third-party tools or from custom queries may not include all of the properties that you see for alerts detected by GitHub's default CodeQL analysis. The default code scanning workflow uses the on.push event to trigger a code scan on every push to any branch containing the workflow file.

By default, code scanning analyzes your code periodically on the default branch and during pull requests. For information about managing alerts on a pull request, see "Triaging code scanning alerts in pull requests."

About alerts details

Each alert highlights a problem with the code and the name of the tool that identified it. You can see the line of code that triggered the alert, as well as properties of the alert, such as the severity and the nature of the problem. Alerts also tell you when the issue was first introduced. For alerts identified by CodeQL analysis, you will also see information on how to fix the problem.

Example alert from code scanning

If you enable code scanning using CodeQL, this can also detect data-flow problems in your code. Data-flow analysis finds potential security issues in code, such as: using data insecurely, passing dangerous arguments to functions, and leaking sensitive information.

When code scanning reports data-flow alerts, GitHub shows you how data moves through the code. Code scanning allows you to identify the areas of your code that leak sensitive information, and that could be the entry point for attacks by malicious users.

Viewing an alert

Anyone with read permission for a repository can see code scanning alerts on pull requests. However, you need write permission to view a summary of alerts for repository on the Security tab. By default, alerts are shown for the default branch.

  1. Navigiere in GitHub zur Hauptseite des Repository.

  2. Klicke unter Deinem Repository-Namen auf Security (Sicherheit).

    Registerkarte „Security“ (Sicherheit)

  3. Klicke in der linken Seitenleiste auf Code scanning alerts (Code-Scan-Warnungen). Wähle optional das von Dir verwendete Code-Scan-Werkzeug aus.

    Registerkarte "Code scanning alerts" (Code-Scan-Warnungen)

  4. Optionally, if the alert highlights a problem with data flow, click Show paths to display the path from the data source to the sink where it's used.

    Example data-flow alert

Fixing an alert

Anyone with write permission for a repository can fix an alert by committing a correction to the code. If the repository has code scanning scheduled to run on pull requests, it's best to raise a pull request with your correction. This will trigger code scanning analysis of the changes and test that your fix doesn't introduce any new problems. For more information, see "Configuring code scanning" and "Triaging code scanning alerts in pull requests."

Closing an alert

Closing an alert is a way to resolve an alert that you don't think needs to be fixed. For example, an error in code that's used only for testing, or when the effort of fixing the error is greater than the potential benefit of improving the code.

  1. Navigiere in GitHub zur Hauptseite des Repository.

  2. Klicke unter Deinem Repository-Namen auf Security (Sicherheit).

    Registerkarte „Security“ (Sicherheit)

  3. Klicke in der linken Seitenleiste auf Code scanning alerts (Code-Scan-Warnungen). Wähle optional das von Dir verwendete Code-Scan-Werkzeug aus.

    Registerkarte "Code scanning alerts" (Code-Scan-Warnungen)

  4. Select the Close drop-down menu and click a reason for closing the alert.

    Choosing reason for closing the alert via the Close drop-down

If you close a CodeQL alert as a false positive result, for example because the code uses a sanitization library that isn't supported, consider contributing to the CodeQL repository and improving the analysis. For more information about CodeQL, see "Contributing to CodeQL."

Weiterführende Informationen

Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Oder, learn how to contribute.