> For the complete documentation index, see [llms.txt](https://docs.hardpoint.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hardpoint.dev/guides/hardpoint-enterprise/rules-reference.md). Agents can also search and read this documentation through its [MCP server](https://docs.hardpoint.dev/~gitbook/mcp).

# Rules Reference

#### Rule evaluation

Formally, for a tunnel to be established between an application and a service, given a request identity `I`, request context `C`, and a service named `S`, the following must hold true:

$$
(∃ rule ∈ ingressrules: eval(rule, I))
∧ (∃ selector ∈ S.selectors: eval(selector, C))
$$

***

#### Available rule variables

Your CEL expressions can evaluate the following variables, depending on your execution environment:

{% tabs %}
{% tab title="Vercel" %}

<table><thead><tr><th width="165.796875">Variable name</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>owner_id</code></td><td>The team ID</td><td><code>team_7Gw5ZMzpQA8h90F832KGp7nwbuh3</code></td></tr><tr><td><code>project_id</code></td><td>The project ID</td><td><code>prj_7Gw5ZMBpQA8h9GF832KGp7nwbuh3</code></td></tr><tr><td><code>owner</code></td><td>The team slug</td><td><code>acme</code></td></tr><tr><td><code>project</code></td><td>The project name</td><td><code>acme_website</code></td></tr><tr><td><code>environment</code></td><td>The environment: <code>development</code> or <code>preview</code> or <code>production</code></td><td><code>production</code></td></tr><tr><td><code>user_id</code></td><td>When environment is <code>development</code>, this is the ID of the user who was issued the token</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Fly.io" %}

<table><thead><tr><th width="150.75">Variable name</th><th width="263.00390625">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>app_name</code></td><td>Name of the Fly application</td><td><code>example-app</code></td></tr><tr><td><code>app_id</code></td><td>ID of the Fly application </td><td><code>11111111</code></td></tr><tr><td><code>machine_id</code></td><td>ID of the VM hosting this request</td><td><code>148e21ea7e46e8</code></td></tr><tr><td><code>image</code></td><td>Docker image of this VM</td><td><code>docker-hub-mirror.fly.io/you/image:latest</code></td></tr><tr><td><code>image_digest</code></td><td>Digest of the VM's Docker image</td><td><code>sha256:2c1cdaded1b3820020c9dc9fdd1d6...</code></td></tr><tr><td><code>machine_name</code></td><td>Name of the machine</td><td><code>example-machine</code></td></tr><tr><td><code>org_id</code></td><td>ID of the owning Fly org</td><td><code>12345678</code></td></tr><tr><td><code>org_name</code></td><td>Name of the owning Fly org</td><td><code>acme</code></td></tr><tr><td><code>region</code></td><td>Machine region</td><td><code>lhr</code></td></tr></tbody></table>
{% endtab %}

{% tab title="GitHub Actions" %}

| `actor`                 | The personal account that initiated the workflow run                                                                                                                                                                                                                                |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `event_name`            | The name of the event that triggered the workflow run                                                                                                                                                                                                                               |
| `job_workflow_ref`      | For jobs using a reusable workflow, the ref path to the reusable workflow. For more information, see [Using OpenID Connect with reusable workflows](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/using-openid-connect-with-reusable-workflows) |
| `ref`                   | *(Reference)* The git ref that triggered the workflow run                                                                                                                                                                                                                           |
| `ref_type`              | The type of `ref`, for example: "branch"                                                                                                                                                                                                                                            |
| `repository_visibility` | The visibility of the repository where the workflow is running. Accepts the following values: `internal`, `private`, or `public`                                                                                                                                                    |
| `repository`            | The repository from where the workflow is running                                                                                                                                                                                                                                   |
| `repository_owner`      | The name of the organization in which the `repository` is stored                                                                                                                                                                                                                    |
| `run_number`            | The number of times this workflow has been run                                                                                                                                                                                                                                      |
| `workflow`              | The name of the workflow                                                                                                                                                                                                                                                            |
| `sub`                   | Defines the subject claim that is to be validated by the cloud provider. This setting is essential for making sure that access tokens are only allocated in a predictable way                                                                                                       |
| `aud`                   | By default, this is the URL of the repository owner, such as the organization that owns the repository                                                                                                                                                                              |
| {% endtab %}            |                                                                                                                                                                                                                                                                                     |

{% tab title="Amazon EKS" %}

| Variable Name             | Description                                                                                           | Example                                                                        |
| ------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `iss`                     | OIDC issuer URL for the EKS cluster. AWS IAM validates that this matches the configured OIDC provider | `https://oidc.eks.us-east-1.amazonaws.com/id/EXAMPLED539D4633E53DE1B716D3041E` |
| `sub`                     | Kubernetes service account identity in canonical form. This is commonly used in IAM trust policies    | `system:serviceaccount:payments:api-server`                                    |
| `aud`                     | Intended audience of the token. For IRSA this is typically AWS STS                                    | `["sts.amazonaws.com"]`                                                        |
| `k8s_namespace`           | Namespace containing the service account                                                              | `payments`                                                                     |
| `k8s_serviceaccount_name` | Name of the Kubernetes service account                                                                | `api-server`                                                                   |
| `k8s_pod_name`            | Name of the pod that requested the token                                                              | `api-server-7cf6d8f5c9-2k9qj`                                                  |
| `k8s_pod_uid`             | UID of the pod that requested the token                                                               | `d0f7b7cf-4b2e-4b2a-91d0-4fcb4a2b9a61`                                         |
| `k8s_node_name`           | Node hosting the pod                                                                                  | `ip-10-0-42-17.ec2.internal`                                                   |
| {% endtab %}              |                                                                                                       |                                                                                |
| {% endtabs %}             |                                                                                                       |                                                                                |
