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

Show recommended policy for new deployments #652

Merged
merged 1 commit into from
Jan 18, 2023
Merged

Show recommended policy for new deployments #652

merged 1 commit into from
Jan 18, 2023

Conversation

vishnusomank
Copy link
Contributor

  • added deployment watcher to generate recommended policies when a new deployment is added

Signed-off-by: Vishnu Soman vishnu@accuknox.com

- added deployment watcher to generate recommended policies when a new deployment is added

Signed-off-by: Vishnu Soman <vishnu@accuknox.com>
@seswarrajan seswarrajan requested a review from nyrahul January 18, 2023 13:29
@nyrahul nyrahul merged commit 9b495bf into accuknox:dev Jan 18, 2023
Copy link
Contributor

@seswarrajan seswarrajan left a comment

Choose a reason for hiding this comment

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

Please check how much CPU/mem is utilised since we are using a watcher .

@@ -92,6 +92,7 @@ func (pc *PolicyStore) Publish(policy *types.PolicyYaml) {

for consumer := range pc.Consumers {
if matchPolicyYaml(policy, consumer) {
log.Info().Msgf("Publishing policy %v", policy.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this message necessary ?
The purpose of this message is for debug ?

}
if !found {
log.Info().Msgf("Found Deployment %v in %v namespace", event.Object.(*v1.Deployment).Name, event.Object.(*v1.Deployment).Namespace)
generateHardenPolicy(event.Object.(*v1.Deployment).Name, event.Object.(*v1.Deployment).Namespace, event.Object.(*v1.Deployment).Spec.Template.Labels)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we extracting recommended policies based only on deployment name & labels
What if the same contains multiple containers ?? We are not getting recommended policies for containers ?

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