Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRitouet committed Jan 25, 2024
2 parents 50583f8 + 67bf041 commit bfdbb1d
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 87 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ on:
- sonarcloud
- trivy
- zap
- ecoindex
- dsfr
push:
branches:
- master
Expand Down Expand Up @@ -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
Expand All @@ -74,6 +79,15 @@ jobs:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: dsfr
continue-on-error: true
timeout-minutes: 10
uses: "socialgouv/dashlord-actions/dsfr@v1"
if: ${{ matrix.sites.tools.dsfr }}
with:
url: ${{ matrix.sites.url }}
output: scans/dsfr.json

- name: sonarcloud scan
if: ${{ matrix.sites.tools.sonarcloud }}
id: sonarcloud
Expand Down
11 changes: 11 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
see https://github.com/SocialGouv/dashlord-actions/blob/main/CHANGELOG.md
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -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.
121 changes: 42 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Ce repo contient le code nécessaire pour générer le tableau de bord des bonne
Le résultat peut être visible à cette adresse:
[https:/incubateur-territoires.github.io/dashlord](https:/incubateur-territoires.github.io/dashlord/)

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
Expand All @@ -14,97 +12,33 @@ Exemples :
- https://socialgouv.github.io/dnum-dashboard
- https:/incubateur-territoires.github.io/dashlord/

> ⚠️ 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 :
### Ajouter une URL dans le dashlord

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

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

### 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
#### 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

💡 Bonne pratique : enlever les slashs à la fin des urls

```yml
title: Dashboard title
description: Bonnes pratiques techniques
entity: Ministères sociaux
footer: Powered by SocialGouv
# `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:
- telecom
- provider
repositories: # 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
- ghcr.io/socialgouv/fabrique/frontend
- ghcr.io/socialgouv/fabrique/backend
tools: # pour desactiver certains outils
nmap: false
pages: # pour lancer lighthouse sur des pages supplémentaires
- /profil
- /mentions
- url: https://www.lemonde.fr
title: Homepage lemonde.fr
tags:
- 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)
- 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)

▶ Au prochain scan, les informations updown.io seront remontées dans DashLord
Ces workflows sont également déclenchables manuellement dans l'onglet "Actions"

## Outils

Expand All @@ -127,6 +61,35 @@ 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)

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)

## Contribute

Vous pouvez contribuer en remontant des issues de qualité, en améliorant la documentation, ou en ajoutant du code.
Expand Down
2 changes: 2 additions & 0 deletions dashlord.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ tools:
stats: false
declaration-a11y: true
ecoindex: true
dsfr: true
betagouv: true
urls:
- url: https://incubateur.anct.gouv.fr/
- url: https://espacesurdemande.fr
Expand Down
Loading

0 comments on commit bfdbb1d

Please sign in to comment.