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

Design doc for private bicep registries #53

Conversation

vishwahiremat
Copy link
Contributor

No description provided.

Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Copy link
Contributor

@rynowak rynowak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vishwahiremat - looks like this is off to a good start.

recipe/2024-06-private-bicep-registries.md Outdated Show resolved Hide resolved
recipe/2024-06-private-bicep-registries.md Outdated Show resolved Hide resolved
recipe/2024-06-private-bicep-registries.md Outdated Show resolved Hide resolved

## Design
### Design details
Currently, OCI-compliant registries are used to store Bicep recipes, with the ORAS client facilitating operations like publish and pull these recipes from the registries. ORAS provides package auth, enabling secure client authentication to remote registries. Private Registry credentials information i.e username and password must be stored in a Application.Core/secretStores resource and the secret resource ID is added to the recipe configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Currently, OCI-compliant registries are used to store Bicep recipes, with the ORAS client facilitating operations like publish and pull these recipes from the registries. ORAS provides package auth, enabling secure client authentication to remote registries. Private Registry credentials information i.e username and password must be stored in a Application.Core/secretStores resource and the secret resource ID is added to the recipe configuration.
Currently, OCI-compliant registries are used to store Bicep recipes, with the ORAS client facilitating operations like publish and pull these recipes from the registries. ORAS provides package auth, enabling secure client authentication to remote registries. Private Registry credentials information i.e username and password must be stored in an `Application.Core/secretStores` resource and the secret resource ID is added to the recipe configuration.

recipe/2024-06-private-bicep-registries.md Outdated Show resolved Hide resolved
recipe/2024-06-private-bicep-registries.md Show resolved Hide resolved
recipe/2024-06-private-bicep-registries.md Outdated Show resolved Hide resolved
### Error Handling
<!--
Describe the error scenarios that may occur and the corresponding recovery/error handling and user experience.
-->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an important section for a feature like this. Any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this section

- Deploy the recipe as part of the functional test using github app token to authenticate ghcr.

## Security
With this design we enable username-password based authentication for OCI compliant registries, we let the users manage secrets. For secret rotation users need to re deploy the Applications.Core/secretStore resource with updated credentials.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
With this design we enable username-password based authentication for OCI compliant registries, we let the users manage secrets. For secret rotation users need to re deploy the Applications.Core/secretStore resource with updated credentials.
With this design we enable username-password based authentication for OCI compliant registries, we let the users manage secrets. For secret rotation users need to re deploy the `Applications.Core/secretStores` resource with updated credentials.

recipe/2024-06-private-bicep-registries.md Show resolved Hide resolved
@rynowak
Copy link
Contributor

rynowak commented Jun 25, 2024

/cc @ytimocin

Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Comment on lines 162 to 175
- Retrieve the Azure Active Directory (AAD) token for the client ID configured with Azure Federated Identity.
- Get refresh token from ACR by exchanging for the above AAD access token
```
formData := url.Values{
"grant_type": {"access_token"},
"service": <acr-url>,
"tenant": <tenant-id>,
"access_token": <aad-token>,
}

// jsonResponse contains the refresh token from ACR.
jsonResponse, err := http.PostForm("https://<acr-url>/oauth2/exchange", formData)
```
- Use `RefreshToken` in ORAS auth client to authenticate private ACR.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which component will be responsible for these steps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed in the meeting, Driver(ReadFromRegistry) will be responsible for getting the AAD and acr refresh tokens and creating ORAS auth client.

Copy link
Contributor

@kachawla kachawla Jul 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please update the doc to make it explicit and the architecture diagram to reflect this call flow?

@github-actions github-actions bot removed the Stale label Aug 16, 2024
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Copy link

github-actions bot commented Sep 4, 2024

This pull request is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 4, 2024
Copy link

This pull request has been closed due to inactivity. Feel free to reopen if you are still working on it.

@github-actions github-actions bot closed this Sep 12, 2024
@ytimocin ytimocin reopened this Sep 14, 2024
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
@ytimocin ytimocin force-pushed the vishwahiremat/private-bicep-registry branch from e1efb0b to 34bd19d Compare September 14, 2024 00:41
@github-actions github-actions bot removed the Stale label Sep 15, 2024
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
@lakshmimsft lakshmimsft merged commit 0683ae3 into radius-project:main Sep 18, 2024
2 checks passed
Reshrahim pushed a commit to Reshrahim/design-notes that referenced this pull request Sep 20, 2024
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Reshma Abdul Rahim <reshmarahim.abdul@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants