[GH-ISSUE #374] Python 2.7: Insecure key file permissions! #277

Open
opened 2026-02-27 16:38:42 +03:00 by kerem · 4 comments
Owner

Originally created by @oytunistrator on GitHub (Jul 26, 2014).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/374

root@ospace:/var/www/webvirtmgr# ./manage.py runserver 0.0.0.0:80
WARNING:root:No local_settings file found.
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 263, in fetch_command
    app_name = get_commands()[subcommand]
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 109, in get_commands
    apps = settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 53, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 48, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 132, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/var/www/webvirtmgr/webvirtmgr/settings.py", line 165, in <module>
    '.secret_key_store'))
  File "/var/www/webvirtmgr/webvirtmgr/utils/secret_key.py", line 61, in generate_or_read_from_file
    raise FilePermissionError("Insecure key file permissions!")
webvirtmgr.utils.secret_key.FilePermissionError: Insecure key file permissions!

Distro: Ubuntu 14.04 LTS

Originally created by @oytunistrator on GitHub (Jul 26, 2014). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/374 ``` root@ospace:/var/www/webvirtmgr# ./manage.py runserver 0.0.0.0:80 WARNING:root:No local_settings file found. Traceback (most recent call last): File "./manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 263, in fetch_command app_name = get_commands()[subcommand] File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 109, in get_commands apps = settings.INSTALLED_APPS File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 53, in __getattr__ self._setup(name) File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 48, in _setup self._wrapped = Settings(settings_module) File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 132, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/var/www/webvirtmgr/webvirtmgr/settings.py", line 165, in <module> '.secret_key_store')) File "/var/www/webvirtmgr/webvirtmgr/utils/secret_key.py", line 61, in generate_or_read_from_file raise FilePermissionError("Insecure key file permissions!") webvirtmgr.utils.secret_key.FilePermissionError: Insecure key file permissions! ``` Distro: Ubuntu 14.04 LTS
Author
Owner

@retspen commented on GitHub (Jul 28, 2014):

Check your webvirtmgr/local/.secret_key_store permission must be www-data owner

<!-- gh-comment-id:50303134 --> @retspen commented on GitHub (Jul 28, 2014): Check your `webvirtmgr/local/.secret_key_store` permission must be www-data owner
Author
Owner

@srulikuk commented on GitHub (Aug 8, 2014):

Hi,

I have the same error for running ./manage.py createsuperuser, problem is i forgot my web gui password and need to either find it in the conf files or add a new user.
my webvirtmgr/local/.secret_key_store permission is set to www-data (-rwxr-xr-x 1 www-data www-data)
Please help

<!-- gh-comment-id:51556233 --> @srulikuk commented on GitHub (Aug 8, 2014): Hi, I have the same error for running ./manage.py createsuperuser, problem is i forgot my web gui password and need to either find it in the conf files or add a new user. my webvirtmgr/local/.secret_key_store permission is set to www-data (-rwxr-xr-x 1 www-data www-data) Please help
Author
Owner

@retspen commented on GitHub (Sep 1, 2014):

Permission must be 664

<!-- gh-comment-id:54033780 --> @retspen commented on GitHub (Sep 1, 2014): Permission must be 664
Author
Owner

@nickw444 commented on GitHub (Dec 10, 2014):

https://github.com/retspen/webvirtmgr/blob/master/webvirtmgr/utils/secret_key.py#L61

Permissions must be 600. See link.

<!-- gh-comment-id:66425874 --> @nickw444 commented on GitHub (Dec 10, 2014): https://github.com/retspen/webvirtmgr/blob/master/webvirtmgr/utils/secret_key.py#L61 Permissions must be 600. See link.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#277
No description provided.