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

Implement new endpoint to list reports/evaluations #156

Closed
afiune opened this issue Jul 1, 2020 · 0 comments
Closed

Implement new endpoint to list reports/evaluations #156

afiune opened this issue Jul 1, 2020 · 0 comments
Assignees
Labels
api Something related to the Go API client cli Something related to the Lacework CLI documentation Improvements or additions to documentation feat New feature or request

Comments

@afiune
Copy link
Contributor

afiune commented Jul 1, 2020

User Story

As a Lacework User that interacts with the platform using the Lacework CLI,
I need to have a way to list all my vulnerability reports in my account,
So that I can navigate through my reports and avoid requesting new scans of existing images
that have already been scanned.

Feature Description

This feature is around matching the new API endpoint that lists all evaluations in the user's account:

  • /external/vulnerabilities/container/GetEvaluationsForDateRange

Additionally, we need to add a new command to the Lacework CLI.

Acceptance Criteria

  • The new API endpoint should be abstracted into the Go Client
  • A new command should be added to the Lacework CLI that lists all evaluations in an account
@afiune afiune added documentation Improvements or additions to documentation feat New feature or request cli Something related to the Lacework CLI api Something related to the Go API client labels Jul 1, 2020
@afiune afiune self-assigned this Jul 1, 2020
afiune added a commit that referenced this issue Jul 6, 2020
This new feature is adding two new functions `ListEvalutions()` and
`ListEvaluationsDateRange()` to the `Vulnerability` service inside the
Go API client, these endpoints wrap the new API endpoint:

`/external/vulnerabilities/container/GetEvaluationsForDateRange`

The functions will allow users to lists all evaluations in an account.

An example:
```go
package main

import (
	"fmt"
	"log"

	"github.com/lacework/go-sdk/api"
)

func main() {
	lacework, err := api.NewClient("account")
	if err != nil {
		log.Fatal(err)
	}

	// Output: YOUR-ACCESS-TOKEN
	fmt.Println(lacework.Vulnerability.ListEvaluations())
}
```

Contributes to #156

Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
afiune added a commit that referenced this issue Jul 6, 2020
This new feature is adding two new functions `ListEvalutions()` and
`ListEvaluationsDateRange()` to the `Vulnerability` service inside the
Go API client, these endpoints wrap the new API endpoint:

`/external/vulnerabilities/container/GetEvaluationsForDateRange`

The functions will allow users to lists all evaluations in an account.

An example:
```go
package main

import (
	"fmt"
	"log"

	"github.com/lacework/go-sdk/api"
)

func main() {
	lacework, err := api.NewClient("account")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(lacework.Vulnerability.ListEvaluations())
}
```

Contributes to #156

Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
afiune added a commit that referenced this issue Jul 6, 2020
This new feature is adding two new functions `ListEvalutions()` and
`ListEvaluationsDateRange()` to the `Vulnerabilities` service inside the
Go API client, these endpoints wrap the new API endpoint:

`/external/vulnerabilities/container/GetEvaluationsForDateRange`

The functions will allow users to lists all evaluations in an account.

An example:
```go
package main

import (
	"fmt"
	"log"

	"github.com/lacework/go-sdk/api"
)

func main() {
	lacework, err := api.NewClient("account")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(lacework.Vulnerabilities.ListEvaluations())
}
```

Contributes to #156

Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
afiune added a commit that referenced this issue Jul 6, 2020
This new feature is adding two new functions `ListEvalutions()` and
`ListEvaluationsDateRange()` to the `Vulnerabilities` service inside the
Go API client, these endpoints wrap the new API endpoint:

`/external/vulnerabilities/container/GetEvaluationsForDateRange`

The functions will allow users to lists all evaluations in an account.

An example:
```go
package main

import (
	"fmt"
	"log"

	"github.com/lacework/go-sdk/api"
)

func main() {
	lacework, err := api.NewClient("account")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(lacework.Vulnerabilities.ListEvaluations())
}
```

Contributes to #156

Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
afiune added a commit that referenced this issue Jul 6, 2020
This new feature is adding two new functions `ListEvalutions()` and
`ListEvaluationsDateRange()` to the `Vulnerabilities` service inside the
Go API client, these endpoints wrap the new API endpoint:

`/external/vulnerabilities/container/GetEvaluationsForDateRange`

The functions will allow users to lists all evaluations in an account.

