Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Chaque instance Harbor créée dans Harbor-as-a-Service se connecte à un scanner de failles Trivy pour vous aider à identifier et à résoudre les risques de sécurité dans vos images de conteneurs. Trivy est le scanner par défaut dans les versions 2.2 et ultérieures de Harbor.
Trivy analyse le contenu de vos images de conteneurs en les comparant à des bases de données de failles connues, comme la National Vulnerability Database, pour identifier les problèmes potentiels.Pour en savoir plus, consultez https://github.com/aquasecurity/trivy.
Avant de commencer
Pour analyser les failles, vous devez disposer des éléments suivants :
Vous pouvez analyser des artefacts individuels dans Harbor ou configurer les paramètres de vulnérabilité dans les projets Harbor.
Analyser des artefacts individuels dans Harbor
Pour analyser des artefacts individuels dans Harbor, procédez comme suit :
Connectez-vous à l'interface Harbor avec un compte doté du rôle ProjectAdmin.
Accédez à Projets, puis sélectionnez un projet.
Cliquez sur l'onglet Scanner. L'onglet Scanner affiche le scanner actuellement utilisé pour ce projet.
Cliquez sur Modifier pour sélectionner un autre scanner dans la liste des scanners connectés à cette instance Harbor, puis cliquez sur OK.
Cliquez sur l'onglet Dépôts, puis sélectionnez un dépôt.
Pour chaque artefact du dépôt, la colonne Failles affiche l'état de l'analyse des failles et les informations associées.
Sélectionnez un artefact ou cochez la case en haut de l'écran pour sélectionner tous les artefacts du dépôt, puis cliquez sur Analyser pour exécuter l'analyse des failles sur cet artefact.
Pointez sur le nombre de failles corrigibles pour afficher un récapitulatif du rapport sur les failles.
Cliquez sur le résumé de l'artefact pour afficher un rapport détaillé sur les failles.
Configurer les paramètres de failles dans les projets Harbor
Intégrez l'analyse des failles à votre workflow Harbor pour gérer de manière proactive la sécurité de vos applications conteneurisées et protéger votre organisation contre les menaces potentielles. Configurez les projets de sorte que les images présentant des failles ne puissent pas être exécutées et que les images soient analysées automatiquement dès qu'elles sont transférées dans le projet.
Pour configurer les paramètres de vulnérabilité d'un projet Harbor :
Connectez-vous à l'interface Harbor avec un compte doté du rôle ProjectAdmin.
Accédez à Projets, puis sélectionnez un projet.
Cliquez sur l'onglet Configuration.
Pour empêcher l'extraction d'images vulnérables dans le projet, cochez la case Empêcher l'exécution d'images vulnérables.
Sélectionnez le niveau de gravité des failles pour empêcher l'exécution des images.
Pour activer une analyse immédiate des failles sur les nouvelles images transférées vers le projet, cochez la case Analyser automatiquement les images lors du transfert.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Scan for vulnerabilities\n\nEvery Harbor instance created in Harbor-as-a-Service connects to a Trivy\nvulnerability scanner to help you identify and address security risks in your\ncontainer images. Trivy is the default scanner in Harbor versions 2.2 and later.\nTrivy analyzes the contents of your container images, comparing them against\nknown vulnerability databases, like the National Vulnerability Database, to\nidentify potential issues.For more information, see\n\u003chttps://github.com/aquasecurity/trivy\u003e.\n\nBefore you begin\n----------------\n\nYou must have the following to scan for vulnerabilities:\n\n- Trivy. You must have enabled Trivy when you installed your Harbor instance by appending installation options `--with-trivy`. For information about installing Harbor with Trivy, see \u003chttps://goharbor.io/docs/2.8.0/install-config/run-installer-script/\u003e.\n- An account with the `ProjectAdmin` role from Harbor's role-based access controls. For more information, see [Configure access for APIs and within a Harbor instance](/distributed-cloud/hosted/docs/latest/appliance/platform-application/pa-ao-operations/configure-access-control#configure-access-within-harbor-instance).\n- An existing Harbor project. For more information, see [Create Harbor projects](/distributed-cloud/hosted/docs/latest/appliance/platform-application/pa-ao-operations/create-harbor-projects).\n\nYou can scan individual artifacts in Harbor, or configure vulnerability\nsettings in Harbor projects.\n\nScan individual artifacts in Harbor\n-----------------------------------\n\nFollow these steps to scan individual artifacts in Harbor:\n\n1. Sign in to the Harbor interface with an account that has the `ProjectAdmin` role.\n2. Go to **Projects** and select a project.\n3. Click the **Scanner** tab. The **Scanner** tab shows the current scanner in use for this project.\n4. Click **Edit** to select a different scanner from the list of scanners that are connected to this Harbor instance, and click **OK**.\n5. Click the **Repositories** tab and select a repository.\n6. For each artifact in the repository, the **Vulnerabilities** column displays the vulnerability scanning status and related information.\n7. Select an artifact, or use the checkbox at the top to select all\n artifacts in the repository, and click **Scan** to run the\n vulnerability scan on this artifact.\n\n | **Note:** You can start a scan at any time, unless the status is Queued or Scanning.\n8. Hold the pointer over the number of fixable vulnerabilities to see a summary of\n the vulnerability report.\n\n9. Click the artifact digest to see a detailed vulnerability report.\n\nFor more information, see the Harbor documentation:\n\u003chttps://goharbor.io/docs/2.8.0/administration/vulnerability-scanning/scan-individual-artifact/\u003e.\n\nScan all artifacts in Harbor\n----------------------------\n\nFollow these steps to scan all of the artifacts in your Harbor instance:\n\n1. Sign in to the Harbor interface with an account that has the `ProjectAdmin` role.\n2. In the **Administration** menu, click **Interrogation Services**.\n3. To perform a scan of all artifacts in your Harbor instance, select the **Vulnerability** tab and click **Scan now**.\n\n | **Note:** **Scan now** becomes unavailable while the scan is in progress.\n\nFor more information, see the Harbor documentation:\n\u003chttps://goharbor.io/docs/2.8.0/administration/vulnerability-scanning/scan-all-artifacts/\u003e.\n\nConfigure vulnerability settings in Harbor projects\n---------------------------------------------------\n\nIntegrate vulnerability scanning into your Harbor workflow to proactively manage\nthe security of your containerized applications and protect your organization\nfrom potential threats. Configure projects so that images with vulnerabilities\ncannot be run, and to automatically scan images as soon as they are pushed into\nthe project.\n\nFollow these steps to configure vulnerability settings for a Harbor project:\n\n1. Sign in to the Harbor interface with an account that has the `ProjectAdmin` role.\n2. Go to **Projects** and select a project.\n3. Click the **Configuration** tab.\n4. To prevent vulnerable images under the project from being pulled, enable the **Prevent vulnerable images from running** checkbox.\n5. Select the severity level of vulnerabilities to prevent images from running.\n\n | **Note:** Images cannot be pulled if their level is equal to or higher than the selected level of severity. Harbor does not prevent images with a vulnerability severity of negligible from running.\n6. To activate an immediate vulnerability scan on new images that are\n pushed to the project, select the **Automatically scan images on push**\n checkbox.\n\nFor more information, see the Harbor documentation:\n\u003chttps://goharbor.io/docs/2.8.0/working-with-projects/project-configuration/\u003e."]]