Commit Graph

22287 Commits

Author SHA1 Message Date
Manjinder Singh
cd60646926 fix: Switch anonymous user ID hash from md5 to shake (#26198)
Now that we always return an existing value from the DB rather than trusting that ID generation is deterministic and constant over time, we're free to change the generation algorithm.

Our long term goal is to switch to random IDs, but we need to first investigate the uses of save=False. In the meantime, this is a good opportunity to move away from MD5, which has a number of cryptographic weaknesses. None of the known vulnerabilities are considered exploitable in this location, given the limited ability to control the input to the hash, but we should generally be moving away from it everywhere for consistency.

This change should not be breaking even for save=False callers, since those calls are extremely rare (1 in 100,000) and should only occur after a save=True call, at which point they'll use the stored value. Even if this were not true, for a save=False/True pair of calls to result in a mismatch in output, the first of the calls would have to occur around the time of the deploy of this code.

Co-authored-by: Tim McCormack <tmccormack@edx.org>
 
Co-authored-by: Tim McCormack <tmccormack@edx.org>
2021-02-10 07:37:27 -05:00
Feanil Patel
a482bc15e3 Merge pull request #26441 from edx/feanil/make_rate_limit_errors_429s
Make rate limit errors 429s instead of 403s
2021-02-09 15:07:22 -05:00
Alexander J Sheehan
e9175c2338 Merge pull request #26444 from edx/alex-sheehan-edx/use-the-right-integrated-channels-task
replace bulk transmission task to intended single learner task
2021-02-09 12:28:50 -05:00
Alexander Sheehan
aaa375077c replace bulk transmission task to intended single learner task 2021-02-09 11:55:22 -05:00
Christie Rice
7db147e06a Fix lint-amnesty warnings (#26412) 2021-02-09 10:20:46 -05:00
Christie Rice
997e31b56b MICROBA-918 Check the allowlist when regenerating certificates, and stop incidentally modifying the certificate invalidation list (#26439) 2021-02-09 09:47:33 -05:00
Carla Duarte
7f7edd93c7 Merge pull request #26440 from edx/ciduarte/AA-590
AA-590: pass translated tab titles to MFE
2021-02-09 08:57:10 -05:00
usamasadiq
1e2aa1dec5 Apply manesty to convention warnings 2021-02-09 17:09:19 +05:00
Carla Duarte
00a025f073 AA-590: pass translated tab titles to MFE 2021-02-08 17:00:33 -05:00
Matt Hughes
02d0b474e7 Merge pull request #219 from edx/matthugs/EDUCATOR-5555-a11y-js-code-for-notes-needs-to-handle-tags-better
Fix XSS vector for a11y text attached to notes editor
2021-02-08 16:54:49 -05:00
Tim McCormack
80a4437f33 fix: Always save generated anonymous user ID in DB; ignore save=False (#26399)
This deprecates `save=False` for several functions and removes all known
usages of the parameter but does not actually remove the parameter.
Instead, it will emit a deprecation warning if the parameter is used.
We can remove the parameter as soon as we feel sure nothing is using it.

Now that we have refactored `anonymous_id_for_user` to always prefer
retrieving an existing ID from the database -- and observed that only a
small fraction of calls pass save=False -- we can stop respecting
save=False. This opens the door for future improvements, such as generating
random IDs or switching to the external user ID system.

Metrics: I observe that 1 in 16 requests for new, non-request-cached
anon user IDs are made with save=False. But 71% of all calls are served
from the request cache, and 99.7% of the misses are served from the DB.
save=False only appear to come from intermittent spikes as reports are
generated and are low in absolute number.

Also document usage/risk/rotation of secret in anonymous user ID
generation as indicated by `docs/decisions/0008-secret-key-usage.rst`
ADR on `SECRET_KEY` usage.

ref: ARCHBOM-1683
2021-02-08 19:16:05 +00:00
Feanil Patel
cfca652dee feat: Add paths to easily view various error pages.
Currently it's hard to see the content of an error without knowing how
to cause an existing view to make that error in production.  Adding
these default paths should make that a lot easier.
2021-02-08 14:03:26 -05:00
Feanil Patel
cd3e4353b1 feat: Add a 403 and 429 handler.
See context here: https://django-ratelimit.readthedocs.io/en/latest/cookbook/429.html#context

For now we continue to fall back to django's default 403 handler for 403
but provide a new 429 template that we use for ratelimit exceptions.

This commit also updates a logistration test that relied on the old 403
behavior of django-ratelimit instead of the newly added 429 behavior.
2021-02-08 14:03:26 -05:00
Bianca Severino
54505b82c4 Merge pull request #26436 from edx/bseverino/proctoring-check-fix
[MST-645] Account for no enrollment in courseware rules
2021-02-08 13:39:40 -05:00
Carla Duarte
a3f0050c4d Merge pull request #26396 from edx/ciduarte/depr-keys
AA-650: block deprecated keys from course home MFE
2021-02-08 13:27:58 -05:00
Bianca Severino
4fb36709a5 Account for no enrollment in courseware rules 2021-02-08 13:12:52 -05:00
Carla Duarte
8d2d78dc61 AA-650: block deprecated keys from course home MFE 2021-02-08 13:00:36 -05:00
Feanil Patel
03d2d983ea Merge pull request #26392 from edx/feanil/rate_limit_anon_csv
Feanil/rate limit anon csv
2021-02-08 12:05:21 -05:00
Christie Rice
367d2a07c9 Fix lint-amnesty warnings (#26411) 2021-02-08 10:49:32 -05:00
Gábor Boros
dd55860da1 [TSD] [SE-3988] add annotations to instructor plugin settings (#26202)
docs: add annotations to instructor plugin settings
2021-02-08 10:45:26 -05:00
Tim McCormack
b8a6e30bd9 fix: Add new proctoring key to Studio devstack & tests envs (copy from LMS) (#26430)
Turns out it's needed for the Proctoring Settings view.

Also reorder slightly for better clustering.

MST-644
2021-02-08 15:43:51 +00:00
Christie Rice
6e5a9f5f6f MICROBA-918 Move methods to separate certificate generation from celery task to schedule certificate generation. Also standardizes imports. (#26410) 2021-02-08 10:01:04 -05:00
edx-pipeline-bot
930980d732 Merge pull request #26427 from edx/private_to_public_01b389b
Mergeback PR from private to public.
2021-02-08 09:36:23 -05:00
Usama Sadiq
1bb06669e3 Merge branch 'master' into usamasadiq/bom-2312-pylint-amnesty-common-lib 2021-02-08 18:26:15 +05:00
Usama Sadiq
90666a6231 Merge pull request #26311 from edx/usamasadiq/bom-2305-pylint-amnesty
Applied pylint-amnesty
2021-02-08 18:23:34 +05:00
JayRam Nai
17cde562da docs: Add annotations for ENABLE_FOOTER_MOBILE_APP_LINKS feature flag (#26389)
docs: update warning for ENABLE_FOOTER_MOBILE_APP_LINKS features toggle
2021-02-08 07:58:09 -05:00
Ali Akbar
06cfaa2d88 Merge pull request #220 from edx/IM/security-fixes-9
Incident Management Security Fixes 9
2021-02-08 17:46:06 +05:00
usamasadiq
1175838fa5 fix pep8 warnings 2021-02-08 16:08:01 +05:00
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
JayRam Nai
f5ba226c71 docs: Add annotations for ENABLE_DJANGO_ADMIN_SITE feature flag (#26388) 2021-02-06 11:04:22 -05:00
JayRam Nai
c658a4719b docs: Adds annotations for HIDE_DASHBOARD_COURSES_UNTIL_ACTIVATED feature flag (#26403) 2021-02-06 10:48:10 -05:00
Felipe Montoya
081a334fb8 Merge pull request #26212 from eduNEXT/lmm/annotation_mfe_urls
[TSD] Add annotations for MFE URL settings
2021-02-05 17:51:05 -05:00
Felipe Montoya
aba34c506e Merge pull request #26406 from jramnai/tsd-enable_student_history_view
[TSD] docs: Add annotations for ENABLE_STUDENT_HISTORY_VIEW feature flag
2021-02-05 17:50:41 -05:00
Tim McCormack
38f29c30f8 feat: Use edx-proctoring 3.0.0 and set required ID generation key (#26408)
MST-637: edx-proctoring 3.0.0 now requires a new key for use in ID
generation, starting from same value as SECRET_KEY (pre-rotation, but
rotation never happened for devstack.)

Remote config changes already made for relevant environments.
2021-02-05 16:19:14 +00:00
Matthew Piatetsky
b91f720b7e Merge pull request #26293 from edx/AA-613
[AA-613] Return content type gate for staff users when masquerading as the Learner in Audit or Learner in Limited Access Roles
2021-02-05 09:18:34 -05:00
Jayram Nai
df517c7c21 docs: Add annotations for ENABLE_STUDENT_HISTORY_VIEW feature flag 2021-02-05 18:54:36 +05:30
Matthew Piatetsky
ae7d0a1ed8 Return content type gate for staff users when masquerading as the Learner in Audit or Learner in Limited Access Roles
This is necessary to display the content type gate in the UI
AA-613
2021-02-04 17:34:16 -05:00
Christie Rice
1fe0eee969 MICROBA-918 Fix warnings (#26397) 2021-02-04 15:45:00 -05:00
Carla Duarte
a08faaaa9c Merge pull request #26360 from edx/ciduarte/AA-635
AA-635: learner dashboard course card image bug
2021-02-04 14:58:53 -05:00
Feanil Patel
0221d6a081 feat: Add ratelimitng to the get_anon_ids api endpoint.
This endpoint can be computationally intensive and so we want to limit
the number of concurrent executions so that it doesn't overload the
server.
2021-02-04 14:03:15 -05:00
Christie Rice
8845685fd8 MICROBA-918 Check for the allowlist on invalidation and failing grades (#26356) 2021-02-04 13:42:33 -05:00
Olivia Ruiz-Knott
016b1ce3f7 Merge pull request #26227 from edx/ork/MICROBA-905_add-history-to-certificate-invalidation
MICROBA-905 Add django-simple-history  to CertificateInvalidation model
2021-02-04 10:11:05 -05:00
Sid Verma
d81215c1e9 [SE-3685] Hide footer links if unconfigured in Certificates (#25872)
* Don't show marketing links if not configured

* Remove failing test
2021-02-04 10:09:49 -05:00
Waheed Ahmed
38187de0f9 Authn MFE: Toggle for microfrontend redirect.
VAN-308
2021-02-04 18:58:58 +05:00
Jawayria
11174a8d9c Merge pull request #26285 from edx/py-amnesty-courseware
Applied pylint-amnesty to courseware
2021-02-04 14:44:36 +05:00
Jawayria
1bfbedcc8f Merge pull request #26280 from edx/py-amnesty-course-api
Applied pylint-amnesty to course_api
2021-02-04 14:44:24 +05:00
Jawayria
959aed9841 Resolved pep8 issues 2021-02-04 14:07:47 +05:00
Jawayria
e9b167e1fd Applied pylint-amnesty to course_api 2021-02-04 13:22:45 +05:00
Ali-D-Akbar
c7a467b04d PROD-1999 2021-02-04 10:20:25 +05:00
oliviaruizknott
d33d9a66c8 docs: clarify comment 2021-02-03 16:52:34 -05:00