8000 creating and using package capabilties by mtcherni95 · Pull Request #1253 · aquasecurity/tracee · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

creating and using package capabilties #1253

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

Closed
wants to merge 1 commit into from

Conversation

mtcherni95
Copy link
Contributor
@mtcherni95 mtcherni95 commented Dec 14, 2021

Solves #1254

@@ -2,6 +2,7 @@ package main

import (
"fmt"
"github.com/aquasecurity/tracee/pkg/capabilities"
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you using goimports?

@@ -88,11 +89,11 @@ func main() {

// environment capabilities

selfCap, err := getSelfCapabilities()
selfCap, err := capabilities.SelfCapabilities()
Copy link
Contributor
@danielpacak danielpacak Dec 14, 2021

Choose a reason for hiding this comment

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

Hide comment

I'm wondering if we could avoid repetition in package names and exported functions as explained in Effective Go Package Names WDYT?

Suggested change
selfCap, err := capabilities.SelfCapabilities()
selfCap, err := capabilities.Self()

if err != nil {
return err
}
if err = checkRequiredCapabilities(selfCap); err != nil {
if err = capabilities.CheckRequiredCapabilities(selfCap); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

DITTO

Suggested change
if err = capabilities.CheckRequiredCapabilities(selfCap); err != nil {
if err = capabilities.CheckRequired(selfCap); err != nil {


import (
"fmt"
"github.com/syndtr/gocapability/capability"
Copy link
Contributor
@danielpacak danielpacak Dec 14, 2021

Choose a reason for hiding this comment

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

Out of scope of this PR but I was wondering if we are okey with gocapability BSD 2-Clause "Simplified" License. (I assume that the fact it's not very actively maintained is because it is feature complete?)

@simar7
Copy link
Member
simar7 commented Dec 15, 2021

We might be stepping on over on each others feet here #1256

I've restructured the package layout and re-did tests for it. I think we should reconcile our PRs to avoid duplicate work.

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.

3 participants
0