-
-
Notifications
You must be signed in to change notification settings - Fork 782
Closed
Description
st2 login -w creates ~/.st2/config file with r-o permissions, meaning that unauthorized linux user can read that file and obtain st2 login credentials:
$ rm -rf ~/.st2
$ st2 login st2admin -p Ch@ngeMe -w
$ ls -la ~/.st2
total 16
drwxrwxr-x 2 vagrant vagrant 4096 May 24 14:59 .
drwxr-xr-x 8 vagrant vagrant 4096 May 24 14:59 ..
-rw-rw-r-- 1 vagrant vagrant 55 May 24 14:59 config
-rw------- 1 vagrant vagrant 77 May 24 14:59 token-st2admin
Additionally, ~/.st2/ dir permissions when created might be adjusted (currently 0755).
Adding setgid for st2 config dir will help to better handle sudo st2 cases when config or token file is created with root permissions (see StackStorm/packer-st2#38 for example).
Wrap Up
~/.st2/dir when created by st2 should have2770permissions (currently0755)~/.st2/configwhen created by st2 should have660permissions (currently664)~/.st2/tokenwhen created by st2 should have660permissions (currently640)