|
1 | 1 | # stac-server
|
2 | 2 |
|
3 |
| - |
| 3 | + |
4 | 4 |
|
5 | 5 | - [stac-server](#stac-server)
|
6 | 6 | - [Overview](#overview)
|
|
9 | 9 | - [0.4.x -\> 0.5.x](#04x---05x)
|
10 | 10 | - [Elasticsearch to OpenSearch Migration](#elasticsearch-to-opensearch-migration)
|
11 | 11 | - [Preferred Elasticsearch to OpenSearch Migration Process](#preferred-elasticsearch-to-opensearch-migration-process)
|
| 12 | + - [Granting Access for Thumbnails](#granting-access-for-thumbnails) |
12 | 13 | - [0.3.x -\> 0.4.x](#03x---04x)
|
13 | 14 | - [Elasticsearch upgrade from 7.9 to 7.10](#elasticsearch-upgrade-from-79-to-710)
|
14 | 15 | - [Disable automatic index creation](#disable-automatic-index-creation)
|
|
20 | 21 | - [Create collection index](#create-collection-index)
|
21 | 22 | - [Enable OpenSearch fine-grained access control](#enable-opensearch-fine-grained-access-control)
|
22 | 23 | - [Configure OpenSearch for fine-grained access control](#configure-opensearch-for-fine-grained-access-control)
|
23 |
| - - [Option 1 - API method:](#option-1---api-method) |
24 |
| - - [Option 2 - Dashboard method:](#option-2---dashboard-method) |
| 24 | + - [Option 1 - API method](#option-1---api-method) |
| 25 | + - [Option 2 - Dashboard method](#option-2---dashboard-method) |
25 | 26 | - [Populating and accessing credentials](#populating-and-accessing-credentials)
|
26 | 27 | - [Proxying Stac-server through CloudFront](#proxying-stac-server-through-cloudfront)
|
27 | 28 | - [Locking down transaction endpoints](#locking-down-transaction-endpoints)
|
@@ -243,6 +244,19 @@ Switch the DNS entry for the domain name to the API Gateway endpoint for the new
|
243 | 244 |
|
244 | 245 | Double-check that the `DeletionPolicy: Retain` is set on the old Stack for the Elasticsearch/OpenSearch resource, and then delete the old Stack.
|
245 | 246 |
|
| 247 | +#### Granting Access for Thumbnails |
| 248 | + |
| 249 | +The new experimental endpoint `/collections/{c_id}/items/{item_id}/thumbnail` will |
| 250 | +redirect to a URL providing a thumbnail as determined by the assets in an item. If the |
| 251 | +href for this is an AWS S3 ARN, IAM permissions must be granted for the API Lambda to |
| 252 | +generate a pre-signed HTTP URL instead. For example: |
| 253 | + |
| 254 | +```yaml |
| 255 | +- Effect: Allow |
| 256 | + Action: s3:GetObject |
| 257 | + Resource: 'arn:aws:s3:::usgs-landsat/*' |
| 258 | +``` |
| 259 | +
|
246 | 260 | ### 0.3.x -> 0.4.x
|
247 | 261 |
|
248 | 262 | Create a new deployment, copy the elasticsearch database, and rename indexes.
|
@@ -401,7 +415,6 @@ There are some settings that should be reviewed and updated as needeed in the se
|
401 | 415 | | OPENSEARCH_CREDENTIALS_SECRET_ID | The AWS Secrets Manager secret to retrieve the username and password from, to authenticate to OpenSearch with if fine-grained access control is enabled. | |
|
402 | 416 | | COLLECTION_TO_INDEX_MAPPINGS | A JSON object representing collection id to index name mappings if they do not have the same names. | |
|
403 | 417 |
|
404 |
| - |
405 | 418 | | ITEMS_INDICIES_NUM_OF_SHARDS | Configure the number of shards for the indices that contain Items. | none |
|
406 | 419 | | ITEMS_INDICIES_NUM_OF_REPLICAS | Configure the number of replicas for the indices that contain Items. | none |
|
407 | 420 |
|
@@ -553,7 +566,7 @@ Redeploy the stack, and this will be updated without re-creating the cluster.
|
553 | 566 | The next step is to create the OpenSearch user and role to use for stac-server. This can
|
554 | 567 | either be done through the OpenSearch API or Dashboard.
|
555 | 568 |
|
556 |
| -##### Option 1 - API method: |
| 569 | +##### Option 1 - API method |
557 | 570 |
|
558 | 571 | This assumes the master username is `admin` and creats a user with the name `stac_server`.
|
559 | 572 |
|
@@ -617,7 +630,7 @@ curl -X "PUT" "${HOST}/_plugins/_security/api/rolesmapping/stac_server_role" \
|
617 | 630 | }'
|
618 | 631 | ```
|
619 | 632 |
|
620 |
| -##### Option 2 - Dashboard method: |
| 633 | +##### Option 2 - Dashboard method |
621 | 634 |
|
622 | 635 | Login to the OpenSearch Dashboard with the master username (e.g. `admin`) and password.
|
623 | 636 | From the left sidebar menu, select "Security". Select "Internal users", and then "Create
|
@@ -726,7 +739,8 @@ def lambda_handler(event, context):
|
726 | 739 |
|
727 | 740 | ### Locking down transaction endpoints
|
728 | 741 |
|
729 |
| -If you wanted to deploy STAC Server in a way which ensures certain endpoints have restricted access but others don't, you can deploy it into a VPC and add conditions that allow only certain IP addresses to access certain endpoints. Once you deploy STAC Server into a VPC, you can modify the Resource Policy of the API Gateway endpoint that gets deployed to restrict access to certain endpoints. Here is a hypothetical example. Assume that the account into which STAC Server is deployed is numbered 1234-5678-9123, the API ID is ab1c23def, and the region in which it is deployed is us-west-2. You might want to give the general public access to use any GET or POST endpoints with the API such as the "/search" endpoint, but lock down access to the transaction endpoints (see https://github.com/radiantearth/stac-api-spec/tree/master/ogcapi-features/extensions/transaction) to only allow certain IP addresses to access them. These IP addresses can be, for example: 94.61.192.106, 204.176.50.129, and 11.27.65.78. In order to do this, you can impose a condition on the API Gateway that only allows API transactions such as adding, updating, and deleting STAC items from the whitelisted endpoints. For example, here is a Resource Policy containing two statements that allow this to happen: |
| 742 | +If you wanted to deploy STAC Server in a way which ensures certain endpoints have restricted access but others don't, you can deploy it into a VPC and add conditions that allow only certain IP addresses to access certain endpoints. Once you deploy STAC Server into a VPC, you can modify the Resource Policy of the API Gateway endpoint that gets deployed to restrict access to certain endpoints. Here is a hypothetical example. Assume that the account into which STAC Server is deployed is numbered 1234-5678-9123, the API ID is ab1c23def, and the region in which it is deployed is us-west-2. You might want to give the general public access to use any GET or POST endpoints with the API such as the "/search" endpoint, but lock down access to the transaction endpoints (see <https://github.com/radiantearth/stac-api-spec/tree/master/ogcapi-features/extensions/transaction>) to only allow certain IP addresses to access them. These IP addresses can be, for example: 94.61.192.106, 204.176.50.129, and 11.27.65.78. In order to do this, you can impose a condition on the API Gateway that only allows API transactions such as adding, updating, and deleting STAC items from the whitelisted endpoints. For example, here is a Resource Policy containing two statements that allow this to happen: |
| 743 | + |
730 | 744 | ```
|
731 | 745 | {
|
732 | 746 | "Version": "2012-10-17",
|
|
0 commit comments