-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: Add systemcve cli cmd #177
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: ALTHAF <[email protected]>
Signed-off-by: ALTHAF <[email protected]>
ready for review |
harbor security-hub
harbor scanners
harbor scan-schedule |
For this PR I would suggest calling it harbor cve-allowlist list/add
|
Signed-off-by: ALTHAF <[email protected]>
Signed-off-by: ALTHAF <[email protected]>
Signed-off-by: ALTHAF <[email protected]>
Signed-off-by: ALTHAF <[email protected]>
pkg/api/systemcve_handler.go
Outdated
} | ||
var unixTimestamp int64 | ||
if opts.IsExpire { | ||
expiresAt, err := time.Parse("01/02/2006", opts.ExpireDate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ISO 8601 as default: with
YYYY-MM-DD
Signed-off-by: ALTHAF <[email protected]>
func CVEAllowlist() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "cve-allowlist", | ||
Short: "Manage system CVE allowlist", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short: "Manage system CVE allowlist",
Long: `Manage system level allowlist of CVE`,
The description is almost the same, maybe we can have a longer explanation.
} | ||
|
||
flags := cmd.Flags() | ||
flags.BoolVarP(&opts.IsExpire, "isexpire", "i", false, "Systemcve allowlist expire or not") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This text makes no sense: "Systemcve allowlist expire or not"
flags := cmd.Flags() | ||
flags.BoolVarP(&opts.IsExpire, "isexpire", "i", false, "Systemcve allowlist expire or not") | ||
flags.StringVarP(&opts.CveId, "cveid", "n", "", "CVE ids seperate with commas") | ||
flags.StringVarP(&opts.ExpireDate, "expiredate", "d", "", "If it expire,give Expiry date in the format MM/DD/YYYY") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This text makes little sense without deep context "If it expire,give Expiry date in the format MM/DD/YYYY"
Created systemcve command for updating and listing systemcve allowlist.
harbor systemcve update
harbor systemcve list