Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds attest Unix workloads by user groups #1771

Merged

Conversation

kunzimariano
Copy link
Member

@kunzimariano kunzimariano commented Aug 3, 2020

Signed-off-by: Mariano Kunzi kunzi.mariano@gmail.com

Affected functionality
Implements attest Unix workloads by user groups

Description of change
Adds 2 new selectors to support supplementary groups.

Which issue this PR fixes
fixes #1657

Some extra context

  • gopsutil won't release until go 1.15. For that reason I wrote a custom implementation that reads groups from /proc/[pid]/status This PR is currently consuming https://github.com/shirou/gopsutil from their master until they release the Groups() listing feature.
  • supplementary_gid and supplementary_group are probably bad names. Any alternative is welcome.
    - Although macOS is not fully supported there are some caveats I would like to mention, for people that develop on it.
    - Listing the Groups() is currently broken, I created an issue for it Calling the new process.Groups() fails on macOS shirou/gopsutil#913
    - The 3 first elements on the list should be real, effective, and saved set gid. What I have been getting in my local dev machine is 0, 20, 0, where 20 is my staff gid and 0 should be wheel. I don't have full knowledge of how macOS handles this but I thought worth mentioning, since it could have unexpected consequences.

Signed-off-by: Mariano Kunzi <kunzi.mariano@gmail.com>
@kunzimariano kunzimariano marked this pull request as ready for review August 3, 2020 18:33
Copy link
Contributor

@marcosy marcosy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I left some comments 🙂

pkg/agent/plugin/workloadattestor/unix/unix.go Outdated Show resolved Hide resolved
pkg/agent/plugin/workloadattestor/unix/unix.go Outdated Show resolved Hide resolved
pkg/agent/plugin/workloadattestor/unix/unix.go Outdated Show resolved Hide resolved
Signed-off-by: Mariano Kunzi <kunzi.mariano@gmail.com>
Signed-off-by: Mariano Kunzi <kunzi.mariano@gmail.com>
Signed-off-by: Mariano Kunzi <kunzi.mariano@gmail.com>
Copy link
Member

@azdagron azdagron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @kunzimariano !

@azdagron azdagron merged commit cfb0521 into spiffe:master Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attest Unix workloads by user groups
4 participants