Skip to main content

Using GitHub's security features to secure your use of GitHub Actions

GitHub has several security features that can enhance the security of the actions you consume and publish.

About GitHub's security features

GitHub provides many features to make your code more secure. You can use GitHub's built-in features to understand the actions your workflows depend on, ensure you are notified about vulnerabilities in the actions you consume, or automate the process of keeping the actions in your workflows up to date. If you publish and maintain actions, you can use GitHub to communicate with your community about vulnerabilities and how to fix them. For more information about security features that GitHub offers, see GitHub-Sicherheitsfeatures.

This article will explain how you can use some of GitHub's security features to increase the security of your use of GitHub Actions.

Understanding dependencies in your workflows

You can use the dependency graph to explore the actions that the workflows in your repository use. The dependency graph is a summary of the manifest and lock files stored in a repository. It also recognizes files in ./github/workflows/ as manifests, which means that any actions or workflows referenced using the syntax jobs[*].steps[*].uses or jobs.<job_id>.uses will be parsed as dependencies.

The dependency graph shows the following information about actions used in workflows:

  • The account or organization that owns the action.
  • The workflow file that references the action.
  • The version or SHA the action is pinned to.

In the dependency graph, dependencies are automatically sorted by vulnerability severity. If any of the actions you use have security advisories, they will display at the top of the list. You can navigate to the advisory from the dependency graph and access instructions for resolving the vulnerability.

The dependency graph is enabled for public repositories, and you can choose to enable it on private repositories. For more information about using the dependency graph, see Untersuchen der Abhängigkeiten eines Repositorys.

Being aware of security vulnerabilities in actions you use

For actions available on the marketplace, GitHub reviews related security advisories and then adds those advisories to the GitHub Advisory Database. You can search the database for actions that you use to find information about existing vulnerabilities and instructions for how to fix them. To streamline your search, use the GitHub Actions filter in the GitHub Advisory Database.

You can set up your repositories so that you:

Monitoring the actions in your workflows

You can use Dependabot to monitor the actions in your workflows and enable Dependabot alerts to notify you when an action you use has a reported vulnerability. Dependabot performs a scan of the default branch of the repositories where it is enabled to detect insecure dependencies. Dependabot generates Dependabot alerts when a new advisory is added to the GitHub Advisory Database or when an action you use is updated.

Hinweis

Dependabot only creates alerts for vulnerable actions that use semantic versioning and will not create alerts for actions pinned to SHA values.

You can enable Dependabot alerts for your personal account, for a repository, or for an organization. For more information, see Konfigurieren von Dependabot-Warnungen.

Sie können alle offenen und geschlossenen Dependabot alerts und entsprechenden Dependabot security updates im Dependabot alerts-Reiter Ihres Repositorys sehen. For more information, see Anzeigen und Aktualisieren von Dependabot-Warnungen.

Screening actions for vulnerabilities in new or updated workflows

When you open pull requests to update your workflows, it is good practice to use dependency review to understand the security impact of changes you've made to the actions you use. Die Abhängigkeitsüberprüfung hilft Dir, Abhängigkeitsänderungen und die Sicherheitswirkung dieser Änderungen bei jedem Pull Request zu verstehen. Sie bietet eine leicht verständliche Visualisierung von Abhängigkeitsänderungen mit Rich-Diff auf der Registerkarte „Geänderte Dateien“ eines Pull Requests. Die Abhängigkeitsüberprüfung informiert Dich über:

  • Welche Abhängigkeiten hinzugefügt, entfernt oder aktualisiert wurden, sowie die Releasedaten
  • Wie viele Projekte diese Komponenten verwenden
  • Sicherheitsrisikodaten für diese Abhängigkeiten

If any of the changes you made to your workflows are flagged as vulnerable, you can avoid adding them to your project or update them to a secure version.

For more information about dependency review, see Informationen zur Abhängigkeitsüberprüfung.

„Abhängigkeitsüberprüfungsaktion“ bezieht sich auf die spezifische Aktion, die Unterschiede in einem Pull Request innerhalb des GitHub Actions-Kontext melden kann. Siehe dependency-review-action. Du kannst die Abhängigkeitsüberprüfungsaktion in deinem Repository verwenden, um Abhängigkeitsüberprüfungen bei deinen Pull Requests zu erzwingen. Die Aktion sucht nach anfälligen Versionen von Abhängigkeiten, die durch Paketversionsänderungen in Pull Requests eingeführt wurden, und warnt dich vor den damit verbundenen Sicherheitsrisiken. So erhältst du einen besseren Überblick darüber, was sich in einem Pull Request ändert, und kannst verhindern, dass deinem Repository Sicherheitsrisiken hinzugefügt werden. For more information, see Informationen zur Abhängigkeitsüberprüfung.

Keeping the actions in your workflows secure and up to date

Mithilfe von Dependabot können Sie sicherstellen, dass Verweise auf Aktionen und wiederverwendbare Workflows im Repository auf dem neuesten Stand bleiben. Aktionen werden häufig mit Fehlerkorrekturen und neuen Features aktualisiert, um automatisierte Prozesse schneller, sicherer und zuverlässiger zu machen. Dependabot vereinfachen die Verwaltung deiner Abhängigkeiten, da es dies automatisch für dich erledigt. Weitere Informationen findest du unter Deine Aktionen mit Dependabot auf dem neuesten Stand halten und Informationen zu Dependabot-Sicherheitsupdates.

The following features can automatically update the actions in your workflows.

  • Dependabot version updates open pull requests to update actions to the latest version when a new version is released.
  • Dependabot security updates open pull requests to update actions with reported vulnerabilities to the minimum patched version.

Hinweis

  • Dependabot unterstützt nur Updates für GitHub Actions über die GitHub-Repository-Syntax, z. B. actions/checkout@v4. Dependabot ignoriert Aktionen oder wiederverwendbare Workflows, auf die lokal verwiesen wird (z. B. ./.github/actions/foo.yml. ).
  • Docker Hub und GitHub Packages Container registry-URLs werden derzeit nicht unterstützt. Beispielsweise werden Verweise auf Docker-Containeraktionen mit docker://-Syntax nicht unterstützt.
  • Dependabot unterstützt sowohl öffentliche als auch private Repositorys für GitHub Actions. Informationen zu Konfigurationsoptionen für private Registrierungen findest du unter git in Referenz zu Dependabot-Optionen.

For information on how to configure Dependabot version updates, see Konfigurieren von Versionsupdates von Dependabot.

For information on how to configure Dependabot security updates, see Konfigurieren von Dependabot-Sicherheitsupdates.

Protecting actions you've created

GitHub enables collaboration between people who publish and maintain actions and vulnerability reporters in order to promote secure coding. Mithilfe von Sicherheitsempfehlungen für Repositorys können Verwalter*innen von öffentlichen Repositorys ein Sicherheitsrisiko in einem Projekt privat besprechen und beheben. Nach der Zusammenarbeit an einer Lösung können Repositoryverwalter die Sicherheitsempfehlung veröffentlichen, um das Sicherheitsrisiko öffentlich für die Community des Projekts offenzulegen. Durch die Veröffentlichung von Sicherheitsempfehlungen erleichtern Repositoryverwalter ihrer Community das Aktualisieren von Paketabhängigkeiten und das Untersuchen der Auswirkungen von Sicherheitsrisiken.

If you are someone who maintains an action that is used in other projects, you can use the following GitHub features to enhance the security of the actions you've published.