-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): new vulnerability evaluation command
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 <[email protected]>
- Loading branch information
Showing
5 changed files
with
298 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// Author:: Salim Afiune Maya (<[email protected]>) | ||
// Copyright:: Copyright 2020, Lacework Inc. | ||
// License:: Apache License, Version 2.0 | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
package cmd | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/pkg/errors" | ||
) | ||
|
||
// parse the start and end time provided by the user | ||
func parseStartAndEndTime(s, e string) (start time.Time, end time.Time, err error) { | ||
if s == "" { | ||
err = errors.New("when providing an end time, start time should be provided (--start)") | ||
return | ||
} | ||
start, err = time.Parse(time.RFC3339, s) | ||
if err != nil { | ||
err = errors.Wrap(err, "unable to parse start time") | ||
return | ||
} | ||
|
||
if e == "" { | ||
err = errors.New("when providing a start time, end time should be provided (--end)") | ||
return | ||
} | ||
end, err = time.Parse(time.RFC3339, e) | ||
if err != nil { | ||
err = errors.Wrap(err, "unable to parse end time") | ||
return | ||
} | ||
|
||
return | ||
} |
Oops, something went wrong.