1 # Develop a security fix
3 Based on the [GitLab security fix process](https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/developer.md). This section is aimed at other GitLabbers.
5 Security fixes are made **exclusively** against https://dev.gitlab.org/gitlab/gitter/webapp
7 - Before starting, run `npm run security-harness`. This script will install a Git `pre-push` hook that will prevent
8 pushing to any remote besides `dev.gitlab.org`, in order to prevent accidental disclosure.
9 - You may want to clone a separate `dev.gitlab.org` only repo to better separate things instead of adding another remote
10 - Otherwise here are some commands to setup and use the `dev.gitlab.org` remote,
11 - `git remote add security-dev git@dev.gitlab.org:gitlab/gitter/webapp.git`
12 - `git push security-dev`
13 - Before starting, update the `develop`/`master` branches and tags on `dev.gitlab.org` by running
15 git checkout develop && git pull origin develop && git push security-dev
16 git checkout master && git pull origin master && git push security-dev
17 git push security-dev --tags
19 - Feel free to cancel all of the CI jobs that kick-off because of the new stuff we just pushed (we already ran them in the public project anyway), https://dev.gitlab.org/gitlab/gitter/webapp/pipelines
20 - Create the merge request against https://dev.gitlab.org/gitlab/gitter/webapp
21 - Once the merge request is ready, create a security fix release on `dev.gitlab.org` and deploy to staging/production (see below)
23 ## Security fix release
24 - Squash the fix into one commit for easier cherry-picking
25 - Before releasing, update the `develop`/`master` branches and tags on `dev.gitlab.org` by running
27 git checkout develop && git pull origin develop && git push security-dev
28 git checkout master && git pull origin master && git push security-dev
29 git push security-dev --tags
31 - You can cancel all the tag and master pipelines triggered
32 - Now create hotfix (example if production version is `19.50.0`)
35 git flow hotfix start 19.50.1
36 git cherry-pick {the squashed security fix}
37 git push security-dev hotfix/19.50.1
39 - Trigger deployment to staging manually in the [pipeline view](https://dev.gitlab.org/gitlab/gitter/webapp/pipelines)
40 - Perform checks in staging described in the [release checklist](https://gitlab.com/gitlab-com/gl-infra/gitter-infrastructure#release-checklist)
41 - If everything looks good and the fix has been verified in staging, prepare production release
43 git flow hotfix finish 19.50.1
44 git push security-dev master
45 git push --tags security-dev
47 - Trigger deployment to production manually in the [pipeline view](https://dev.gitlab.org/gitlab/gitter/webapp/pipelines) (the tag pipeline)
48 - Verify the fix is in place on production
49 - In some of your pipelines, run the job to push the same fix to `beta` and `beta_staging`
52 ## Backport the change
53 Backport the change to the [public `webapp` project](https://gitlab.com/gitterHQ/webapp)
55 git push origin master
56 git push origin developer
57 git push --tags origin
59 You can cancel the hotfix tag pipeline in https://gitlab.com/gitterHQ/webapp
61 Add the hotfix to the [changelog](https://gitlab.com/gitterHQ/webapp/blob/develop/CHANGELOG.md). Link the confidential issue for all the details that will be public at a later time. Description *ideally* shouldn't explain how to reproduce the issue (e.g. `Fix integration activity XSS` instead of `Stored XSS via Wiki links`). Link the HackerOne profile of the person disclosing the issue (`https://hackerone.com/{user name}`).
65 - Fix integration activity XSS, https://gitlab.com/gitterHQ/webapp/issues/2068
66 - Thanks to [@mishre](https://hackerone.com/mishre) for [responsibly disclosing](https://matrix.org/security-disclosure-policy/) this vulnerability to us.
67 - https://dev.gitlab.org/gitlab/gitter/webapp/merge_requests/1