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

Utilize OPA/rego for rules #82

Open
nstogner opened this issue Dec 4, 2019 · 8 comments
Open

Utilize OPA/rego for rules #82

nstogner opened this issue Dec 4, 2019 · 8 comments

Comments

@nstogner
Copy link

nstogner commented Dec 4, 2019

Seems like OPA/rego is becoming the de-facto policy language for Kubernetes. Gatekeeper seems to be gaining traction and there is talk of Pod Security Policies being deprecated in favor of something like Gatekeeper.

Redefining the kubesec rules in rego may better position the tool for the future.

@sublimino
Copy link
Member

Hi @nstogner! You are correct, and this is the direction of travel for Kubesec. We'll update progress in this ticket.

@alexppg
Copy link

alexppg commented Dec 30, 2019

If rego is used, in what ways would be different kubesec to OPA?

@sublimino
Copy link
Member

@alexppg KubeSec is risk-based, and so opinionated and scored. Rules can fail without denying the request, and many small rules can fail which may tip the risk score below the threshold and fail the request for some configuration. OPA could be used in this way with additional rego but more generally is used in PSP-esque manner.

@alexppg
Copy link

alexppg commented Jan 4, 2020

I see, thanks. It seems pretty cool, the risk based way is easier to adopt. And if both of them use the same language it would be easier to choose this with the option to migrate to OPA if you want to.
Thanks for your answer!

@yannh
Copy link

yannh commented May 10, 2020

👋 is there any work going on on this? OPA would be awesome, I was thinking of starting a repo, but wouldn't want to duplicate work :)

@sublimino
Copy link
Member

Nothing yet, we'd welcome a PR!

I believe the migration can happen incrementally, a single rule can be migrated to OPA and the test suite used to support a refactor.

The OPA rules should probably be externalised from the source in a dedicated directory for easy reuse.

Any thoughts on this @stefanprodan @06kellyjac @ipedrazas ?

@jpreese
Copy link

jpreese commented May 13, 2020

@sublimino @yannh I saw your conversation, and just wanted to chime in that there has been some effort in this space: https://github.com/instrumenta/policies/blob/master/kubernetes/security.rego

There hasn't been a whole lot of activity on that repository, so I don't think it's firmly decided that's where they should live. Wanted to start the discussion regardless :)

@yannh
Copy link

yannh commented May 13, 2020

Thanks @jpreese this is exactly what I was looking for :)

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

No branches or pull requests

5 participants