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

feat: ECS 1Password SCIM Bridge Guide #664

Merged
merged 12 commits into from
Sep 16, 2024
132 changes: 132 additions & 0 deletions docs/layers/ecs/tutorials/1password-scim-bridge.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
title: "Deploy 1Password SCIM Bridge"
sidebar_label: "1Password SCIM Bridge"
description: "Deploy the 1Password SCIM Bridge for ECS environments"
---

import Intro from "@site/src/components/Intro";
import Steps from "@site/src/components/Steps";
import Step from "@site/src/components/Step";
import StepNumber from "@site/src/components/StepNumber";
import CollapsibleText from "@site/src/components/CollapsibleText";

<Intro>
The 1Password SCIM Bridge is a service that allows you to automate the management of users and groups in 1Password. This guide will walk you through deploying the SCIM Bridge for ECS environments.
</Intro>

## Implementation

The implementation of this is fairly simple. We will generate credentials for the SCIM bridge in 1Password, store them in AWS SSM Parameter Store, and deploy the SCIM bridge ECS service.

<Steps>
<Step>
### <StepNumber/> Generate Credentials for your SCIM bridge in 1Password

The first step is to generate credentials for your SCIM bridge in 1Password. We will pass these credentials to Terraform and the ECS task definition to create the SCIM bridge.

<Steps>
1. Log in to your 1Password account
1. Click Integrations in the sidebar.
1. Choose your identity provider from the User Provisioning section.
1. Follow the onscreen instructions to generate credentials for your SCIM bridge.
1. Store the credentials in AWS SSM Parameter Store.

<Steps>
milldr marked this conversation as resolved.
Show resolved Hide resolved
- Open the AWS Web Console - Navigate to the target account, such as `plat-dev`, and target region, such as `us-west-2`
- Open "AWS System Manager" > "Parameter Store"
- Create 2 new Secure String parameters using the credentials you generated in the previous step:

```console
SCIM_USERNAME: "/1password/scim-bridge/username"
SCIM_PASSWORD: "/1password/scim-bridge/password"
```
</Steps>
</Steps>

</Step>

<Step>
### <StepNumber /> Deploy the SCIM bridge ECS Service

The next step is to deploy the SCIM bridge ECS service. We will use Terraform to create the necessary resources with our existing `ecs-service` component. Ensure you have the `ecs-service` component and `ecs` cluster before proceeding.

If you do not have ECS prerequisites, please see the [ECS layer](/layers/ecs) to create the necessary resources.

<Steps>
1. Create a new stack configuration for the SCIM bridge. The placement of this file will depend on your project structure. For example, you could create a new file such as `stacks/catalog/ecs-services/1password-scim-bridge.yaml` with the following content:

<CollapsibleText type="medium">
```yaml
import:
- catalog/terraform/services/defaults

components:
terraform:
1pass-scim:
metadata:
component: ecs-service
inherits:
- ecs-service/defaults
vars:
enabled: true
name: 1pass-scim
containers:
service:
name: op_scim_bridge
image: 1password/scim:v2.9.5
cpu: 128
memory: 512
essential: true
dependsOn:
- containerName: redis
condition: START
port_mappings:
- containerPort: 3002
hostPort: 3002
protocol: tcp
map_environment:
OP_REDIS_URL: redis://localhost:6379
OP_TLS_DOMAIN: ""
OP_CONFIRMATION_INTERVAL: "300"
map_secrets:
OP_SESSION: "/path/to/secret" # TODO "${secret_arn}"
milldr marked this conversation as resolved.
Show resolved Hide resolved
# OP_WORKSPACE_CREDENTIALS: ""
# OP_WORKSPACE_SETTINGS: ""
log_configuration:
logDriver: awslogs
options: {}
redis:
name: redis
image: redis:latest
cpu: 128
memory: 512
essential: true
restart: always
port_mappings:
- containerPort: 6379
hostPort: 6379
protocol: tcp
map_environment:
REDIS_ARGS: "--maxmemory 256mb --maxmemory-policy volatile-lru"
log_configuration:
logDriver: awslogs
options: {}
```
</CollapsibleText>
2. Confirm the `map_secrets` for `OP_WORKSPACE_CREDENTIALS` and `OP_WORKSPACE_SETTINGS` match the AWS SSM Parameter Store paths you created previously, and confirm they are in the same account and region as this ECS service component.
3. Deploy the ECS service with Atmos:
```bash
atmos terraform apply 1pass-scim -s plat-usw2-dev
```
</Steps>
</Step>

<Step>
### <StepNumber/> Validate the Integration

The final step is to validate the integration. Connect to the VPN (if deployed the ECS service is deployed with a private ALB), navigate to the SCIM bridge URL, and confirm the service is running.

For example, go to `https://1pass-scim.platform.usw1.dev.plat.acme-svc.com/`
milldr marked this conversation as resolved.
Show resolved Hide resolved
</Step>

</Steps>