Skip to main content

Morio Settings: access

Optional The access settings are optional. Without them, Morio will fall back to the default policy.

The access settings control access control in Morio. Specifically, they allow you to configure an policy that controls who has access to what inside Morio.

info

The access settings only apply to HTTP-based access to Morio. Access to Morio’s Kafka API is always authenticated by .

access.[rule_id]

Optional The entire access key is optional, as are rules under it.

This creates an access policy rule with the given rule_id. Note that the order of rules is important.

access.[rule_id].then

Mandatory If you defined a rule, you must include the then action, and its value must be either allow or deny.

The then action holds the action to take when the rule matches. It holds a string that is one of:

  • allow: Allow access when the rule matches
  • deny: Deny access when the rule matches
access:
example:
when: # See below
then: allow

access.[rule_id].when

The when block in a rule holds conditions. The following conditions are supported:

FieldMatches AgainstTypeDescription
urlRequest URL pathString/Pattern/OperatorThe URL being accessed
methodHTTP methodString/Pattern/OperatorGET, POST, PUT, DELETE, etc.
roleUser’s roleString/Pattern/OperatorUser’s current role
userUsernameString/Pattern/OperatorThe authenticated username
providerAuth providerString/Pattern/OperatorAuthentication provider name
labelUser labelsString/Pattern/OperatorMatches if user has ANY matching label

access.[rule_id].when.[condition]

info

Refer to the Conditions below for details on how to write conditions in your rules.

Conditions

Valid values

method

Common HTTP methods (case-sensitive):

  • GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, CONNECT, TRACE

then

  • allow - Grant access
  • deny - Deny access

role

The various Morio roles:

  • user
  • manager
  • operator
  • engineer
  • root

provider

Depends on configured authentication providers:

  • local, apikey, mrt, myOidcProvider, etc.

label

Format: <provider-type>/<provider-name>/<attribute-type>/<attribute-value>

Examples:

  • oidc/sso/group/engineering
  • oidc/sso/email/user@example.com
  • ldap/corporate/ou/IT

url

Any URL path string. Examples:

  • /api/metrics
  • /api/logs/production/app.log
  • /health

Simple String Match

method: GET

Exact string comparison.

Pattern Object

Match using patterns with one of:

Pattern TypeSyntaxExampleDescription
isis: <string>is: GETExact match
is_notis_not: <string>is_not: guestDoes not match exactly
globglob: <pattern>glob: "/clients/*/details"Glob pattern
glob_notglob_not: <pattern>glob_not: "/clients/*/details"Does not match glob pattern
regexregex: <pattern>regex: "^/api/v[0-9]+"Regular expression
regex_notregex_not: <pattern>regex_not: "^/test"Does not match regex
note

Only one pattern type is allowed per object.

Logical Operators

Combine multiple conditions with operators:

OperatorLogicSyntaxDescription
orANY matchor: [<conditions>]Matches if ANY condition is true
andALL matchand: [<conditions>]Matches if ALL conditions are true
or_notNOT ANYor_not: [<conditions>]Does NOT match any condition
and_notNOT ALLand_not: [<conditions>]Does NOT match all conditions

Operators accept either:

  • An array of strings: or: [GET, POST]
  • An array of pattern objects: or: [{is: GET}, {is: POST}]
  • A single string: or: GET
  • A single pattern object: or: {is: GET}

Syntax Examples

Simple String Match

url: /api/metrics
method: GET
role: engineer

Pattern Match

url:
is: /api/metrics

url:
glob: "/api/metrics/*"

url:
regex: "^/api/(logs|metrics)"

Negation

role:
is_not: guest

url:
glob_not: "/admin/*"

label:
regex_not: "^restricted-"

OR Operator

method:
or:
- is: GET
- is: POST

url:
or:
- glob: "/api/logs/*"
- glob: "/api/metrics/*"
- is: /health

AND Operator

label:
and:
- is: "oidc/sso/group/engineering"
- is: "oidc/sso/status/active"

OR_NOT Operator

role:
or_not:
- is: admin
- is: root

AND_NOT Operator

label:
and_not:
- is: "oidc/sso/group/restricted"
- is: "oidc/sso/status/suspended"

Mixed Operators and Patterns

url:
or:
- is: /health
- glob: "/api/metrics/*"
- regex: "^/api/v[0-9]+/status$"

method:
or_not:
- is: DELETE
- is: PUT

Evaluation Rules

  1. Policies are evaluated in order (top-to-bottom)
  2. First match wins - evaluation stops at first matching policy
  3. Top-level conditions use AND - all specified when fields must match
  4. Omitted conditions match anything - only specify what you need to check
  5. Labels use array matching - user must have at least one matching label
  6. No match = fallback to RBAC - if no policy matches, role-based access control applies