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

⭐️ add policy subcommand #1033

Merged
merged 15 commits into from
Jan 12, 2024
Merged

⭐️ add policy subcommand #1033

merged 15 commits into from
Jan 12, 2024

Conversation

imilchev
Copy link
Member

@imilchev imilchev commented Jan 8, 2024

  • policy list
  • policy upload
  • policy delete
  • policy info
  • policy download
  • policy enable
  • policy disable
  • policy init
  • policy format
  • policy lint
  • policy upload

@imilchev imilchev mentioned this pull request Jan 8, 2024
11 tasks
@imilchev imilchev marked this pull request as ready for review January 9, 2024 16:00
@imilchev imilchev force-pushed the ivan/policy-subcommand branch 3 times, most recently from 6fb033e to a008be0 Compare January 9, 2024 18:53
@vjeffrey
Copy link
Contributor

looking nice!

Screenshot 2024-01-10 at 13 45 27

as a followup improvement, could we make the policy list pageable? the list can be pretty long

is there a way to list not-enabled policies? we have an enable command, but when i went to try it i couldn't find how i would know the mrn/uid of the policy i want to enable

how do u provide the output file for the download? i couldn't figure it out on cli (i mean, i know i can go look at the code now, but maybe we need something in the description to help or something?)

Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

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

Looks really good and works like a charm. Added a few smaller things that would make this PR even more awesome.

}
log.Info().Msg("completed formatting policy bundle(s)")
},
Run: runPolicyLint,
}

var policyPublishCmd = &cobra.Command{
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason why we are not using the implementation from policy upload here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I already had implemented a new one when I saw this. I just kept the new one, because I verified it works. No other reason

policy/scan/scan.pb.go Outdated Show resolved Hide resolved
upstream/gql.go Outdated Show resolved Hide resolved
apps/cnspec/cmd/policy.go Outdated Show resolved Hide resolved
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

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

Thank you @imilchev That is a great addition.

@chris-rock chris-rock merged commit 7e461b6 into main Jan 12, 2024
9 checks passed
@chris-rock chris-rock deleted the ivan/policy-subcommand branch January 12, 2024 16:00
@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants