SignalK / set-system-time

Signal K Node server plugin to set system time on time data from GPS
Apache License 2.0
3 stars 6 forks source link

Check if sudo is password less. #4

Closed FredericGuilbault closed 5 years ago

FredericGuilbault commented 5 years ago

Hi, Im running signalk on a user with is not a sudoer. In order to set the date I need to allow signalk to use sudo paswordless. So I added a passwordless access to the command date.

signalk ALL=(ALL) NOPASSWD: /bin/date

But is seem like signalk need a wild card access (ALL) to sudo in order to check if it have permission to set date. Witch give a LOT of power to signalk and any plugins installed.

I would be quite more secure to allow signalk to only access the date command.

tkurki commented 5 years ago

Definitely.

Can you help me out with this? How do you detect that passwordless sudo is available for /bin/date without running it? See https://github.com/SignalK/set-system-time/blob/master/index.js#L63

FredericGuilbault commented 5 years ago

ill dig it. No problem.

FredericGuilbault commented 5 years ago

How Should I setup my dev environment for signalk plugins ? I taught those plugins had to be installed via signalk(npm) in order to be configured correctly or something.

tkurki commented 5 years ago

Checkout plugin and install dependencies. Run npm link in plugin directory. Then run npm link <pluginid> in Sk server’s settings directory, usually ~/.signalk. This will create a symlink from node_modules to the plugin and it looks like it was installed with npm.