Closed jspaleta closed 3 years ago
This issue has been mentioned on Sensu Community. There might be relevant details there:
https://discourse.sensu.io/t/sensu-go-plugin-distribution-model/1724/10
Update on this... If we implement binary executable symlinks we should probably have the symlink directory encode the namespace in which the asset resource exists.
/var/cache/sensu/sensu-agent/asset-exec-symlinks/<namespace>/
default for backend would look like this:
/var/cache/sensu/sensu-backend/asset-exec-symlinks/<namespace>/
I am seeing issues with this as well.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Allow agent to create symlinks to asset binaries into a common directory at asset install time.
Motivation: Some common operations like filesystem or memory checks require privileged operation on linux systems, so its an existing common practice to run some sensu-plugins checks setuid or under sudo if needed. This is much harder to do with assets currently because the shasum is part of the binary path. Sudo rules would have to be updated in conjunction with asset updates.
Goal: Make it possible for operators to use assets in privileged operations using full path sudo rules to symlinked binary locations that will continue to work after asset upgrades.
Benefits:
Limitations:
Security Impact: Because the automatically generated symlinks are not privileged themselves, there is no additional impact on security footprint. The security impact is directly related to the sudo rules that the local operator must choose to create in order to enhance the privileges before making use of the symlinks in a check definition.
Strawman proposal(s):
Allow operators to configure agent to enable/disable asset symlinks, and optionally define a symlink directory to populate with symlinks for all downloaded asset binaries. Effectively 2 different agent config settings needed.
Allow operators to configure asset definitions with full path symlink directory to populate as am override on an asset by asset basis. This could be implemented as an asset annotation with no changes to current asset spec. Only used if agent has asset symlinks enabled. This helps mitigate potential of multiple assets with the same binary racing the generated symlink.
Forbid the asset specific symlink directory override annotation from being populated in any Bonsai generated configs. This should be an advanced local operator only feature.
Local admin is responsible to ensure symlink directories are writble by user running sensu-agent service. If symlink creation fails...report as new type of asset install error.
Context
Long discussion in Slack on how to use assets for privileged operations: https://sensucommunity.slack.com/archives/C9BB9AW7K/p1560289972066700