Skip to content

Commit f5d29d2

Browse files
committed
add
1 parent f9c0d36 commit f5d29d2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/pentesting-cloud/azure-security/az-privilege-escalation/az-postgresql-privesc.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,19 @@ az postgres flexible-server create \
2626
--version <PostgreSQLVersion>
2727
```
2828

29-
For example, this permissions allow changing the PostgreSQL password, usefull of course in case that PostgreSQL authentication is enabled.
29+
For example, this permissions allow changing the PostgreSQL password, usefull of course in case that PostgreSQL authentication is enabled:
3030

3131
```bash
32+
# Using the CLI
3233
az postgres flexible-server update \
3334
--resource-group <resource_group_name> \
3435
--name <server_name> \
3536
--admin-password <password_to_update>
37+
38+
# Using the API
39+
az rest --method patch \
40+
--url "https://management.azure.com/subscriptions/<subscription>/resourceGroups/<res-group>/providers/Microsoft.DBforPostgreSQL/flexibleServers/<server-name>?api-version=2024-11-01-preview" \
41+
--body '{"properties": {"administratorLoginPassword": "<new-password>"}}
3642
```
3743
3844
Furthermore, with the permissions you can enable the assigned identity, and operate with the managed identity attached to the server. Here you can find all the extensions that Azure PostgreSQL flexible server supports [https://learn.microsoft.com/en-us/azure/cosmos-db/postgresql/reference-extensions](https://learn.microsoft.com/en-us/azure/cosmos-db/postgresql/reference-extensions). To be able to use these extensions some server parameters (azure.extensions) need to be changed. For example here with a managed identity that can access Azure Storage:

0 commit comments

Comments
 (0)