AWS Privatelink traffic filtersedit

Traffic filtering, to only AWS PrivateLink connections, is one of the security layers available in Elasticsearch Add-On for Heroku. It allows you to limit how your deployments can be accessed.

Read more about Traffic Filtering for the general concepts behind traffic filtering in Elasticsearch Add-On for Heroku.

Private link filtering is supported only for AWS regions. AWS does not support cross-region private link connections. Your private link endpoint needs to be in the same region as your target deployments. Additional details can be found in the AWS VPCE Documentation. AWS interface VPC endpoints get created in availability zones (AZ). In some regions, our VPC endpoint service is not present in all the possible AZs that a region offers. You can only choose AZs that are common on both sides. As the names of AZs (for example us-east-1a) differ between AWS accounts, the list of AWS regions below shows the ID (e.g. use1-az4) of each available AZ for the service. See interface endpoint availability zone considerations for more details.

Transport client is not supported over private link connections.

AWS PrivateLink establishes a secure connection between two AWS Virtual Private Clouds (VPCs). The VPCs can belong to separate accounts, i.e. a service provider and its service consumers. AWS routes the PrivateLink traffic within the AWS data center and never exposes it to the public internet. In such a configuration, Elastic Cloud is the third-party service provider and the customers are service consumers.

Private link is a connection between a VPC Endpoint and a PrivateLink Service.

PrivateLink service names and aliasesedit

PrivateLink Service is set up by Elastic in all supported AWS regions under the following service names:

AWS Public Regions

Region VPC Service Name Private hosted zone domain name AZ IDs

ap-east-1

com.amazonaws.vpce.ap-east-1.vpce-svc-0f96fbfaf55558d5c

vpce.ap-east-1.aws.elastic-cloud.com

ape1-az1, ape1-az2, ape1-az3

ap-northeast-1

com.amazonaws.vpce.ap-northeast-1.vpce-svc-0e1046d7b48d5cf5f

vpce.ap-northeast-1.aws.elastic-cloud.com

apne1-az1, apne1-az2, apne1-az4

ap-northeast-2

com.amazonaws.vpce.ap-northeast-2.vpce-svc-0d90cf62dae682b84

vpce.ap-northeast-2.aws.elastic-cloud.com

apne2-az1, apne2-az2, apne2-az3

ap-south-1

com.amazonaws.vpce.ap-south-1.vpce-svc-0e9c1ae5caa269d1b

vpce.ap-south-1.aws.elastic-cloud.com

aps1-az1, aps1-az2, aps1-az3

ap-southeast-1

com.amazonaws.vpce.ap-southeast-1.vpce-svc-0cbc6cb9bdb683a95

vpce.ap-southeast-1.aws.elastic-cloud.com

apse1-az1, apse1-az2, apse1-az

ap-southeast-2

com.amazonaws.vpce.ap-southeast-2.vpce-svc-0cde7432c1436ef13

vpce.ap-southeast-2.aws.elastic-cloud.com

apse2-az1, apse2-az2, apse2-az3

ca-central-1

com.amazonaws.vpce.ca-central-1.vpce-svc-0d3e69dd6dd336c28

vpce.ca-central-1.aws.elastic-cloud.com

cac1-az1, cac1-az2, cac1-az4

eu-central-1

com.amazonaws.vpce.eu-central-1.vpce-svc-081b2960e915a0861

vpce.eu-central-1.aws.elastic-cloud.com

euc1-az1, euc1-az2, euc1-az3

eu-west-1

com.amazonaws.vpce.eu-west-1.vpce-svc-01f2afe87944eb12b

vpce.eu-west-1.aws.elastic-cloud.com

euw1-az1, euw1-az2, euw1-az3

eu-west-2

com.amazonaws.vpce.eu-west-2.vpce-svc-0e42a2c194c97a1d0

vpce.eu-west-2.aws.elastic-cloud.com

euw2-az1, euw2-az2, euw2-az3

eu-west-3

com.amazonaws.vpce.eu-west-3.vpce-svc-0d6912d10db9693d1

vpce.eu-west-3.aws.elastic-cloud.com

euw3-az1, euw3-az2, euw3-az3

sa-east-1

com.amazonaws.vpce.sa-east-1.vpce-svc-0b2dbce7e04dae763

vpce.sa-east-1.aws.elastic-cloud.com

sae1-az1, sae1-az2, sae1-az3

us-east-1

com.amazonaws.vpce.us-east-1.vpce-svc-0e42e1e06ed010238

vpce.us-east-1.aws.elastic-cloud.com

use1-az2, use1-az4, use1-az6

us-east-2

com.amazonaws.vpce.us-east-2.vpce-svc-02d187d2849ffb478

vpce.us-east-2.aws.elastic-cloud.com

use2-az1, use2-az2, use2-az3

us-west-1

com.amazonaws.vpce.us-west-1.vpce-svc-00def4a16a26cb1b4

vpce.us-west-1.aws.elastic-cloud.com

usw1-az1, usw1-az3

us-west-2

com.amazonaws.vpce.us-west-2.vpce-svc-0e69febae1fb91870

vpce.us-west-2.aws.elastic-cloud.com

usw2-az1, usw2-az2, usw2-az3

GovCloud Regions

Region VPC Service Name Private hosted zone domain name

us-gov-east-1 (GovCloud)

com.amazonaws.vpce.us-gov-east-1.vpce-svc-0bba5ffa04f0cb26d

vpce.us-gov-east-1.aws.elastic-cloud.com

