Skip to content

Commit 7ad199f

Browse files
update identify providers permission only admin (#927)
1 parent ca31aa1 commit 7ad199f

File tree

2 files changed

+144
-0
lines changed

2 files changed

+144
-0
lines changed

mintlify/administration/roles.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ By default, the first registered user is granted the `Admin` role, all following
9696
| Change any user's role | | | ✔️ |
9797
| De-activate/re-activate user | | | ✔️ |
9898
| Change any user's name and password | | | ✔️ |
99+
| Manage identity providers (SSO) | | | ✔️ |
99100
| Add environment | | ✔️ | ✔️ |
100101
| View all environments | ✔️ | ✔️ | ✔️ |
101102
| Edit environment | | ✔️ | ✔️ |

mintlify/get-started/connect/aws.mdx

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,149 @@ References: [MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Using
119119

120120
Bytebase automatically handles token generation and refresh using the EC2 instance profile.
121121

122+
## Cross-Account IAM Authentication
123+
124+
<Info>
125+
Available in Bytebase version 3.11.1 and later
126+
</Info>
127+
128+
Connect to RDS databases in different AWS accounts using IAM role assumption. This allows Bytebase running in Account A to authenticate to databases in Accounts B, C, D, etc.
129+
130+
### Prerequisites
131+
132+
- Bytebase running with an IAM role (EC2 instance profile or ECS task role)
133+
- Target RDS instances have IAM authentication enabled
134+
- Cross-account trust relationships configured
135+
136+
### Step 1: Create Target Account Role
137+
138+
In each target AWS account (where databases reside):
139+
140+
1. Go to [IAM Console → Roles](https://console.aws.amazon.com/iam/home#/roles)
141+
2. Click **Create role**
142+
3. Select trusted entity: **Another AWS account**
143+
4. Enter the source account ID (where Bytebase runs)
144+
5. Attach this policy for RDS access:
145+
146+
```json
147+
{
148+
"Version": "2012-10-17",
149+
"Statement": [
150+
{
151+
"Effect": "Allow",
152+
"Action": "rds-db:connect",
153+
"Resource": "arn:aws:rds-db:REGION:ACCOUNT_ID:dbuser:DB_RESOURCE_ID/bytebase"
154+
}
155+
]
156+
}
157+
```
158+
159+
6. Name the role (e.g., `bytebase-cross-account-rds`)
160+
7. Note the role ARN: `arn:aws:iam::TARGET_ACCOUNT:role/bytebase-cross-account-rds`
161+
162+
### Step 2: Grant AssumeRole Permission
163+
164+
In the source account (where Bytebase runs), add this policy to your Bytebase IAM role:
165+
166+
```json
167+
{
168+
"Version": "2012-10-17",
169+
"Statement": [
170+
{
171+
"Effect": "Allow",
172+
"Action": "sts:AssumeRole",
173+
"Resource": [
174+
"arn:aws:iam::ACCOUNT_B:role/bytebase-cross-account-rds",
175+
"arn:aws:iam::ACCOUNT_C:role/bytebase-cross-account-rds",
176+
"arn:aws:iam::ACCOUNT_D:role/bytebase-cross-account-rds"
177+
]
178+
}
179+
]
180+
}
181+
```
182+
183+
Replace `ACCOUNT_B`, `ACCOUNT_C`, `ACCOUNT_D` with your target account IDs.
184+
185+
### Step 3: Configure Cross-Account Connection
186+
187+
1. Click **New Instance** in Bytebase
188+
2. Configure connection:
189+
- **Host:** RDS endpoint in target account
190+
- **Port:** 3306 (MySQL) or 5432 (PostgreSQL)
191+
- **Username:** `bytebase`
192+
- **Authentication:** Select `AWS RDS IAM`
193+
- **AWS Assume Role ARN:** Enter the target account role ARN
194+
(e.g., `arn:aws:iam::TARGET_ACCOUNT:role/bytebase-cross-account-rds`)
195+
3. Test and save the connection
196+
197+
Bytebase will:
198+
1. Assume the role in the target account
199+
2. Use the assumed credentials to generate RDS IAM tokens
200+
3. Authenticate to the database using the token
201+
202+
### Example Setup
203+
204+
**Scenario:** Bytebase in Account A (123456789012) connecting to RDS in Account B (987654321098)
205+
206+
**Account B - Create role with trust relationship:**
207+
```json
208+
{
209+
"Version": "2012-10-17",
210+
"Statement": [
211+
{
212+
"Effect": "Allow",
213+
"Principal": {
214+
"AWS": "arn:aws:iam::123456789012:root"
215+
},
216+
"Action": "sts:AssumeRole",
217+
"Condition": {
218+
"StringEquals": {
219+
"sts:ExternalId": "optional-external-id"
220+
}
221+
}
222+
}
223+
]
224+
}
225+
```
226+
227+
**Account A - Allow Bytebase to assume the role:**
228+
```json
229+
{
230+
"Version": "2012-10-17",
231+
"Statement": [
232+
{
233+
"Effect": "Allow",
234+
"Action": "sts:AssumeRole",
235+
"Resource": "arn:aws:iam::987654321098:role/bytebase-cross-account-rds"
236+
}
237+
]
238+
}
239+
```
240+
241+
### Security Best Practices
242+
243+
1. **Use External IDs**: Add an external ID to the trust relationship for additional security
244+
2. **Limit Role Scope**: Grant only necessary RDS permissions in target accounts
245+
3. **Use Specific Resource ARNs**: Avoid wildcards in IAM policies when possible
246+
4. **Enable CloudTrail**: Monitor cross-account role assumptions
247+
5. **Regular Audits**: Review cross-account permissions periodically
248+
249+
### Troubleshooting Cross-Account Issues
250+
251+
**AssumeRole Access Denied:**
252+
- Verify trust relationship in target account role
253+
- Check source account has AssumeRole permission
254+
- Ensure role ARN is correct
255+
256+
**RDS Authentication Failed After AssumeRole:**
257+
- Verify target role has rds-db:connect permission
258+
- Check database user exists with IAM authentication enabled
259+
- Ensure RDS instance has IAM authentication enabled
260+
261+
**Token Expiration:**
262+
- Bytebase automatically refreshes tokens before expiration
263+
- Default session duration is 1 hour (configurable in role settings)
264+
122265
## AWS Secrets Manager
123266

124267
Store database passwords securely in AWS Secrets Manager instead of Bytebase.

0 commit comments

Comments
 (0)