Skip to content

Commit

Permalink
Merge pull request #3 from cds-snc/master
Browse files Browse the repository at this point in the history
refresh from main CDS master branch
  • Loading branch information
sayaHub committed Sep 18, 2018
2 parents fdfaba4 + 59cdc97 commit 9eefbca
Show file tree
Hide file tree
Showing 25 changed files with 550 additions and 135 deletions.
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
@@ -1,3 +1,5 @@
[La version française suit.](#---------------------------------------------------------------------)

# Contributor Guidelines

Want to contribute? Here are a few guidelines to following:
Expand All @@ -15,3 +17,20 @@ the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/pub
All contributions to this project will be released under the CC0
dedication. By submitting a pull request, you are agreeing to comply
with this waiver of copyright interest.

## ---------------------------------------------------------------------

# Lignes directrices à l’intention des contributeurs

Vous voulez contribuer? Voici quelques lignes directrices à suivre :

1. Créez un embranchement qui définit légèrement ce sur quoi vous travaillez (p. ex., ajout de styles).
2. Une fois que vous êtes prêt à soumettre une demande de retrait, déplacez votre embranchement jusqu’au dépôt.
3. Présentez votre demande de retrait en regard de l’embranchement `master`.


## Domaine public

Le projet fait partie du domaine public; l’auteur renonce dans le mode entier au droit d’auteur et aux droits connexes sur l’œuvre par voie de la licence [CC0 1.0 Universel – Transfert dans le domaine public.](https://creativecommons.org/publicdomain/zero/1.0/deed.fr).

Toutes les contributions à ce projet seront publiées en application de la licence CC0. En présentant une demande de retrait, vous acceptez de vous conformer à la présente renonciation au droit d’auteur.
32 changes: 22 additions & 10 deletions Dockerfile
@@ -1,15 +1,27 @@
FROM python:3.6
MAINTAINER David Buckley <david.buckley@cds-snc.ca>
LABEL Description="Track Digital Security Compliance" Vendor="Canadian Digital Service"
LABEL Description="Track Web Security Compliance" Vendor="Canadian Digital Service"

COPY setup.py deploy/setup.py
COPY track deploy/track
COPY MANIFEST.in deploy/MANIFEST.in
RUN python -m venv .env && . .env/bin/activate
RUN pip install deploy/.
FROM python:3.5 as python-base
COPY requirements.txt /opt/track-web/requirements.txt
COPY setup.py /opt/track-web/setup.py
COPY track /opt/track-web/track
COPY MANIFEST.in /opt/track-web/MANIFEST.in

RUN groupadd -r https && useradd --no-log-init -r -g https https
USER https:https
# Build wheels to install into production image
# Force a build with --no-binary to get around the case where a wheel is available for python:3.5 but not python:3.5-alpine
RUN pip install --upgrade pip && mkdir wheels && pip wheel --no-binary :all: -r /opt/track-web/requirements.txt -w wheels && pip wheel --no-deps /opt/track-web/ -w wheels

FROM python:3.5-alpine
MAINTAINER David Buckley <david.buckley@cds-snc.ca>
LABEL Description="Track Digital Security Compliance" Vendor="Canadian Digital Service"

COPY --from=python-base /wheels /wheels

RUN pip install /wheels/* && rm -rf /wheels /root/.cache/pip && \
addgroup -S track-web && adduser -S -G track-web track-web && \
mkdir -p /opt/track-web/.cache && \
chown -R track-web /opt/track-web
USER track-web:track-web

EXPOSE 5000
ENTRYPOINT ["gunicorn", "--pythonpath=deploy/track", "--bind=0.0.0.0:5000", "--worker-class=gevent", "wsgi:app"]
ENTRYPOINT ["gunicorn", "track.wsgi:app", "--bind=0.0.0.0:5000", "--worker-class=gthread", "--access-logfile=-", "--error-logfile=-", "--capture-output"]
33 changes: 33 additions & 0 deletions LICENSE.md
@@ -1,3 +1,5 @@
[La version française suit.](#---------------------------------------------------------------------)

# Third-party JavaScript

This project uses various third-party JavaScript tools, which for convenience are versioned in this repository.
Expand Down Expand Up @@ -36,3 +38,34 @@ this deed makes no warranties about the work, and disclaims liability for
all uses of the work, to the fullest extent permitted by applicable law.
When using or citing the work, you should not imply endorsement by the
author or the affirmer.

## ---------------------------------------------------------------------

# Langage JavaScript tiers

Ce projet recoure à divers outils JavaScript tiers, dont les versions sont conservées dans ce dépôt pour des raisons de commodité.

Les fichiers des répertoires suivants sont régis par leurs propres licences :

* `assets/js/vendor`

# Le reste

Nous renonçons dans le monde entier au droit d’auteur et aux droits connexes sur l’œuvre par voie de la licence CC0 1.0 Universel – Transfert dans le domaine public.

## Résumé de la licence CC0 1.0 Universel

Voici un résumé explicatif du [Code juridique (lire le texte intégral)](https://creativecommons.org/publicdomain/zero/1.0/legalcode.fr).

### Pas de droit d’auteur

La personne qui a associé une œuvre à cet acte a transféré l’œuvre dans le domaine public en renonçant dans le monde entier à ses droits sur l’œuvre selon les lois sur le droit d’auteur, droit voisin et connexes, dans la mesure permise par la loi.

Vous pouvez copier, modifier, distribuer et représenter l’œuvre, même à des fins commerciales, sans avoir besoin de demander l’autorisation.


### Autres informations

Les brevets et droits de marque commerciale qui peuvent être détenus par autrui ne sont en aucune façon affectés par CC0, de même pour les droits que pourraient détenir d’autres personnes sur l’œuvre ou sur la façon dont elle est utilisée, comme le droit à l’image ou à la vie privée.

À moins d’une mention expresse contraire, la personne qui a identifié une œuvre à cette notice ne concède aucune garantie sur l’œuvre et décline toute responsabilité de toute utilisation de l’œuvre, dans la mesure permise par la loi. Quand vous utilisez ou citez l’œuvre, vous ne devez pas sous-entendre le soutien de l’auteur ou de la personne qui affirme.
105 changes: 96 additions & 9 deletions README.md
@@ -1,17 +1,18 @@
[![CircleCI](https://circleci.com/gh/cds-snc/track-web.svg?style=svg)](https://circleci.com/gh/cds-snc/track-web)
[![Known Vulnerabilities](https://snyk.io/test/github/cds-snc/track-web/badge.svg)](https://snyk.io/test/github/cds-snc/track-web)

[La version française suit.](#---------------------------------------------------------------------)

## Track Government of Canada domains' adherence to web security practices

This repository is one component of _Track web security compliance_, a web-based application that scans Government of Canada websites and reports how they are meeting good web security practices, as outlined in [Information Technology Policy Implementation Notice (ITPIN): Implementing HTTPS for Secure Web Connections](https://www.canada.ca/en/treasury-board-secretariat/services/information-technology/policy-implementation-notices.html). `track-web` is a web application that displays the results of [tracker](https://github.com/cds-snc/tracker), the domain scanner.
This repository is one component of _Track web security compliance_, a web-based application that scans Government of Canada websites and reports how they are meeting good web security practices, as outlined in [Information Technology Policy Implementation Notice (ITPIN): Implementing HTTPS for Secure Web Connections](https://www.canada.ca/en/treasury-board-secretariat/services/information-technology/policy-implementation-notices.html). `track-web` is a web application that displays the results of [tracker](https://github.com/cds-snc/tracker), the domain scanner.

This is what it looks like with demo data:
This is what it looks like with demo data:

| English | French |
|---------|--------|
|![English landing page: header with title, some text, and a chart showing number of domains that enforce HTTPS](/docs/img/en-landing.png) | ![French landing page: header with title, some text, and a chart showing number of domains that enforce HTTPS](/docs/img/fr-landing.png) |
|![English dashboard page: text, a search bar, and a table with columns: Organization, ITPIN Compliant, Enforces HTTPS, HSTS, Free of known weak protocols and ciphers, Uses approved certificates](/docs/img/en-dashboard.png) | ![French dashboard page: text, a search bar, and a table with columns: Organization, ITPIN Compliant, Enforces HTTPS, HSTS, Free of known weak protocols and ciphers, Uses approved certificates](/docs/img/fr-dashboard.png) |
| |
|---------|
|![English landing page: header with title, some text, and a chart showing number of domains that enforce HTTPS](/docs/img/en-landing.png) |
|![English dashboard page: text, a search bar, and a table with columns: Organization, ITPIN Compliant, Enforces HTTPS, HSTS, Free of known weak protocols and ciphers, Uses approved certificates](/docs/img/en-dashboard.png) |



Expand All @@ -20,8 +21,7 @@ This is what it looks like with demo data:
| Documentation |
| ------------------------------------------------------- |
| [Development Setup Instructions](#development-setup) |
| [Local Deploy Step-by-step](docs/local-instructions.md) |
| [Deployment Docs](docs/deploy.md) |
| [Local Deploy Step-by-step](docs/en/local-instructions.md) |

## Developer Notes

Expand Down Expand Up @@ -83,6 +83,93 @@ This project is in the worldwide [public domain](LICENSE.md). As stated in [CONT
>
> All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.
### Origin
### Origin

This project was originally forked from [18F](https://github.com/18f/pulse) and has been modified to fit the Canadian context.

## ---------------------------------------------------------------------

## Faire le suivi du respect des pratiques en matière de sécurité Web par les domaines du gouvernement du Canada

Ce dépôt est l’un des éléments du _Suivre la conformité en matière de sécurité Web_, une application Web qui analyse les sites Web du gouvernement du Canada et indique en quoi ils respectent les bonnes pratiques en matière de sécurité Web, comme l’énonce l'[Avis de mise en œuvre de la Politique sur la technologie de l’information (AMPTI) : Mise en œuvre de HTTPS pour les connexions Web sécurisées](https://www.canada.ca/fr/secretariat-conseil-tresor/services/technologie-information/avis-mise-oeuvre-politique.html). `track-web` est une application Web qui affiche les résultats du [tracker](https://github.com/cds-snc/tracker), l’analyseur de domaines.

Voici à quoi cela ressemble avec les données de démonstration :

| |
|---------|
|![French landing page: header with title, some text, and a chart showing number of domains that enforce HTTPS](/docs/img/fr-landing.png) |
|![French dashboard page: text, a search bar, and a table with columns: Organization, ITPIN Compliant, Enforces HTTPS, HSTS, Free of known weak protocols and ciphers, Uses approved certificates](/docs/img/fr-dashboard.png) |



-------

| Documentation |
| ------------------------------------------------------- |
| [Instructions de configuration du développement](#configuration-du-développement) |
| [Déploiement local étape par étape](docs/fr/directives-locales.md) |

## Remarques à l’intention des développeurs

Ce dépôt utilise [snyk](https://snyk.io/org/cds-snc) pour analyser nos dépendances à l’égard des vulnérabilités.
Malheureusement, Snyk ne peut pas déceler les dépendances énumérées dans le fichier `setup.py`. Pour contourner ce problème, nous avons synchronisé les dépendances entre les fichiers `setup.py` et `requirements.txt` (que Snyk peut numériser).
Si vous procédez au développement et ajoutez une dépendance supplémentaire, vous devez veiller à l’ajouter aux deux emplacements.


## Configuration du développement

À des fins de développement, il vous est recommandé d’installer [MongoDB](https://www.mongodb.com/) et d’exécuter la base de données localement.

Ce tableau de bord est une application [Flask](http://flask.pocoo.org/) écrite pour **Python 3.5 et les versions subséquentes**. Nous recommandons [pyenv](https://github.com/yyuu/pyenv) pour une gestion facile des versions de Python.

Pour configurer les dépendances locales de Python, vous pouvez exécuter `make setup` à partir de la racine du dépôt. Nous recommandons que cela soit fait dans un environnement virtuel.

Pour préparer les données en vue de la présentation, veuillez consulter le répertoire [tracker](https://github.com/cds-snc/tracker).

* Installer les dépendances :

```bash
pip install -r requirements.txt
```

* Si vous développez cette application de tableau de bord, vous aurez aussi besoin des exigences de développement.

```bash
pip install .[development]
```

* Si vous développez les feuilles de style, vous aurez aussi besoin de [Sass](http://sass-lang.com/), [Bourbon](http://bourbon.io/), [Neat](http://neat.bourbon.io/), et [Bitters](http://bitters.bourbon.io/).

```bash
gem install sass bourbon neat bitters
```

* Si vous modifiez des styles pendant le développement, veillez à exécuter la fonction d’autocompilation de Sass avec :

```bash
make watch
```

* Pour lancer l’application en cours de développement, utilisez :

```bash
make debug
```

Cela permettra de lancer l’application en mode `DEBUG`, qui indiquera des messages d’erreurs complets dans le navigateur lorsqu’ils se produisent.

En mode de développement, la base de données doit être exécutée localement et doit être accessible par `localhost:27017`.

Pour produire certaines données en vue de l’affichage par l’application Flask, suivez les instructions dans le [tracker](https://github.com/cds-snc/tracker).

## Domaine public

Ce projet fait partie du [domaine public](LICENSE.md#---------------------------------------------------------------------) mondial. Comme l’indique le fil [CONTRIBUTING](CONTRIBUTING.md#---------------------------------------------------------------------) :

> Le projet fait partie du domaine public; l’auteur renonce dans le mode entier au droit d’auteur et aux droits connexes sur l’œuvre par voie de la licence [CC0 1.0 Universel – Transfert dans le domaine public](https://creativecommons.org/publicdomain/zero/1.0/deed.fr).
>
> Toutes les contributions à ce projet seront publiées en application de la licence CC0. En présentant une demande de retrait, vous acceptez de vous conformer à la présente renonciation au droit d’auteur.
### Origine

À l’origine, ce projet a été créé à partir du fil [18F](https://github.com/18f/pulse) et a été modifié pour s’adapter au contexte canadien.
29 changes: 22 additions & 7 deletions docs/README.md
@@ -1,12 +1,27 @@
[La version française suit.](#---------------------------------------------------------------------)

# Track-web documentation

Welcome to the [`track-web`](https://github.com/cds-snc/track-web) documentation!
Here you will find the following documents to help gain an understanding around the system.

| document | description |
| -------- | ----------- |
| [additions.md](additions.md) | This document outlines the location of key functionality to facilitate making additions or changes to the system. |
| [deploy.md](deploy.md) | This document outlines a basic deployment workflow. |
| [google-analytics.md](google-analytics.md) | This document outlines the custom Google Analytics events that we have bundled into the project. |
| [local-instructions.md](local-instructions.md) | This document contains step-by-step instructions on how to setup a development verison of the project locally. |
| [updating-packages.md](updating-packages.md) | This document is a note of all JavaScript packages that have been included in the `static` folder and should be updated when new versions come out. |
| document | description |
| -------- | ----------- |
| [additions.md](en/additions.md) | This document outlines the location of key functionality to facilitate making additions or changes to the system. |
| [google-analytics.md](en/google-analytics.md) | This document outlines the custom Google Analytics events that we have bundled into the project. |
| [local-instructions.md](en/local-instructions.md) | This document contains step-by-step instructions on how to setup a development verison of the project locally. |
| [updating-packages.md](en/updating-packages.md) | This document is a note of all JavaScript packages that have been included in the `static` folder and should be updated when new versions come out. |

## ---------------------------------------------------------------------

# Documents sur track-web

Bienvenue dans les documents sur [`track-web`](https://github.com/cds-snc/track-web)!
Vous trouverez ici les documents suivants pour vous aider à comprendre le système.

| document | description |
| -------- | ----------- |
| [ajouts.md](fr/ajouts.md) | Ce document décrit l’emplacement des principales fonctionnalités pour faciliter les ajouts ou les modifications au système. |
| [google-analytics.md](fr/google-analytics.md) | Ce document présente les événements personnalisés de Google Analytics que nous avons groupés dans le projet. |
| [directives-locales.md](fr/directives-locales.md) | Ce document contient des directives étape par étape sur la configuration d’une version de développement du projet à l’échelle locale. |
| [mise-à-jour-des-trousses.md](fr/mise-a-jour-des-trousses.md) | Ce document est une note de toutes les trousses JavaScript qui ont été incluses dans le dossier statique et doivent être mises à jour lorsque de nouvelles versions sont présentées. |
Empty file removed docs/deploy.md
Empty file.
13 changes: 13 additions & 0 deletions docs/en/README.md
@@ -0,0 +1,13 @@
[Français](../fr)

# Track-web documentation

Welcome to the [`track-web`](https://github.com/cds-snc/track-web) documentation!
Here you will find the following documents to help gain an understanding around the system.

| document | description |
| -------- | ----------- |
| [additions.md](additions.md) | This document outlines the location of key functionality to facilitate making additions or changes to the system. |
| [google-analytics.md](google-analytics.md) | This document outlines the custom Google Analytics events that we have bundled into the project. |
| [local-instructions.md](local-instructions.md) | This document contains step-by-step instructions on how to setup a development verison of the project locally. |
| [updating-packages.md](updating-packages.md) | This document is a note of all JavaScript packages that have been included in the `static` folder and should be updated when new versions come out. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions docs/fr/README.md
@@ -0,0 +1,13 @@
[English](../en)

# Documents sur track-web

Bienvenue dans les documents sur [`track-web`](https://github.com/cds-snc/track-web)!
Vous trouverez ici les documents suivants pour vous aider à comprendre le système.

| document | description |
| -------- | ----------- |
| [ajouts.md](ajouts.md) | Ce document décrit l’emplacement des principales fonctionnalités pour faciliter les ajouts ou les modifications au système. |
| [google-analytics.md](google-analytics.md) | Ce document présente les événements personnalisés de Google Analytics que nous avons groupés dans le projet. |
| [directives-locales.md](directives-locales.md) | Ce document contient des directives étape par étape sur la configuration d’une version de développement du projet à l’échelle locale. |
| [mise-à-jour-des-trousses.md](mise-a-jour-des-trousses.md) | Ce document est une note de toutes les trousses JavaScript qui ont été incluses dans le dossier statique et doivent être mises à jour lorsque de nouvelles versions sont présentées. |

0 comments on commit 9eefbca

Please sign in to comment.