Skip to content

✨ Include network policy for all configmap and grpc catalogsources #3568

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joelanford
Copy link
Member

Description of the change:

This change updates OLMv0 to generate and reconcile a NetworkPolicy object for each CatalogSource where OLMv0 also manages a catalog pod (i.e. configmap and grpc-based catalog sources).

Related implementation details:

  • Informer events from network policies are handled by the catalog operator, so any deletions or changes are reverted.
  • Each NetworkPolicy gets an owner reference so that it is automatically cleaned up when the catalog source is deleted.
  • Each NetworkPolicy uses a pod selector that specifically targets the catalog pod, so there should be no accidental blocking of traffic of unrelated pods.

Unit tests are updated to ensure that NetworkPolicy objects are handled correctly.

Motivation for the change:

The only necessary communication for catalog source pods is incoming connections on their GRPC ports. By adding NetworkPolicy, we can provide more security to mitigate vulnerabilities and avoid accidental data leaks.

Architectural changes:

None (unless you count managing NetworkPolicy for CatalogSources as an architectural change)

Testing remarks:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Bug fixes are accompanied by regression test(s)
  • e2e tests and flake fixes are accompanied evidence of flake testing, e.g. executing the test 100(0) times
  • tech debt/todo is accompanied by issue link(s) in comments in the surrounding code
  • Tests are comprehensible, e.g. Ginkgo DSL is being used appropriately
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive
  • Tests marked as [FLAKE] are truly flaky and have an issue
  • Code is properly formatted

@openshift-ci openshift-ci bot requested review from dinhxuanvu and oceanc80 April 30, 2025 20:22
@joelanford joelanford changed the title include network policy for all configmap and grpc catalogsources Include network policy for all configmap and grpc catalogsources Apr 30, 2025
@joelanford joelanford force-pushed the catalog-source-network-policy branch 2 times, most recently from 7e73286 to b8dbde0 Compare May 1, 2025 01:27
@joelanford joelanford changed the title Include network policy for all configmap and grpc catalogsources ✨ Include network policy for all configmap and grpc catalogsources May 1, 2025
@joelanford joelanford force-pushed the catalog-source-network-policy branch from b8dbde0 to 437b8cb Compare May 1, 2025 12:35
@joelanford joelanford force-pushed the catalog-source-network-policy branch from 437b8cb to b9ecf89 Compare May 1, 2025 14:24
Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

Looking good. A few comments.

Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

/approve

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.

2 participants