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

Pomerium Policy Language #2202

Merged
merged 3 commits into from
May 17, 2021
Merged

Pomerium Policy Language #2202

merged 3 commits into from
May 17, 2021

Conversation

calebdoxsey
Copy link
Contributor

Summary

Implement the Pomerium Policy Language. The Pomerium Policy Language is a DSL for constructing rego scripts. A subsequent PR will convert our existing policy into PPL and then into Rego.

Checklist

  • reference any related issues
  • updated docs
  • updated unit tests
  • updated UPGRADING.md
  • add appropriate tag (improvement / bug / etc)
  • ready for review

@calebdoxsey calebdoxsey requested a review from a team as a code owner May 14, 2021 19:42
@calebdoxsey calebdoxsey requested a review from wasaga May 14, 2021 19:42
@codeclimate
Copy link

codeclimate bot commented May 14, 2021

Code Climate has analyzed commit 42739f0 and detected 0 issues on this pull request.

View more on Code Climate.

package rules

import "github.com/open-policy-agent/opa/ast"

Copy link
Contributor

@wasaga wasaga May 17, 2021

Choose a reason for hiding this comment

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

given that any of this functions may panic, maybe a better approach would be to have those snippets in var section so that they'll all be evaluated on start.

var (
    Session = ast.MustParseRule(`
get_session(id) = v {
	v := get_databroker_record("type.googleapis.com/user.ServiceAccount", id)
} else = v {
	v := get_databroker_record("type.googleapis.com/session.Session", id)
} else = v {
	v := {}
}
`)
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We modify the rules sometimes, so this would result in inadvertent data sharing.

@calebdoxsey calebdoxsey merged commit e138054 into master May 17, 2021
@calebdoxsey calebdoxsey deleted the cdoxsey/407-ppl branch May 17, 2021 21:30
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.

None yet

2 participants