Skip to main content
ドキュメントには� �繁に更新が� えられ、その都度公開されています。本ページの翻訳はま� 未完成な部分があることをご了承く� さい。最新の情� �については、英語のドキュメンテーションをご参照く� さい。本ページの翻訳に問題がある� �合はこちらまでご連絡く� さい。

このバージョンの GitHub Enterprise はこの日付をもって終了となりました: 2022-06-03. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの改善、新機能のためには、最新バージョンのGitHub Enterpriseにアップグレードしてく� さい。 アップグレードに関する支援については、GitHub Enterprise supportに連絡してく� さい。

Managing code scanning alerts for your repository

From the security view, you can view, fix, dismiss, or delete alerts for potential vulnerabilities or errors in your project's code.

If you have write permission to a repository you can manage code scanning alerts for that repository.

Code scanning is available for organization-owned repositories where GitHub Advanced Security is enabled. 詳しい情� �については、「GitHub Advanced Security について」を参照してく� さい。

Viewing the alerts for a repository

Anyone with read permission for a repository can see code scanning annotations on pull requests. For more information, see "Triaging code scanning alerts in pull requests."

You need write permission to view a summary of all the alerts for a repository on the Security tab.

By default, the code scanning alerts page is filtered to show alerts for the default branch of the repository only.

  1. GitHub Enterprise Serverインスタンスで、リポジトリのメインページにアクセスしてく� さい。

  2. リポジトリ名の下で Security(セキュリティ)をクリックしてく� さい。 セキュリティのタブ

  3. 左のサイドバーで、Code scanning alerts(コードスキャンニングアラート)をクリックしてく� さい。 "コードスキャンニングアラート"タブ

  4. [Code scanning] で、調査するアラートをクリックします。

    List of alerts from code scanning

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

    The "Show paths" link on an alert

  6. Alerts from CodeQL analysis include a description of the problem. Click Show more for guidance on how to fix your code. Details for an alert

For more information, see "About code scanning alerts."

Filtering code scanning alerts

You can filter the alerts shown in the code scanning alerts view. This is useful if there are many alerts as you can focus on a particular type of alert. There are some predefined filters and a range of keywords that you can use to refine the list of alerts displayed.

  • To use a predefined filter, click Filters, or a filter shown in the header of the list of alerts, and choose a filter from the drop-down list. Predefined filters
  • To use a keyword, either type directly in the filters text box, or:
    1. Click in the filters text box to show a list of all available filter keywords.
    2. Click the keyword you want to use and then choose a value from the drop-down list. Keyword filters list

The benefit of using keyword filters is that only values with results are shown in the drop-down lists. This makes it easy to avoid setting filters that find no results.

If you enter multiple filters, the view will show alerts matching all these filters. For example, is:closed severity:high branch:main will only display closed high-severity alerts that are present on the main branch. The exception is filters relating to refs (ref, branch and pr): is:open branch:main branch:next will show you open alerts from both the main branch and the next branch.

Restricting results to application code only

You can use the "Only alerts in application code" filter or autofilter:true keyword and value to restrict results to alerts in application code. See "About labels for alerts not in application code" above for more information about the types of code that are not application code.

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

If you have write permission for a repository, you can view fixed alerts by viewing the summary of alerts and clicking Closed. For more information, see "Viewing the alerts for a repository." The "Closed" list shows fixed alerts and alerts that users have dismissed.

You can use the filters to display a subset of alerts and then in turn mark all matching alerts as closed.

Alerts may be fixed in one branch but not in another. You can use the "Branch" filter, on the summary of alerts, to check whether an alert is fixed in a particular branch.

Filtering alerts by branch

Dismissing or deleting alerts

There are two ways of closing an alert. You can fix the problem in the code, or you can dismiss the alert. Alternatively, if you have admin permissions for the repository, you can delete alerts. Deleting alerts is useful in situations where you have set up a code scanning tool and then decided to remove it, or where you have configured CodeQL analysis with a larger set of queries than you want to continue using, and you've then removed some queries from the tool. In both cases, deleting alerts allows you to clean up your code scanning results. You can delete alerts from the summary list within the Security tab.

Dismissing an alert is a way of closing an alert that you don't think needs to be fixed. たとえば、テストで使われる� けのコードのエラーや、エラーを修正するための労力がコードを改善することによる潜在的な利点よりも大きい� �合です。 You can dismiss alerts from code scanning annotations in code, or from the summary list within the Security tab.

When you dismiss an alert:

  • It's dismissed in all branches.
  • The alert is removed from the number of current alerts for your project.
  • The alert is moved to the "Closed" list in the summary of alerts, from where you can reopen it, if required.
  • The reason why you closed the alert is recorded.
  • Next time code scanning runs, the same code won't generate an alert.

When you delete an alert:

  • It's deleted in all branches.
  • The alert is removed from the number of current alerts for your project.
  • It is not added to the "Closed" list in the summary of alerts.
  • If the code that generated the alert stays the same, and the same code scanning tool runs again without any configuration changes, the alert will be shown again in your analysis results.

To dismiss or delete alerts:

  1. GitHub Enterprise Serverインスタンスで、リポジトリのメインページにアクセスしてく� さい。

  2. リポジトリ名の下で Security(セキュリティ)をクリックしてく� さい。 セキュリティのタブ

  3. 左のサイドバーで、Code scanning alerts(コードスキャンニングアラート)をクリックしてく� さい。 "コードスキャンニングアラート"タブ

  4. If you have admin permissions for the repository, and you want to delete alerts for this code scanning tool, select some or all of the check boxes and click Delete.

    Deleting alerts

    Optionally, you can use the filters to display a subset of alerts and then delete all matching alerts at once. For example, if you have removed a query from CodeQL analysis, you can use the "Rule" filter to list just the alerts for that query and then select and delete all of those alerts.

    Filter alerts by rule

  5. If you want to dismiss an alert, it's important to explore the alert first, so that you can choose the correct dismissal reason. Click the alert you'd like to explore.

    List of alerts from code scanning

  6. Review the alert, then click Dismiss and choose a reason for closing the alert. Choosing a reason for dismissing an alert

    クエリが将来の分析に含まれ続けるかに影響することがあるので、ドロップダウンメニューから適切な理由を選択することは重要です。

    If you dismiss 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. CodeQLに関する詳しい情� �については「CodeQLに貢献する」を参照してく� さい。

Dismissing multiple alerts at once

If a project has multiple alerts that you want to dismiss for the same reason, you can bulk dismiss them from the summary of alerts. Typically, you'll want to filter the list and then dismiss all of the matching alerts. For example, you might want to dismiss all of the current alerts in the project that have been tagged for a particular Common Weakness Enumeration (CWE) vulnerability.

Further reading