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

Rule: data-could-be-data #863

Open
anderseknert opened this issue Jun 21, 2024 · 1 comment
Open

Rule: data-could-be-data #863

anderseknert opened this issue Jun 21, 2024 · 1 comment

Comments

@anderseknert
Copy link
Member

Rule name subject to change :) But it's pretty common to encounter policies where large or even huge collections are defined inside a policy rather than it being provided as data. One example I encountered today is this.

There's obviously nothing wrong with that, but I think it's fair to say that separating policy from data is a good practice, and it would be good if Regal suggested moving definitions of static collection over a certain size from policy and to JSON files.

Not sure about category for this one, but either style or idiomatic, I think?

One possible caveat — if the data truly is huge, moving it to data may come with a performance penalty, as there are some known issues in OPA wrt large collections and OPA's data store. There's work in progress, or at least planned, to address that, so it could be that this won't be an issue when we get to this. Still something to keep in mind (and measure) as we don't want to recommend something that severly degrades performance.

@anderseknert
Copy link
Member Author

Thinking more about this, it's quite hard to say which one to use as a general rule. Changing the category to custom to make this optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: TODO
Development

No branches or pull requests

1 participant