-
Notifications
You must be signed in to change notification settings - Fork 20
Miscelaneous config fixes & PPL rewording #2002
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
alexandreLamarre
wants to merge
7
commits into
main
Choose a base branch
from
misc-fixes-alex
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
adeb9de
fix invalid docker-compose yaml in fundamentals/core/build-routes
alexandreLamarre bea6f83
rework confusing build policy section
alexandreLamarre 1340516
add redirect for outdated data-storage-link
alexandreLamarre e2b14bd
fix: native ssh 'ssh_user_ca_key_file' config.yaml
alexandreLamarre df05f84
run lint
alexandreLamarre a11064a
update other PPL page
alexandreLamarre 6be08b1
update criterion definition & fix example policy
alexandreLamarre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,15 +66,39 @@ You can think of it as coded instructions to tell Pomerium how authorization dec | |
|
|
||
| ### How does PPL work? | ||
|
|
||
| PPL consists of **Rules**, **Actions**, **Logical Operators**, **Criteria**, and **Matchers**. | ||
| PPL is made up of **Rules**, **Actions**, **Logical Operators**, **Criteria**, and **Matchers**. | ||
|
|
||
| Below is a simple policy example in PPL format that allows access for the email [email protected]. The following sections will break down each of these components in more detail. | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| ```yaml | ||
| # PPL Example | ||
| policy: | ||
| # ────────── Rule ────────── | ||
alexandreLamarre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| allow: # Action (at least one must match) | ||
| and: # Logical Operator | ||
| - email: # Criterion | ||
| is: [email protected] # Matcher | ||
| ``` | ||
| <!-- prettier-ignore-end --> | ||
|
|
||
| #### Rules | ||
|
|
||
| A PPL document is either an object or an array of objects. The object represents a rule where the action is the key and the value is an object containing the logical operators. | ||
| A rule is the basic building block of a PPL policy. Each rule says what action to take (allow or deny) and under what conditions. | ||
|
|
||
| - The action (allow or deny) is the outcome if the conditions are met. | ||
| - The conditions are expressed using logical operators, criteria, and matchers. | ||
|
|
||
| A PPL document can contain: | ||
|
|
||
| - A single rule, or | ||
| - An array of rules (evaluated together). | ||
|
|
||
| #### Actions | ||
|
|
||
| Only two actions are supported: `allow` and `deny`. `deny` takes precedence over `allow`. More precisely: a user will have access to a route if **at least one** `allow` rule matches and **no** `deny` rules match. | ||
| Actions are one of the two values : `allow` or `deny`. `deny` always takes precedence over `allow`. | ||
|
|
||
| Users will have access to a route if **at least one** `allow` rule matches and **no** `deny` rules match. | ||
|
|
||
| #### Logical Operators | ||
|
|
||
|
|
@@ -89,7 +113,12 @@ There are four logical operators: | |
|
|
||
| #### Criteria | ||
|
|
||
| Criteria in PPL are represented as an object where the key is the name and optional sub-path of the criterion, and the value changes depending on which criterion is used. | ||
| In PPL, a criterion defines a specific condition to evaluate, such as a user’s email or device type. | ||
|
|
||
| - Each criterion is represented by an object with a single key/value pair, where the key is the criterion type. | ||
| - For some criteria the key accepts a sub-path, delimited by /. For example: claim/family_name. | ||
| - The format of the criterion value varies depending on the criterion type. | ||
| - Some criteria do not use their value. For example: `accept`, `reject`, and `authenticated_user`. In this case, the value can be anything. | ||
|
|
||
| #### Matchers | ||
|
|
||
|
|
@@ -113,11 +142,11 @@ Now that you've briefly covered PPL, let's jump into some simple examples: | |
| This example instructs Pomerium to only grant a user access if their email address is `[email protected]`. | ||
|
|
||
| ```yaml title="PPL rule" | ||
| policy: # Policy object starts here | ||
| allow: # At least one action | ||
| and: # Logical operator | ||
| - email: # Criterion | ||
| is: [email protected] # Value | ||
| policy: | ||
| allow: | ||
| and: | ||
| - email: | ||
| is: [email protected] | ||
| ``` | ||
|
|
||
| **Example 2**: Allow access based on the domain criterion | ||
|
|
@@ -191,7 +220,7 @@ policy: | |
| allow: | ||
| and: | ||
| - domain: | ||
| is: example.com | ||
| is: example.com | ||
| ``` | ||
|
|
||
| Now, access the route. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,10 +59,10 @@ routes: | |
| - email: | ||
| is: [email protected] | ||
| pass_identity_headers: true | ||
| # Add Grafana route here: | ||
| - from: https://grafana.localhost.pomerium.io | ||
| to: http://grafana:3000 | ||
| allow_any_authenticated_user: true | ||
| # Add Grafana route here: | ||
| - from: https://grafana.localhost.pomerium.io | ||
| to: http://grafana:3000 | ||
| allow_any_authenticated_user: true | ||
| ``` | ||
|
|
||
| In your `docker-compose.yaml` file, add Grafana as a service: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,11 +53,21 @@ It will deny access to users with a `[email protected]` **or** `[email protected] | |
|
|
||
| ## Rules | ||
|
|
||
| A PPL document is either an object or an array of objects. The object represents a rule where the action is the key and the value is an object containing the logical operators. | ||
| A rule is the basic building block of a PPL policy. Each rule says what action to take (allow or deny) and under what conditions. | ||
|
|
||
| - The action (allow or deny) is the outcome if the conditions are met. | ||
| - The conditions are expressed using logical operators, criteria, and matchers. | ||
|
|
||
| A PPL document can contain: | ||
|
|
||
| - A single rule, or | ||
| - An array of rules (evaluated together). | ||
|
|
||
| ## Actions | ||
|
|
||
| Only two actions are supported: `allow` and `deny`. `deny` takes precedence over `allow`. More precisely: a user will have access to a route if **at least one** `allow` rule matches and **no** `deny` rules match. | ||
| Actions are one of the two values : `allow` or `deny`. `deny` always takes precedence over `allow`. | ||
|
|
||
| Users will have access to a route if **at least one** `allow` rule matches and **no** `deny` rules match. | ||
|
|
||
| ## Logical Operators | ||
|
|
||
|
|
@@ -123,7 +133,12 @@ Although these policies are equally effective, we recommend using just one opera | |
|
|
||
| ## Criteria | ||
|
|
||
| Criteria in PPL are represented as an object where the key is the name and optional sub-path of the criterion, and the value changes depending on which criterion is used. A sub-path is indicated with a `/` in the name: | ||
| In PPL, a criterion defines a specific condition to evaluate, such as a user’s email or device type. | ||
|
|
||
| - Each criterion is represented by an object with a single key/value pair, where the key is the criterion type. | ||
| - For some criteria the key accepts a sub-path, delimited by /. For example: claim/family_name. | ||
| - The format of the criterion value varies depending on the criterion type. | ||
| - Some criteria do not use their value. For example: `accept`, `reject`, and `authenticated_user`. In this case, the value can be anything. | ||
|
|
||
| ```yaml | ||
| allow: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.