The process of setting up the PrivateLink connection to your clusters is split between AWS (e.g. by using AWS console) and Elastic Cloud UI. These are the high-level steps:

AWS console Elastic Cloud

1. Create a VPC endpoint using Elastic Cloud service name.

2. Create a DNS record pointing to the VPC endpoint.

3. Create a PrivateLink rule set with your VPC endpoint ID.

4. Associate the PrivateLink rule set with your deployments.

5. Interact with your deployments over PrivateLink.

Create your VPC endpoint and DNS entries in AWSedit

  1. Create a VPC endpoint in your VPC using the service name for your region.

    Follow the AWS instructions for details on creating a VPC interface endpoint to an endpoint service.

    Use the service name for your region.

    PrivateLink
  2. Create a DNS record.

    1. Create a Private hosted zone. Consult Private hosted zone domain name in Private Link service names and aliases for the name of the zone. For example, in us-east-1 use vpce.us-east-1.aws.elastic-cloud.com as the zone domain name. Don’t forget to associate the zone with your VPC.

      Private hosted zone example
    2. Then create a DNS CNAME alias pointing to the PrivateLink Endpoint. Add the record to a private DNS zone in your VPC. Use * as the record name, and the VPC endpoint DNS name as a value.

      Follow the AWS instructions for details on creating a CNAME record which points to your VPC endpoint DNS name.

      PrivateLink CNAME
  3. Test the connection.

    Find out the Elasticsearch cluster ID of your deployment. You can do that by clicking Copy cluster id link in the Cloud UI. It looks something like 9c794b7c08fa494b9990fa3f6f74c2f8.

    The Elasticsearch cluster ID is different from the deployment ID, custom alias endpoint, and Cloud ID values that feature prominently in the user console.

    To access your Elasticsearch cluster over PrivateLink, use the following URL structure:

    https://{elasticsearch_cluster_ID}.{private_hosted_zone_domain_name}:9243

    For example:

    https://9c794b7c08fa494b9990fa3f6f74c2f8.vpce.us-east-1.aws.elastic-cloud.com:9243

    You can test the AWS console part of the setup with a following curl (substitute the region and Elasticsearch ID with your cluster):

    $ curl -v https://9c794b7c08fa494b9990fa3f6f74c2f8.vpce.us-east-1.aws.elastic-cloud.com:9243
    ..
    * SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
    *      server certificate verification OK
    *      common name: *.vpce.elastic-cloud.com (matched)
    ..
    < HTTP/1.1 403 Forbidden
    {"ok":false,"message":"Forbidden"}

    The connection is established, and a valid certificate is presented to the client. The 403 Forbidden is expected, because you haven’t allowed the traffic over this PrivateLink connection yet.

Add the private link rules to your deploymentsedit

Follow these high-level steps to add private link rules to your deployments.

Finding your VPC endpoint IDedit

Having trouble finding your VPC endpoint ID? You can find it in the AWS console.

VPC Endpoint ID

Create rules with the VPC endpointedit

Once you know your VPC endpoint ID you can create a private link traffic filter rule set.

  1. Log in to the Elasticsearch Add-On for Heroku console.
  2. On the deployments page, select your deployment.
  3. Under the Features tab, open the Traffic filters page.
  4. Click Create filter.
  5. Select Private link endpoint.
  6. Create your rule set, providing a meaningful name and description.
  7. Select the region for the rule set.
  8. Enter you VPC endpoint ID.
  9. Select if this rule set should be automatically attached to new deployments.

    Each rule set is bound to a particular region and can be only assigned to deployments in the same region.

The next step is to associate the rule set with your deployments.

Associate a private link rule set with your deploymentedit

To associate a private link rule set with your deployment:

  1. Go to the deployment.
  2. On the Security page, under Traffic filters click Apply filter.
  3. Select the filter you want to apply and click Apply filter.

Access the deployment over a private linkedit

For traffic to connect with the deployment over a private link, the client making the request needs to be located within the VPC where you’ve created the VPC endpoint. You can also setup network traffic to flow through the originating VPC from somewhere else, such as another VPC or VPN from your corporate network. This assumes that the VPC endpoint and the DNS record are also available within that context. See your service provider documentation for setup instructions.

Use the alias you’ve set up as CNAME DNS record to access your deployment.

If your elasticsearch ID is 9c794b7c08fa494b9990fa3f6f74c2f8 and it is located in us-east-1 region you can access it under https://9c794b7c08fa494b9990fa3f6f74c2f8.us-east-1.aws.found.io:9243.

$ curl -u 'username:password'  -v https://9c794b7c08fa494b9990fa3f6f74c2f8.vpce.us-east-1.aws.elastic-cloud.com:9243
..
< HTTP/1.1 200 OK
..

Edit a private link connectionedit

You can edit a rule set name or to change the VPC endpoint ID.

  1. Log in to the Elasticsearch Add-On for Heroku console.
  2. On the deployments page, select your deployment.
  3. Under the Features tab, open the Traffic filters page.
  4. Find the rule set you want to edit.
  5. Click the Edit icon.

Delete a private link rule setedit

If you need to remove a rule set, you must first remove any associations with deployments.

To delete a rule set with all its rules:

  1. Remove any deployment associations.
  2. Under the Features tab, open the Traffic filters page.
  3. Find the rule set you want to edit.
  4. Click the Remove icon. The icon is inactive if there are deployments assigned to the rule set.

Remove a private link rule set association from your deploymentedit

To remove an association through the UI:

  1. Go to the deployment.
  2. On the Security page, under Traffic filters click Remove.