consul/website/content/commands/intention/match.mdx

59 lines
1.9 KiB
Plaintext
Raw Normal View History

---
layout: commands
2020-04-07 18:55:19 +00:00
page_title: 'Commands: Intention Match'
description: >-
The `consul intention match` command returns inbound and outbound service intentions for a specific service.
---
# Consul Intention Match
Command: `consul intention match`
Corresponding HTTP API Endpoint: [\[GET\] /v1/connect/intentions/match](/consul/api-docs/connect/intentions#list-matching-intentions)
The `intention match` command shows the list of intentions that match
a given source or destination. The list of intentions is listed in evaluation
order: the first intention that matches a request would be evaluated.
The [check](/consul/commands/intention/check) command can be used to
check whether an L4 connection would be authorized between any two services.
The table below shows this command's [required ACLs](/consul/api-docs/api-structure#authentication). Configuration of
[blocking queries](/consul/api-docs/features/blocking) and [agent caching](/consul/api-docs/features/caching)
are not supported from commands, but may be from the corresponding HTTP endpoint.
| ACL Required |
| ----------------------------- |
Backport of Docs/intentions refactor docs day 2022 into release/1.15.x (#16775) * backport of commit 945c13236db5b8d746116ace4468bc66e7a04af2 * backport of commit 4034c6f753a5023fdaacd28b67f86ffb52dc1206 * backport of commit 8c06a1883e2023a3e68ec10e2edd83b684acc9c0 * backport of commit 35757aa1f602018379dbc5fbf1e4c5ccfbce0624 * backport of commit 1204b419ac7d4a46d6ac4cad976d6992c46d3121 * Docs/intentions refactor docs day 2022 (#16758) * converted intentions conf entry to ref CT format * set up intentions nav * add page for intentions usage * final intentions usage page * final intentions overview page * fixed old relative links * updated diagram for overview * updated links to intentions content * fixed typo in updated links * rename intentions overview page file to index * rollback link updates to intentions overview * fixed nav * Updated custom HTML in API and CLI pages to MD * applied suggestions from review to index page * moved conf examples from usage to conf ref * missed custom HTML section * applied additional feedback * Apply suggestions from code review Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com> * updated headings in usage page * renamed files and udpated nav * updated links to new file names * added redirects and final tweaks * typo --------- Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com> * remove old files --------- Co-authored-by: trujillo-adam <ajosetru@gmail.com> Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
2023-03-24 23:15:54 +00:00
| `intentions:read`<p> Define intention rules in the `service` policy. Refer to [ACL requirements for intentions](/consul/docs/connect/intentions/create-manage-intentions#acl-requirements) for additional information.</p> |
## Usage
Usage: `consul intention match [options] SRC_OR_DST`
`SRC` and `DST` can both take [several forms](/consul/commands/intention#source-and-destination-naming).
#### Command Options
- `-destination` - Match by destination.
- `-source` - Match by source.
#### Enterprise Options
@include 'http_api_partition_options.mdx'
@include 'http_api_namespace_options.mdx'
#### API Options
@include 'http_api_options_client.mdx'
## Examples
2020-05-19 18:32:38 +00:00
```shell-session
$ consul intention match -source web
web => db (deny)
web => api (2 permissions)
web => * (allow)
```