-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AIRFLOW-2809] Fix security issue regarding Flask SECRET_KEY #3651
Conversation
@XD-DENG Can you prepend the squash the commits and prepend the message with the Jira ticket This looks like a good idea to me, maybe check what the other committers think about this. |
0f28717
to
48bff00
Compare
Thanks @Fokko . Have squashed the commits and prepended the JIRA ticket label as suggested. |
71f60cc
to
511125a
Compare
It's recommended by Falsk community to use random SECRET_KEY for security reason. However, in Airflow there is a default value for secret_key and most users will ignore to change it. This may cause security concern.
Codecov Report
@@ Coverage Diff @@
## master #3651 +/- ##
==========================================
+ Coverage 77.5% 77.51% +<.01%
==========================================
Files 205 205
Lines 15747 15751 +4
==========================================
+ Hits 12205 12209 +4
Misses 3542 3542
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The same issue was fixed for /www previously in PR apache#3651 (JIRA ticket 2809)
It's recommended by Falsk community to use random SECRET_KEY for security reason. However, in Airflow there is a default value for secret_key and most users will ignore to change it. This may cause security concern. Closes apache#3651 from XD-DENG/patch-2
The same issue was fixed for /www previously in PR #3651 (JIRA ticket 2809)
…e#3729) The same issue was fixed for /www previously in PR apache#3651 (JIRA ticket 2809)
It's recommended by Falsk community to use random SECRET_KEY for security reason. However, in Airflow there is a default value for secret_key and most users will ignore to change it. This may cause security concern. Closes apache#3651 from XD-DENG/patch-2
…e#3729) The same issue was fixed for /www previously in PR apache#3651 (JIRA ticket 2809)
…e#3729) The same issue was fixed for /www previously in PR apache#3651 (JIRA ticket 2809) (cherry picked from commit fe6d00a) (cherry picked from commit a8900fa) (cherry picked from commit 5b08ec2c3b5b0e67dcdd176a5b3ecbd6f0318a6e) (cherry picked from commit b3711ff)
It's recommended by Falsk community to use random SECRET_KEY for security reason. However, in Airflow there is a default value for secret_key and most users will ignore to change it. This may cause security concern. Closes apache#3651 from XD-DENG/patch-2 (cherry picked from commit dfa7b26) (cherry picked from commit 2f3b1c7)
…e#3729) The same issue was fixed for /www previously in PR apache#3651 (JIRA ticket 2809) (cherry picked from commit fe6d00a) (cherry picked from commit a8900fa)
- BugFix: Tasks with ``depends_on_past`` or ``task_concurrency`` are stuck (apache#12663) - Fix issue with empty Resources in executor_config (apache#12633) - Fix: Deprecated config ``force_log_out_after`` was not used (apache#12661) - Fix empty asctime field in JSON formatted logs (apache#10515) - [AIRFLOW-2809] Fix security issue regarding Flask SECRET_KEY (apache#3651) - [AIRFLOW-2884] Fix Flask SECRET_KEY security issue in www_rbac (apache#3729) - [AIRFLOW-2886] Generate random Flask SECRET_KEY in default config (apache#3738) - Add missing comma in setup.py (apache#12790) - Bugfix: Unable to import Airflow plugins on Python 3.8 (apache#12859) - Fix setup.py missing comma in ``setup_requires`` (apache#12880) - Don't emit first_task_scheduling_delay metric for only-once dags (apache#12835) - Update setup.py to get non-conflicting set of dependencies (apache#12636) - Rename ``[scheduler] max_threads`` to ``[scheduler] parsing_processes`` (apache#12605) - Add metric for scheduling delay between first run task & expected start time (apache#9544) - Add new-style 2.0 command names for Airflow 1.10.x (apache#12725) - Add Kubernetes cleanup-pods CLI command for Helm Chart (apache#11802) - Don't let webserver run with dangerous config (apache#12747) - Replace pkg_resources with importlib.metadata to avoid VersionConflict errors (apache#12694) - Clarified information about supported Databases
It's recommended by Falsk community to use random SECRET_KEY for security reason. However, in Airflow there is a default value for secret_key and most users will ignore to change it. This may cause security concern. Closes apache#3651 from XD-DENG/patch-2 (cherry picked from commit dfa7b26)
The same issue was fixed for /www previously in PR apache#3651 (JIRA ticket 2809) (cherry picked from commit fe6d00a)
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) (cherry picked from commit fe6d00a54f83468e296777d3b83b65a2ae7169ec) GitOrigin-RevId: a8900fa5f2b8963e9f57ba4ae5520a5d339aeaad
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) (cherry picked from commit fe6d00a54f83468e296777d3b83b65a2ae7169ec) GitOrigin-RevId: a8900fa5f2b8963e9f57ba4ae5520a5d339aeaad
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
The same issue was fixed for /www previously in PR apache/airflow#3651 (JIRA ticket 2809) GitOrigin-RevId: fe6d00a54f83468e296777d3b83b65a2ae7169ec
JIRA
Description
Background
Currently there is a configuration item secret_key in the configuration .cfg file, with a default value "temporary_key".
Issue
Most admins would ignore it and just use the default value "temporary_key". However, this may be very dangerous. User may modify the cookie if they try the default SECRET_KEY while the admin didn't change it.
**In Flask documentation, it's suggested to have a SECRET_KEY which is as random as possible (http://flask.pocoo.org/docs/1.0/quickstart/ ). **
My Proposal
If Admin explicitly changed the SECRET_KEY in .cfg file, we use this SECRET_KEY given by Admin.
If the default SECRET_KEY is not changed in .cfg file, randomly generate SECRET_KEY. Meanwhile, print INFO to remind that a randomly generated SECRET_KEY is used.
This solution will not affect user experience at all.
Tests
Commits
Documentation
Code Quality
git diff upstream/master -u -- "*.py" | flake8 --diff