Cannot edit existing network policies without a policy management project

Summary

Trying to edit a security policy returns error "Project does not have a policy configuration" if there is not a security policy project associated.

Steps to reproduce

  1. Create a new project
  2. Go to Deployments -> Environments and create a new environment
  3. Go to Security & Compliance -> Policies
  4. Click on one of the two pre-defined policies and click "Edit Policy"
  5. "Project does not have a policy configuration" error appears

Video

Screen_Recording_2021-09-09_at_7.06.39_AM

Example Project

https://gitlab.com/bwill/policies-test

What is the current bug behavior?

An error appears.

What is the expected correct behavior?

You should be able to edit network policies even if you do not have a policy project, because they are not dependent on having one.

Possible fixes

Have the PolicyConfigurationValidationService skip the policy_configuration checks if the type is container_policy

Edited by Brian Williams