From 20cf190bdbde5aec62197a0591f5bd9a3c5cf6d5 Mon Sep 17 00:00:00 2001 From: Erica Delagnier Date: Wed, 8 Nov 2023 10:20:55 +0100 Subject: [PATCH 01/13] docs: Pr/readme update (#78) * add configuration for codescan and dependabot * add description for tools * add note for usage * Update README.md * Update README.md --------- Co-authored-by: Julien Bouquillon --- README.md | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d6cbd7cd36..81249c210f 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ Pour déployer votre version de DashLord : - Éditer le fichier `dashlord.yml` - Éditer le fichier `.github/workflows/scans.yml` si nécessaire - Éditer le fichier `.github/workflows/report.yml` si nécessaire (vérifier le `base-path` où sera publié le site web, il s'agira du nom du repository) -- Dans les settings du repository, dans "Actions", positionner "Workflows permissions" sur "Read and write" -- Dans les settings du repository, dans "Pages", selectionner `gh-pages` comme branche source +- Dans les settings du repository, dans "Actions", positionner "Workflows permissions" sur "Read and write" (si l'option n'est pas disponible pour le dépôt, activez la d'abord au niveau de l'organisation) +- Dans les settings du repository, dans "Pages", selectionner `gh-pages` comme branche source (vous pouvez soit la créer en amont soit la selectionner après le premier scan qui la créera) - Lancer `DashLord scans` dans l'onglet `Actions` de votre projet GitHub Une fois les scans terminés, un rapport sera généré dans la branche `gh-pages` du repository, il sera disponible sur `https://[organisation].github.io/[repository]` (publiquement). @@ -92,16 +92,7 @@ urls: - presse ``` -### Mesures de disponibilité -DashLord peut monitorer le niveau de performance et de disponibilité de vos applications. (mise en place = 10mins) - -- Créez un compte sur [updown.io](https://updown.io) -- Ajoutez-y les urls à monitorer (telles que définies dans dashlord.yml) -- Activez l'outil avec `updownio: true` dans le fichier dashlord.yml -- Ajouter votre clé d'API updown.io "readonly" dans un secret GitHub nommé `UPDOWNIO_API_KEY` (onglet settings/secrets) - -▶ Au prochain scan, les informations updown.io seront remontées dans DashLord ## Outils @@ -124,6 +115,33 @@ Chaque outil peut être activé/désactivé dans le rapport avec la clé `tools` | [SocialGouv/detect-404-action](https://github.com/SocialGouv/detect-404-action) | detect 404 errors | | [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) | Scan docker images vulnerabilities | +## Configuration +Certains outils nécessitent une configuration supplémentaire : + +### dependabot (détection de vulnérabilités issues des dépendances du projet) + +ajouter un secret GitHub `DEPENDABOTALERTS_TOKEN` et lui donner pour valeur un [token d'accès personnel](https://github.com/settings/personal-access-tokens/new) ayant droit de lecture sur **"Dependabot alerts"** en sélectionnant les dépôts à scanner + +### codescan (analyse statique de la qualité de code) + +ajouter un secret GitHub `CODESCANALERTS_TOKEN` et lui donner pour valeur un [token d'accès personnel](https://github.com/settings/personal-access-tokens/new) ayant droit de lecture sur **"Code scanning alerts"** en sélectionnant les dépôts à scanner + +### updown.io (Mesures de disponibilité) + +DashLord peut monitorer le niveau de performance et de disponibilité de vos applications. (mise en place = 10mins) + +- Créez un compte sur [updown.io](https://updown.io) +- Ajoutez-y les urls à monitorer (telles que définies dans dashlord.yml) +- Activez l'outil avec `updownio: true` dans le fichier dashlord.yml +- Ajouter votre clé d'API updown.io "readonly" dans un secret GitHub nommé `UPDOWNIO_API_KEY` (onglet settings/secrets) + +▶ Au prochain scan, les informations updown.io seront remontées dans DashLord + +### customCss : +You can host the css file in your Dashlord repo but the link needs to point to a file with the correct Content-Type Header. See here for [details](https://www.twistblogg.com/2020/06/use-github-for-hosting-files.html) + + + ## Contribute Vous pouvez contribuer en remontant des issues de qualité, en améliorant la documentation, ou en ajoutant du code. From d0585917008914fd9085c68db1ed9103e42fa727 Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Wed, 8 Nov 2023 10:23:23 +0100 Subject: [PATCH 02/13] docs: Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 81249c210f..4f559ff1b7 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,6 @@ Exemples : - https://mtes-mct.github.io/dashlord - https://socialgouv.github.io/dnum-dashboard -> ⚠️ DashLord utilise le [Système de Design de l'État](https://www.systeme-de-design.gouv.fr/) et s'adresse donc **uniquement** aux développeurs et aux concepteurs, qu'ils soient agents publics ou prestataires pour des sites Internet de l'État. cf [conditions d'utilisation](https://www.systeme-de-design.gouv.fr/utilisation-et-organisation/perimetre-d-application) - ## Usage Pour déployer votre version de DashLord : @@ -45,10 +43,12 @@ Ces workflows sont également déclenchables manuellement dans l'onglet "Actions 💡 Bonne pratique : enlever les slashs à la fin des urls ```yml -title: Dashboard title -description: Bonnes pratiques techniques -entity: Ministères sociaux +title: My websites +description: Best practices monitoring +entity: My team name footer: Powered by SocialGouv +# enable this only if you're an official gouv.fr organisation +marianne: false # `tools` allows to activate only some of the tools in the report tools: 404: true From 11379cebd164b3310138c95e3672fc3b1e1b0c68 Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Wed, 29 Nov 2023 17:31:44 +0100 Subject: [PATCH 03/13] docs: Update README.md --- README.md | 90 +++++++++++++++++-------------------------------------- 1 file changed, 27 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 4f559ff1b7..f322210f11 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ Tableau de bord des bonnes pratiques techniques -L'acquisition des données ainsi que la génération du rapport sont automatisés par des [GitHub actions](https://github.com/features/actions) - Exemples : - https://dashlord.incubateur.net @@ -13,86 +11,52 @@ Exemples : ## Usage -Pour déployer votre version de DashLord : - -- Créer un nouveau repository [**à partir du template dashlord**](https://github.com/SocialGouv/dashlord) -- Éditer le fichier `dashlord.yml` -- Éditer le fichier `.github/workflows/scans.yml` si nécessaire -- Éditer le fichier `.github/workflows/report.yml` si nécessaire (vérifier le `base-path` où sera publié le site web, il s'agira du nom du repository) -- Dans les settings du repository, dans "Actions", positionner "Workflows permissions" sur "Read and write" (si l'option n'est pas disponible pour le dépôt, activez la d'abord au niveau de l'organisation) -- Dans les settings du repository, dans "Pages", selectionner `gh-pages` comme branche source (vous pouvez soit la créer en amont soit la selectionner après le premier scan qui la créera) -- Lancer `DashLord scans` dans l'onglet `Actions` de votre projet GitHub +### Ajouter une URL dans le dashlord -Une fois les scans terminés, un rapport sera généré dans la branche `gh-pages` du repository, il sera disponible sur `https://[organisation].github.io/[repository]` (publiquement). - -### GitHub actions - -- Le workflow `DashLord scans` permet de lancer un scan sur les URLs, il est executé lors d'un changement dans le fichier `dashlord.yml` -- Le workflow `DashLord report` est lancé à la fin de chaque `DashLord scans` et produit le rapport sous forme de site web. - -Ces workflows sont également déclenchables manuellement dans l'onglet "Actions" - -## Customisation - -- Le fichier [`dashlord.yml`](./dashlord.yml) permet de paramétrer les urls et quelques options du tableau de bord -- Le workflow [`.github/workflows/scans.yml`](./.github/workflows/scans.yml) permet de customiser certains scanners, et régler la fréquence de scan (paramètre `schedule` positionné par défaut tous les dimanches à minuit) -- Le workflow [`.github/workflows/report.yml`](./.github/workflows/report.yml) permet de générer le rapport web en se basant sur [SocialGouv/dashlord-actions/report](https://github.com/SocialGouv/dashlord-actions). - -### dashlord.yml +Vous devez éditer le fichier [./dashlord.yml](./dashlord.yaml) et ajouter une entrée pour votre URL. 💡 Bonne pratique : enlever les slashs à la fin des urls +Exemple d'entrée pour une URL : + ```yml -title: My websites -description: Best practices monitoring -entity: My team name -footer: Powered by SocialGouv -# enable this only if you're an official gouv.fr organisation -marianne: false -# `tools` allows to activate only some of the tools in the report -tools: - 404: true - screenshot: true - nmap: true - zap: true - wappalyzer: true - http: true - testssl: true - lighthouse: true - thirdparties: true - nuclei: false - updownio: true - dependabot: true - codescan: true - stats: true - declaration-a11y: true - trivy: true - ecoindex: true - sonarcloud: true -urls: - url: https://www.free.fr title: Homepage free.fr - tags: + tags: # optionnel - telecom - provider - repositories: # pour récupérer les alertes de sécu de ces repos + repositories: # optionnel, pour récupérer les alertes de sécu de ces repos - free/free-ui - free/free-css - docker: # pour scanner les images avec trivy + docker: # optionnel, pour scanner les images avec trivy - ghcr.io/socialgouv/fabrique/frontend - ghcr.io/socialgouv/fabrique/backend - tools: # pour desactiver certains outils + tools: # optionnel, pour desactiver certains outils nmap: false - pages: # pour lancer lighthouse sur des pages supplémentaires + pages: # optionnel, pour lancer lighthouse sur des pages supplémentaires - /profil - /mentions - - url: https://www.lemonde.fr - title: Homepage lemonde.fr - tags: - - presse ``` +### Déployer sa propre version de DashLord : + +- Créer un nouveau repository [**à partir du template dashlord**](https://github.com/SocialGouv/dashlord) +- Éditer le fichier `dashlord.yml` +- Éditer le fichier `.github/workflows/scans.yml` si nécessaire +- Éditer le fichier `.github/workflows/report.yml` si nécessaire (vérifier le `base-path` où sera publié le site web, il s'agira du nom du repository) +- Dans les settings du repository, dans "Actions", positionner "Workflows permissions" sur "Read and write" (si l'option n'est pas disponible pour le dépôt, activez la d'abord au niveau de l'organisation) +- Dans les settings du repository, dans "Pages", selectionner `gh-pages` comme branche source (vous pouvez soit la créer en amont soit la selectionner après le premier scan qui la créera) +- Lancer `DashLord scans` dans l'onglet `Actions` de votre projet GitHub + +Une fois les scans terminés, un rapport sera généré dans la branche `gh-pages` du repository, il sera disponible sur `https://[organisation].github.io/[repository]` (publiquement). + +#### Customisation + +- Le fichier [`dashlord.yml`](./dashlord.yml) permet de paramétrer les urls et quelques options du tableau de bord +- Le workflow [DashLord scans `.github/workflows/scans.yml`](./.github/workflows/scans.yml) permet de customiser certains scanners, et régler la fréquence de scan (paramètre `schedule` positionné par défaut tous les dimanches à minuit) +- Le workflow [DashLord report `.github/workflows/report.yml`](./.github/workflows/report.yml) génére automatiquement le rapport web en se basant sur [SocialGouv/dashlord-actions/report](https://github.com/SocialGouv/dashlord-actions) +Ces workflows sont également déclenchables manuellement dans l'onglet "Actions" ## Outils From 402cf72fbac65fbb40751706eeff6a55dd1595bd Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Wed, 29 Nov 2023 17:34:50 +0100 Subject: [PATCH 04/13] docs: Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f322210f11..a21e7ef803 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Exemple d'entrée pour une URL : ```yml - url: https://www.free.fr title: Homepage free.fr + betaId: # optionnel, id de la startup sur beta.gouv.fr tags: # optionnel - telecom - provider From 31d1b0a0afb7ff30cd312b93ff87500aac1c604d Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Wed, 29 Nov 2023 17:35:57 +0100 Subject: [PATCH 05/13] docs: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a21e7ef803..858ff8e765 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Exemple d'entrée pour une URL : ```yml - url: https://www.free.fr title: Homepage free.fr - betaId: # optionnel, id de la startup sur beta.gouv.fr + betaId: free # optionnel, id de la startup sur beta.gouv.fr tags: # optionnel - telecom - provider From a64783200071f2672eb5536f4e16ca229214a6d3 Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Thu, 21 Dec 2023 09:24:31 +0100 Subject: [PATCH 06/13] docs: add CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 128 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..18c9147181 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. From bc84255b1fd3f8780999bbb4ef4c60e083d5c071 Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Thu, 21 Dec 2023 09:28:42 +0100 Subject: [PATCH 07/13] docs: Add AUTHORS.md --- AUTHORS.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 AUTHORS.md diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 0000000000..c922efb0bc --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,11 @@ +# This file lists all contributors to the repository. + +Julien Bouquillon +Tristan Robert +Clément Lelong +Benoit Serrano +Matéo Mévollon +Erica Delagnier +Lilian Saget-Lethias +Xavier Desoindre +Arthur Lutz From e7998b710b8b6a1fb955dff96e20ec12374a8cdb Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Thu, 21 Dec 2023 09:30:41 +0100 Subject: [PATCH 08/13] docs: add CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..4dcdf3f227 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +see https://github.com/SocialGouv/dashlord-actions/blob/main/CHANGELOG.md From 17bb0691ca41f3e8138605bed8370db2cd45a5ed Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Mon, 15 Jan 2024 09:10:17 +0100 Subject: [PATCH 09/13] feat: add dsfr + fix schemas (#81) Co-authored-by: Julien Bouquillon --- .github/workflows/scans.yml | 23 +++++++++++++++++++++++ dashlord.yml | 4 +++- schema.json | 11 +++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scans.yml b/.github/workflows/scans.yml index 2e57ee7573..e51c59a1fc 100644 --- a/.github/workflows/scans.yml +++ b/.github/workflows/scans.yml @@ -20,6 +20,8 @@ on: - sonarcloud - trivy - zap + - ecoindex + - dsfr push: branches: - master @@ -50,6 +52,9 @@ jobs: with: url: ${{ github.event.inputs.url }} tool: ${{ github.event.inputs.tool }} + env: + # to create missing entries in updown.io + UPDOWNIO_API_KEY: ${{ secrets.UPDOWNIO_API_KEY }} scans: runs-on: ubuntu-latest @@ -74,6 +79,24 @@ jobs: path: "**/node_modules" key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - name: get HTML + continue-on-error: true + timeout-minutes: 5 + uses: "socialgouv/dashlord-actions/get-html@v1" + if: ${{ matrix.sites.tools['dsfr'] }} + with: + url: ${{ matrix.sites.url }} + output: get-html.html + + - name: Détection DSFR + id: html + continue-on-error: true + timeout-minutes: 1 + if: ${{ matrix.sites.tools['dsfr'] }} + run: | + (cat get-html.html | grep -q fr-header__brand) && echo '{"detected": true}' > dsfr.json || echo '{"detected": false}' > dsfr.json + cat dsfr.json + - name: sonarcloud scan if: ${{ matrix.sites.tools.sonarcloud }} id: sonarcloud diff --git a/dashlord.yml b/dashlord.yml index caaff8915f..894fe0cb7f 100644 --- a/dashlord.yml +++ b/dashlord.yml @@ -1,6 +1,6 @@ title: DashLord example description: Bonnes pratiques techniques -entity: Ministères sociaux +entity: Votre entité footer: Powered by SocialGouv marianne: false tools: @@ -20,6 +20,8 @@ tools: stats: false declaration-a11y: true ecoindex: true + dsfr: true + betagouv: true urls: - url: https://www.fabrique.social.gouv.fr repositories: diff --git a/schema.json b/schema.json index 322f0d43c6..583c71b79f 100644 --- a/schema.json +++ b/schema.json @@ -87,6 +87,14 @@ "sonarcloud": { "type": "boolean", "description": "Enable sonarcloud API results" + }, + "budget_page": { + "type": "boolean", + "description": "Enable budget page detection" + }, + "dsfr": { + "type": "boolean", + "description": "Enable DSFR detection" } }, "required": [] @@ -133,6 +141,9 @@ "url": { "type": "string" }, + "title": { + "type": "string" + }, "category": { "type": "string" }, From db36e1d89032df5e52e059e8778ea495751a8246 Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Mon, 15 Jan 2024 15:48:03 +0100 Subject: [PATCH 10/13] fix: fix dsfr scan (#82) Co-authored-by: Julien Bouquillon --- .github/workflows/scans.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scans.yml b/.github/workflows/scans.yml index e51c59a1fc..a39e612769 100644 --- a/.github/workflows/scans.yml +++ b/.github/workflows/scans.yml @@ -94,8 +94,8 @@ jobs: timeout-minutes: 1 if: ${{ matrix.sites.tools['dsfr'] }} run: | - (cat get-html.html | grep -q fr-header__brand) && echo '{"detected": true}' > dsfr.json || echo '{"detected": false}' > dsfr.json - cat dsfr.json + (cat get-html.html | grep -q fr-header__brand) && echo '{"detected": true}' > dsfr.json || echo '{"detected": false}' > ./scans/dsfr.json + cat ./scans/dsfr.json - name: sonarcloud scan if: ${{ matrix.sites.tools.sonarcloud }} From 48b9362391dc45cf604ceb9d91ee300a028a3021 Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Mon, 15 Jan 2024 15:55:56 +0100 Subject: [PATCH 11/13] fix: fix dsfr scan (#83) Co-authored-by: Julien Bouquillon --- .github/workflows/scans.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scans.yml b/.github/workflows/scans.yml index a39e612769..9f78892a13 100644 --- a/.github/workflows/scans.yml +++ b/.github/workflows/scans.yml @@ -94,7 +94,7 @@ jobs: timeout-minutes: 1 if: ${{ matrix.sites.tools['dsfr'] }} run: | - (cat get-html.html | grep -q fr-header__brand) && echo '{"detected": true}' > dsfr.json || echo '{"detected": false}' > ./scans/dsfr.json + (cat get-html.html | grep -q fr-header__brand) && echo '{"detected": true}' > ./scans/dsfr.json || echo '{"detected": false}' > ./scans/dsfr.json cat ./scans/dsfr.json - name: sonarcloud scan From be57ce7b4d5710ab5c2594ed721043b62b35675f Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Wed, 17 Jan 2024 12:22:58 +0100 Subject: [PATCH 12/13] chore: docs (#84) * fix: fix dsfr scan * chore: use dsfr action * docs: readme * docs: readme --------- Co-authored-by: Julien Bouquillon --- .github/workflows/scans.yml | 19 +++++-------------- README.md | 32 ++++++-------------------------- 2 files changed, 11 insertions(+), 40 deletions(-) diff --git a/.github/workflows/scans.yml b/.github/workflows/scans.yml index 9f78892a13..cfd1b4d792 100644 --- a/.github/workflows/scans.yml +++ b/.github/workflows/scans.yml @@ -79,23 +79,14 @@ jobs: path: "**/node_modules" key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - name: get HTML + - name: dsfr continue-on-error: true - timeout-minutes: 5 - uses: "socialgouv/dashlord-actions/get-html@v1" - if: ${{ matrix.sites.tools['dsfr'] }} + timeout-minutes: 10 + uses: "socialgouv/dashlord-actions/dsfr@v1" + if: ${{ matrix.sites.tools.dsfr }} with: url: ${{ matrix.sites.url }} - output: get-html.html - - - name: Détection DSFR - id: html - continue-on-error: true - timeout-minutes: 1 - if: ${{ matrix.sites.tools['dsfr'] }} - run: | - (cat get-html.html | grep -q fr-header__brand) && echo '{"detected": true}' > ./scans/dsfr.json || echo '{"detected": false}' > ./scans/dsfr.json - cat ./scans/dsfr.json + output: scans/dsfr.json - name: sonarcloud scan if: ${{ matrix.sites.tools.sonarcloud }} diff --git a/README.md b/README.md index 858ff8e765..94cef6f568 100644 --- a/README.md +++ b/README.md @@ -17,28 +17,6 @@ Vous devez éditer le fichier [./dashlord.yml](./dashlord.yaml) et ajouter une e 💡 Bonne pratique : enlever les slashs à la fin des urls -Exemple d'entrée pour une URL : - -```yml - - url: https://www.free.fr - title: Homepage free.fr - betaId: free # optionnel, id de la startup sur beta.gouv.fr - tags: # optionnel - - telecom - - provider - repositories: # optionnel, pour récupérer les alertes de sécu de ces repos - - free/free-ui - - free/free-css - docker: # optionnel, pour scanner les images avec trivy - - ghcr.io/socialgouv/fabrique/frontend - - ghcr.io/socialgouv/fabrique/backend - tools: # optionnel, pour desactiver certains outils - nmap: false - pages: # optionnel, pour lancer lighthouse sur des pages supplémentaires - - /profil - - /mentions -``` - ### Déployer sa propre version de DashLord : - Créer un nouveau repository [**à partir du template dashlord**](https://github.com/SocialGouv/dashlord) @@ -81,16 +59,17 @@ Chaque outil peut être activé/désactivé dans le rapport avec la clé `tools` | [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) | Scan docker images vulnerabilities | ## Configuration + Certains outils nécessitent une configuration supplémentaire : ### dependabot (détection de vulnérabilités issues des dépendances du projet) ajouter un secret GitHub `DEPENDABOTALERTS_TOKEN` et lui donner pour valeur un [token d'accès personnel](https://github.com/settings/personal-access-tokens/new) ayant droit de lecture sur **"Dependabot alerts"** en sélectionnant les dépôts à scanner - + ### codescan (analyse statique de la qualité de code) ajouter un secret GitHub `CODESCANALERTS_TOKEN` et lui donner pour valeur un [token d'accès personnel](https://github.com/settings/personal-access-tokens/new) ayant droit de lecture sur **"Code scanning alerts"** en sélectionnant les dépôts à scanner - + ### updown.io (Mesures de disponibilité) DashLord peut monitorer le niveau de performance et de disponibilité de vos applications. (mise en place = 10mins) @@ -100,12 +79,13 @@ DashLord peut monitorer le niveau de performance et de disponibilité de vos app - Activez l'outil avec `updownio: true` dans le fichier dashlord.yml - Ajouter votre clé d'API updown.io "readonly" dans un secret GitHub nommé `UPDOWNIO_API_KEY` (onglet settings/secrets) +Si vous fournissez un token `write` à l'action [`init`](https://github.com/SocialGouv/dashlord/blob/48b9362391dc45cf604ceb9d91ee300a028a3021/.github/workflows/scans.yml#L55), les urls manquantes seront automatiquement ajoutées à votre compte updown.io. + ▶ Au prochain scan, les informations updown.io seront remontées dans DashLord ### customCss : -You can host the css file in your Dashlord repo but the link needs to point to a file with the correct Content-Type Header. See here for [details](https://www.twistblogg.com/2020/06/use-github-for-hosting-files.html) - +You can host the css file in your Dashlord repo but the link needs to point to a file with the correct Content-Type Header. See here for [details](https://www.twistblogg.com/2020/06/use-github-for-hosting-files.html) ## Contribute From 67bf041a5ce0a5916e5c59228fc8d99f4725cf99 Mon Sep 17 00:00:00 2001 From: Lilian Saget-Lethias Date: Wed, 17 Jan 2024 17:23:13 +0100 Subject: [PATCH 13/13] feat: update json schema with operator and updownioStatusPage props (#85) --- schema.json | 79 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 71 insertions(+), 8 deletions(-) diff --git a/schema.json b/schema.json index 583c71b79f..839870247e 100644 --- a/schema.json +++ b/schema.json @@ -131,7 +131,52 @@ "matomoUrl": { "type": "string" }, - "tools": { "$ref": "#/definitions/tools" }, + "operator": { + "type": "object", + "description": "Ajoute un logo d'opérateur. Soit une URL, soit un objet avec src et direction", + "properties": { + "logo": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "src": { + "type": "string" + }, + "direction": { + "type": "string", + "default": "horizontal", + "enum": [ + "horizontal", + "vertical" + ] + } + }, + "required": [ + "src" + ] + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "logo", + "name" + ] + }, + "updownioStatusPage": { + "type": "string", + "description": "URL de la page de status updown.io" + }, + "tools": { + "$ref": "#/definitions/tools" + }, "urls": { "type": "array", "items": { @@ -159,7 +204,10 @@ "pages": { "type": "array", "description": "Additionnal URLs to scan with LightHouse", - "examples": ["/actu", "/partners"], + "examples": [ + "/actu", + "/partners" + ], "items": { "type": "string" } @@ -167,7 +215,10 @@ "repositories": { "type": "array", "description": "Repositories no GitHub", - "examples": ["SocialGouv/www", "SocialGouv/template"], + "examples": [ + "SocialGouv/www", + "SocialGouv/template" + ], "items": { "type": "string" } @@ -175,16 +226,28 @@ "docker": { "type": "array", "description": "Docker images to scan", - "examples": ["ghcr.io/socialgouv/www/app"], + "examples": [ + "ghcr.io/socialgouv/www/app" + ], "items": { "type": "string" } }, - "tools": { "$ref": "#/definitions/tools" } + "tools": { + "$ref": "#/definitions/tools" + } }, - "required": ["url"] + "required": [ + "url" + ] } } }, - "required": ["title", "description", "entity", "tools", "urls"] -} + "required": [ + "title", + "description", + "entity", + "tools", + "urls" + ] +} \ No newline at end of file