An example:
```go
package main

import (
	"fmt"
	"log"

	"github.com/lacework/go-sdk/api"
)

func main() {
	lacework, err := api.NewClient("account")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(lacework.Vulnerabilities.ListEvaluations())
}
```

Contributes to #156

Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
afiune added a commit that referenced this issue Jul 6, 2020
* feat(api): new Vulnerabilities.ListEvaluations() func

This new feature is adding two new functions `ListEvalutions()` and
`ListEvaluationsDateRange()` to the `Vulnerabilities` service inside the
Go API client, these endpoints wrap the new API endpoint:

`/external/vulnerabilities/container/GetEvaluationsForDateRange`

The functions will allow users to lists all evaluations in an account.

An example:
```go
package main

import (
	"fmt"
	"log"

	"github.com/lacework/go-sdk/api"
)

func main() {
	lacework, err := api.NewClient("account")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(lacework.Vulnerabilities.ListEvaluations())
}
```

Contributes to #156

Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
afiune added a commit that referenced this issue Jul 7, 2020
Here is a quick summary, with suppressed help output, of the changes to
the vulnerability commands:

Main Vulnerability Command:
```
$ lacework vulnerability -h

Available Commands:
  evaluation  review evaluations from assessed container images
  report      (deprecated) use 'evaluation show <sha256:hash>' instead
  scan        manage on-demand vulnerability scans
```

Vulnerability Evaluation Sub-Command:
```
$ lacework vulnerability evaluation -h

Available Commands:
  list        list all evaluations from a time range (default last 7 days)
  show        show results of a container image evaluation
```

Vulnerability Scan Sub-Command:
```
$ lacework vulnerability scan -h

Available Commands:
  run         request an on-demand vulnerability scan
  show        return results about an on-demand vulnerability scan
```

(DEPRECATED) Vulnerability Report Sub-Command:
```
$ lacework vulnerability report -h
(DEPRECATED) This command has been moved, use now the following command:

  $ lacework vulnerability evaluation show <sha256:hash>
```

Adds Deprecations #162
Closes #156

Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
afiune added a commit that referenced this issue Jul 7, 2020
Here is a quick summary, with suppressed help output, of the changes to
the vulnerability commands:

Main Vulnerability Command:
```
$ lacework vulnerability -h

Available Commands:
  evaluation  review evaluations from assessed container images
  report      (deprecated) use 'evaluation show <sha256:hash>' instead
  scan        manage on-demand vulnerability scans
```

Vulnerability Evaluation Sub-Command:
```
$ lacework vulnerability evaluation -h

Available Commands:
  list        list all evaluations from a time range (default last 7 days)
  show        show results of a container image evaluation
```

Vulnerability Scan Sub-Command:
```
$ lacework vulnerability scan -h

Available Commands:
  run         request an on-demand vulnerability scan
  show        return results about an on-demand vulnerability scan
```

(DEPRECATED) Vulnerability Report Sub-Command:
```
$ lacework vulnerability report -h
(DEPRECATED) This command has been moved, use now the following command:

  $ lacework vulnerability evaluation show <sha256:hash>
```

Adds Deprecations #162
Closes #156

Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
afiune added a commit that referenced this issue Aug 14, 2020
Here is a quick summary, with suppressed help output, of the changes to
the vulnerability commands:

Main Vulnerability Command:
```
$ lacework vulnerability -h

Available Commands:
  evaluation  review evaluations from assessed container images
  report      (deprecated) use 'evaluation show <sha256:hash>' instead
  scan        manage on-demand vulnerability scans
```

Vulnerability Evaluation Sub-Command:
```
$ lacework vulnerability evaluation -h

Available Commands:
  list        list all evaluations from a time range (default last 7 days)
  show        show results of a container image evaluation
```

Vulnerability Scan Sub-Command:
```
$ lacework vulnerability scan -h

Available Commands:
  run         request an on-demand vulnerability scan
  show        return results about an on-demand vulnerability scan
```

(DEPRECATED) Vulnerability Report Sub-Command:
```
$ lacework vulnerability report -h
(DEPRECATED) This command has been moved, use now the following command:

  $ lacework vulnerability evaluation show <sha256:hash>
```

Adds Deprecations #162
Closes #156

Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
@afiune afiune closed this as completed in 7e7191a Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Something related to the Go API client cli Something related to the Lacework CLI documentation Improvements or additions to documentation feat New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant