StackStorm / packer-st2

Packer templates for building & deploying Vagrant & OVA with StackStorm installed
https://app.vagrantup.com/stackstorm/boxes/st2
Apache License 2.0
13 stars 7 forks source link

Make sure ~/.st2/config file is only readable by the owner, delete ~/.st2/st2admin-token file #38

Open Kami opened 6 years ago

Kami commented 6 years ago

We should make the following changes to the published image:

From Slack:

@kami yes, seen that before. It's indeed created during the CI runs.

It happens because we do `sudo st2 ...` somewhere and so token is saved with `root` permissions.

I even thought about submitting a PR for st2 so the dir `/home/${USERNAME}/.st2/` is created by StackStorm client with `setgid` flag, meaning token will take the folder's owner group.

But we were pretty time limited on this OVA work.
Can you create an issue in https://github.com/stackstorm/packer-st2 ?
Another issue I noticed during that work, - `.st2/config` has read-all permissions and so everyone can read st2 username:password.
This is bug by our `curl|bash` installer:
```$ ls -la ~/.st2/config 
-rw-r--r-- 1 vagrant vagrant 54 May 23 14:09 /home/vagrant/.st2/config