Commit Graph

40 Commits

Author SHA1 Message Date
Chris Hill-Scott
3d45454330 Add Care Quality Commission to email whitelist
CQC is an executive non-departmental public body, sponsored by the
Department of Health.

They have asked to be allowed to register for Notify using the
`cqc.org.uk` and `digital.cqc.org.uk` domains. We know that this really
is there domain because it’s linked to from here:

https://www.gov.uk/government/organisations/care-quality-commission
2017-06-05 13:51:53 +01:00
Rebecca Law
a1d004fa45 Add cjsm.net to whitelist 2017-05-26 10:40:48 +01:00
Chris Hill-Scott
ab150d876d Stop letting people enter empty SMS senders
This shouldn’t be deployed until we’ve migrated the database to default
to GOVUK.
2017-05-19 22:42:17 +01:00
Leo Hemsted
deb959e835 welsh assembly emails - foo@assembly.wales 2017-03-08 14:08:57 +00:00
Chris Hill-Scott
54a666e8e9 Add Scottish Enterprise to list of gov domains
> Scottish Enterprise is Scotland's main economic development agency
> and a non-departmental public body of the Scottish Government.

– https://www.scottish-enterprise.com/about-us

For some reason their email domain is `scotent.co.uk` (but it redirects
to www.scottish-enterprise.com on the web for the some reason
¯\_(ツ)_/¯)
2017-03-02 10:18:19 +00:00
Chris Hill-Scott
e909bce928 Make long SMS sender name error accurate
`<=11` not `< 11`
2017-02-27 15:56:58 +00:00
Leo Hemsted
f550699daf fix non-gsm error message
Use `it`/`they` depending on how many different characters you've used
Also don't wrap the message with quotes, as it looks confusing and
potentialy implies that you can't use apostrophes
2017-02-17 10:39:52 +00:00
Leo Hemsted
73a965a3c6 allow downgradeable unicode characters in SMS templates 2017-02-17 10:39:52 +00:00
Chris Hill-Scott
f3b0c0a556 Use client and logged_in_client fixtures
Wherever possible, because Don’t Repeat Yourself.
2017-02-06 10:44:38 +00:00
Chris Hill-Scott
929dc45224 Normalize whitespace in test arguments
We have a bunch of different styles of handling when function
definitions span multiple lines, which they almost always do with tests.

Here’s why an argument per line, single indent is best:
- cleaner diffs when you change the name of a method (one line change
  instead of multiple lines)
- works better on narrow screens, eg Github’s diff view, or with two
  terminals side by side on a laptop screen
- works with any editor’s indenting shortcuts, no need for an IDE

Also, trailing comma in the list of arguments is good because adding a
new argument to a method becomes a one line, not two line diff.
2017-02-06 10:44:37 +00:00
Chris Hill-Scott
65be12fa87 Remove pentesters from list of domains
Reverts https://github.com/alphagov/notifications-admin/pull/1071
2017-01-31 14:34:02 +00:00
Martyn Inglis
d45484feb5 This PR allows the pentesters to operate as part of white listed root domains. Needed for full app testing. 2017-01-16 14:18:46 +00:00
Leo Hemsted
f1feaaaccc add hmcts.net to email whitelist
(HM Courts & Tribunals Service)
2017-01-03 12:34:57 +00:00
Chris Hill-Scott
db6bb77d74 Don’t allow suppliers to sign up for own accounts
Suppliers need to be invited by people who work for the government.
People who work for the government can invite anyone to join their team,
no matter what their email address is.

So there’s no need for these domains to be in the list now.
2016-12-07 13:57:26 +00:00
Chris Hill-Scott
b4a7ffff8d Add Natural England to gov. email domains list
> I cannot register as the Email address field will not accept my email
> address format (.org.uk).  Natural England is a non-departmental
> government body sponsored by Defra (Department for Environment, Food
> and Rural Affairs).  Can you register me on the system or change the
> system so it will accept my email address?

– Deskpro ticket

> Natural England is an executive non-departmental public body,
> sponsored by the Department for Environment, Food & Rural Affairs.

– https://www.gov.uk/government/organisations/natural-england

***

Checks out…
2016-12-07 12:58:49 +00:00
Imdad Ahad
5ecdbb8596 Refactor to use a cleaner and lean regex 2016-10-28 10:45:05 +01:00
Rebecca Law
a0ce270cf5 Update email domain list. 2016-10-18 13:51:34 +01:00
Chris Hill-Scott
d747389e2a Add variations on GOV.UK Notify to blacklist
There’s a chance that someone will run out of imagination and use
the name of the thing they’re signing up for as their password.

