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

docs: namespace ACL permissions for exported services #22162

Merged
merged 2 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ To configure Consul to export services contained in a Consul Enterprise admin pa
You can configure the settings defined in the `exported-services` configuration entry to apply to all namespaces in a Consul Enterprise admin partition.

## Requirements

- **Enterprise Only**: A corresponding partition that the configuration entry can export from. For example, the `exported-services` configuration entry for a partition named `frontend` requires an existing `frontend` partition.

## Usage
Expand Down Expand Up @@ -767,14 +768,37 @@ spec:
}
]
}
]
]S
}
```

</CodeTabs>
</Tab>
</Tabs>

If you experience errors using the wildcard to export services on Consul on Kubernetes, make sure the [service token](/consul/docs/security/acl/tokens/create/create-a-service-token) is attached to a policy that grants read access to all namespaces:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you experience errors using the wildcard to export services on Consul on Kubernetes, make sure the [service token](/consul/docs/security/acl/tokens/create/create-a-service-token) is attached to a policy that grants read access to all namespaces:
If you experience errors using the wildcard to export services on Consul on Kubernetes, make sure the [service token](/consul/docs/security/acl/tokens/create/create-a-service-token) is attached to a policy that grants read access to all namespaces as in this example.


```hcl
partition "default" {
namespace "default" {
query_prefix "" {
policy = "read"
}
}
}

partition_prefix "" {
namespace_prefix "" {S
node_prefix "" {
policy = "read"
}
service_prefix "" {
policy = "read"
}
}
}
```

## Reading Services

When an exported service has been imported to another cluster, you can use the `health` REST API endpoint to query the service on the consumer cluster.
Expand Down
29 changes: 27 additions & 2 deletions website/content/docs/connect/dataplane/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ This topic provides an overview of Consul Dataplane, a lightweight process for m
- Dataplanes on Kubernetes requires Consul K8s v1.0.0 and newer.
- Dataplanes on AWS Elastic Container Services (ECS) requires Consul ECS v0.7.0 and newer.


## What is Consul Dataplane?

When deployed to virtual machines or bare metal environments, the Consul control plane requires _server agents_ and _client agents_. Server agents maintain the service catalog and service mesh, including its security and consistency, while client agents manage communications between service instances, their sidecar proxies, and the servers. While this model is optimal for applications deployed on virtual machines or bare metal servers, orchestrators such as Kubernetes and ECS have native components that support health checking and service location functions typically provided by the client agent.
Expand Down Expand Up @@ -58,7 +57,6 @@ To get started with Consul Dataplane, use the following reference resources:
- For Envoy, Consul, and Consul Dataplane version compatibility, refer to the [Envoy compatibility matrix](/consul/docs/connect/proxies/envoy).
- For Consul on ECS workloads, refer to [Consul on AWS Elastic Container Service (ECS) Overview](/consul/docs/ecs).


### Installation

<Tabs>
Expand Down Expand Up @@ -93,6 +91,32 @@ Refer to the following documentation for Consul on ECS workloads:

</Tabs>

### Namespace ACL permissions

If ACLs are enabled, exported services between partitions that use dataplanes may experience errors when you define namespace partitions with the `*` wildcard. Consul dataplanes use a token with the `builtin/service` policy attached, but this policy does not include access to all namespaces.

Add the following policies to the service token attached to Consul dataplanes to grant Consul access to exported services across all namespaces:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Add the following policies to the service token attached to Consul dataplanes to grant Consul access to exported services across all namespaces:
Add these policies to the service token attached to Consul dataplanes to grant Consul access to exported services across all namespaces.

Kind of a grey area... but I applied the "introduce code block... descriptive sentence that ends with a period" rule


```hcl
partition "default" {
namespace "default" {
query_prefix "" {
policy = "read"
}
}
}

partition_prefix "" {
namespace_prefix "" {
node_prefix "" {
policy = "read"
}
service_prefix "" {
policy = "read"
}
}
}
```

### Upgrading

Expand Down Expand Up @@ -136,3 +160,4 @@ Consul Dataplane on ECS support the following features:

- Consul Dataplane is not supported on Windows.
- Consul Dataplane requires the `NET_BIND_SERVICE` capability. Refer to [Set capabilities for a Container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-capabilities-for-a-container) in the Kubernetes Documentation for more information.
- When ACLs are enabled, dataplanes use the [service token](/consul/docs/security/acl/tokens/create/create-a-service-token) and the `builtin/service` policy for their default permissions.
Loading