This wouldn’t be caught by the generic blacklist.
2016-09-27 12:24:46 +01:00
Chris Hill-Scott
68a6ceec78 Give better error message for blacklisted password
Telling the user what to do, rather than the mistake they’ve made is
usually better.
2016-09-27 11:51:12 +01:00
Chris Hill-Scott
136662bd30 Stop people using very common passwords
If a user chooses a very common password then an attacker could guess it
in relatively few attempts, circumventing the lockout.

CESG recommend blacklisting the most common passwords:

> …enforcing the requirement for complex character sets in passwords is
> not recommended. Instead, concentrate efforts on technical controls,
> especially:
>
> - defending against automated guessing attacks by either using account
>   lockout, throttling, or protective monitoring
> - blacklisting the most common password choices

How I made this list:

- went to the OWASP repository of security lists:
  https://github.com/danielmiessler/SecLists

- downloaded `10k_most_common.txt`, `twitter-banned.txt` and
  `500-worst-passwords.txt`

- filtered out any under 8 characters:
  ```
  sed -r '/^.{,7}$/d' passwords-twitter.txt > passwords-combined.txt
  sed -r '/^.{,7}$/d' passwords-500.txt >> passwords-combined.txt
  sed -r '/^.{,7}$/d' passwords.txt >> passwords-combined.txt
  ```

- filtered out any duplicates:
  ```
  cat passwords-combined.txt | awk '!x[$0]++' > passwords-combined-deduped.txt
  ```
2016-09-27 11:51:12 +01:00
Rebecca Law
4f20dceb9f Add email domains to whitelist for user registration. 2016-09-20 11:02:53 +01:00
Rebecca Law
ef792d9d2a Add a new domain for the email domain regex. 2016-09-15 09:39:44 +01:00
Chris Hill-Scott
c5c693ef0b Add some explaining to the SMS sender page 2016-08-24 15:26:03 +01:00
Chris Hill-Scott
1e254415d2 Text message not Sms 2016-08-22 13:30:03 +01:00
Adam Shimali
1efd8506db Can remove sms sender. 2016-07-01 16:32:21 +01:00
Adam Shimali
3bfcf0f8b3 Users can set a value that appears as the sender of a text message.
It can be up to eleven characters alpha numeric, no special characters
allowed.
2016-07-01 14:22:25 +01:00
Chris Hill-Scott
d0c4509761 Fix missing request context in validators tests 2016-04-25 11:20:43 +01:00
Chris Hill-Scott
dfd8540b54 Don’t allow commas in placeholders
> If a user tries to save a template containing something like
> ((name,date)) we should give a validation error.

This is because it causes havoc with the column headers in CSV files.

https://www.pivotaltracker.com/story/show/117043389
2016-04-08 07:46:14 +01:00
Nicholas Staples
2352b0f80d Fix issue with uppercase in the domain name. 2016-04-06 16:45:35 +01:00
Nicholas Staples
f0b604084c Fixed email bug and added new exhaustive tests. 2016-04-06 11:01:37 +01:00
Nicholas Staples
48daac7b94 Merging conflict with two_factor.py
Fixed merge mistake with two_factor.py.
2016-03-30 10:11:06 +01:00
Nicholas Staples
8a203c0155 Valid email domains added and tests passing. 2016-03-18 12:05:50 +00:00
Nicholas Staples
62150e5596 Added fixes for forms to hide potential email philshing scams. 2016-01-28 16:36:36 +00:00
Nicholas Staples
2d35f5f36a All tests passing and merged with master. 2016-01-27 16:30:33 +00:00
Adam Shimali
4674bd6b68 Reintroduce some tests. A bit of cleanup of mocks.
User object fields made a bit clearer and simple test to
verify user added.
2016-01-23 23:14:50 +00:00
Adam Shimali
856b6adb56 First slice full sign in flow 2016-01-21 11:33:53 +00:00
Nicholas Staples
3b1d521c10 Tests added for dao. 2016-01-15 15:15:35 +00:00
Rebecca Law
c858869a52 Removed exceptions, found a better way to handle them.
Refactored the forms so that fields like email_address can be used in multiple forms.
Refactored form validation so that a query function is passed into the form to be run, this
way the form is not exposed to the dao layer and the query is more efficient.

This PR still requires some frontend attention. Will work with Chris to update the templates.
2016-01-11 12:23:08 +00:00
Nicholas Staples
7693ba8a18 Update register view form and template. 2016-01-05 12:41:20 +00:00
Rebecca Law
3b96b6e5ca 108536374: Implement a validator to exclude passwords on a blacklist 2015-12-01 16:45:11 +00:00