-
Notifications
You must be signed in to change notification settings - Fork 5.1k
feat: initial version of azure developer signing dataplane library #41191
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
Closed
Closed
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
fc555e9
feat: initial version of azure developer signing library
Jaxelr 60a33eb
feat: initial version of the Azure.Developer.Signing docs, tests & sa…
Jaxelr 06e3512
tests: added recorded client tests for developer signing ops
Jaxelr f2bdb14
fix: rename fixes and simplification of client invocation
Jaxelr b946f5b
docs: update README.md with samples and tests
Jaxelr 62eba02
docs: Update README.md with details
Jaxelr ce11c3d
fix: review feedback fixes
Jaxelr 39d2237
fix: review feedback fixes
Jaxelr 59f5840
feat: adding test resources needed to run the unit tests
Jaxelr 4747390
feat: added tests.yml configuration
Jaxelr 7c8530f
chore: adding service owners
Jaxelr 1407287
chore: removed teammates temporarily
Jaxelr cfccf02
fix: linter errors
Jaxelr af1679a
fix: path of sdk should be developer-signing instead of developersigning
Jaxelr 96c76f1
chore: update service owners with missing colon
Jaxelr 2c8e108
chore: moved ci.yml configuration to parent directory
Jaxelr 031a809
Update sdk/developer-signing/tests.yml
Jaxelr 97078c3
Update .github/CODEOWNERS
Jaxelr 1aa4896
fix: added test attribute
Jaxelr cef5ea9
fix: rebase building conflicts from autorest generation
Jaxelr 8b983c7
docs: update links to samples to include sdk rename
Jaxelr 663b482
docs: fix analyzer result from header information
Jaxelr f2b39c8
refactor: changed directory to trustedsigning per offline discussion …
Jaxelr e132fdb
fix: configuration of test resources for location value
Jaxelr a92e2c1
fix: result object was improperly mapped
Jaxelr 7fbf8a2
Adding sessions record tests from our environment execution
Jaxelr 5a50f52
docs: addition PR Label for Code Signing
Jaxelr 63d5252
docs: Addition of impression pixel
Jaxelr ed17459
fix: remove unneeded suppression
Jaxelr a9c64d6
chore: update naming description and assembly title
Jaxelr 677ee3a
tests: modify test value to ensure it matches record when reruns are …
Jaxelr f6729ea
tests: removed session records
Jaxelr d27e236
chore: added assets.json
Jaxelr 1a05cbe
test: specific test must be run on async only
Jaxelr 89d0b00
chore: added tag to developer signing asset
Jaxelr c98dd11
fix: test resources will be autopopulating parameters
Jaxelr 96e00a7
chore: update sdk assets to latest tests
Jaxelr 674f54c
swap test location for west europe
Jaxelr 77ee790
Modified assets.json to proper place
Jaxelr b4f20d6
chore: update commit of rest api specs file
Jaxelr 577c5ef
Revert "chore: update commit of rest api specs file"
Jaxelr 67ca546
chore: update to use latest commit that modified azure-rest-api-specs
Jaxelr 85b71bf
fix: trying a commit prior to the latest update
Jaxelr b252385
chore: using older commit
Jaxelr 79e44f5
chore: Running Update Snippets
Jaxelr 46a7f5f
fix: updated samples per rebase from main
Jaxelr 28d2f83
test: signing client sdk update for tests
Jaxelr 746f81c
chore: update samples to main version
Jaxelr 48e13f5
tests: fix - removed the region
Jaxelr cef02a0
docs: update README.md information to include the links from trusted …
Jaxelr 3878317
docs: remove locale information from url link
Jaxelr 198d88e
fix: update trusted signing sdk
Jaxelr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
sdk/trustedsigning/Azure.Developer.Signing/Azure.Developer.Signing.sln
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.3.32825.248 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Developer.Signing", "src\Azure.Developer.Signing.csproj", "{FC39285B-629E-4C91-8728-28C5CAE9CDA0}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Developer.Signing.Tests", "tests\Azure.Developer.Signing.Tests.csproj", "{700074ED-BCA1-4F21-9F72-ACA7EB36C6E5}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {FC39285B-629E-4C91-8728-28C5CAE9CDA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {FC39285B-629E-4C91-8728-28C5CAE9CDA0}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {FC39285B-629E-4C91-8728-28C5CAE9CDA0}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {FC39285B-629E-4C91-8728-28C5CAE9CDA0}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {700074ED-BCA1-4F21-9F72-ACA7EB36C6E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {700074ED-BCA1-4F21-9F72-ACA7EB36C6E5}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {700074ED-BCA1-4F21-9F72-ACA7EB36C6E5}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {700074ED-BCA1-4F21-9F72-ACA7EB36C6E5}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} | ||
| EndGlobalSection | ||
| EndGlobal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Release History | ||
|
|
||
| ## 1.0.0-beta.1 (Unreleased) | ||
|
|
||
| Initial release of the Azure developer signing library | ||
|
|
||
| ### Features Added | ||
|
|
||
| ### Breaking Changes | ||
|
|
||
| ### Bugs Fixed | ||
|
|
||
| ### Other Changes |
6 changes: 6 additions & 0 deletions
6
sdk/trustedsigning/Azure.Developer.Signing/Directory.Build.props
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <!-- | ||
| Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props | ||
| --> | ||
| <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" /> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| # Azure Developer Signing client library for .NET | ||
|
|
||
| Azure.Developer.Signing is a fully managed end-to-end signing solution for 3rd party developers. The Azure.Developer.Signing client library allows you to easily sign your bits without the hassle of managing certificate lifetimes. | ||
|
|
||
| Use the client library for Azure Developer Signing to: | ||
|
|
||
| * [Perform Signing of bits](https://learn.microsoft.com/azure/trusted-signing/how-to-signing-integrations/) | ||
| * [Access Signing information](https://learn.microsoft.com/azure/trusted-signing/how-to-sign-ci-policy/) | ||
|
|
||
| [Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] | ||
|
|
||
| [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/trustedsigning/Azure.Developer.Signing/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) | ||
|
|
||
| ## Getting started | ||
|
|
||
| ### Install the package | ||
|
|
||
| Install the client library for .NET with [NuGet](https://www.nuget.org/ ): | ||
|
|
||
| ```dotnetcli | ||
| dotnet add package Azure.Developer.Signing --prerelease | ||
| ``` | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/). It is recommended that you compile using the latest [.NET SDK](https://dotnet.microsoft.com/download) 6.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. | ||
|
Jaxelr marked this conversation as resolved.
Outdated
|
||
|
|
||
| To have the capability to perform signing actions a Signing Account, Certificate Profile and Identity Validation must be created. These resources can be created using the Azure portal or the Azure CLI. | ||
|
|
||
| ### Authenticate the client | ||
|
|
||
| To access the client, you can use the [Token Credential authentication](https://learn.microsoft.com/dotnet/api/azure.core.tokencredential) method provided by Standard Azure Active Directory. The identity interacting with the resource must have the role of `Code Signing Certificate Profile Signer` on the resource. These roles need to be assigned from the Azure portal or by using the Azure CLI. | ||
|
|
||
| To use Entra ID authentication, add the Azure Identity package: | ||
|
|
||
| `dotnet add package Azure.Identity` | ||
|
|
||
| You will also need to register a new AAD application, or run locally or in an environment with a managed identity. If using an application, set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET. | ||
|
|
||
| ## Key concepts | ||
|
|
||
| This library interacts with the Azure Developer Signing service using two principal concepts, these are: | ||
|
|
||
| - `Trusted Signing Accounts` – A Signing Account is the logical container holding certificate profiles and identity validations and is considered a Azure Developer Signing resource. | ||
| - `Certificate Profile` – A Certificate Profile is the template with the information that is used in the issued certificates. It is a sub-resource to a Code Signing Account resource. | ||
| - `Identity Validation` - An Identity Validation resource is the identity of the legal business or individual. This information will be in the Subject Name of the certificates and therefore is a pre-requisite resource to be able to create a Certificate Profile. | ||
|
|
||
| Since the interaction of the client is at the certificate profile level, the client is designed to interact with this entity. A region must be provided to ensure the request is routed to the specific appropiate environment. | ||
|
|
||
| ```C# Snippet:Azure_Developer_Signing_CreateCertificateProfileClient | ||
| var credential = new DefaultAzureCredential(); | ||
| CertificateProfile certificateProfileClient = new SigningClient(region, credential).GetCertificateProfileClient(); | ||
| ``` | ||
|
|
||
| ### Thread safety | ||
|
|
||
| We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. | ||
|
|
||
| ### Additional concepts | ||
| <!-- CLIENT COMMON BAR --> | ||
| [Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | | ||
| [Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | | ||
| [Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | | ||
| [Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | | ||
| [Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | | ||
| [Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | | ||
| [Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) | ||
| <!-- CLIENT COMMON BAR --> | ||
|
|
||
| ## Examples | ||
|
|
||
| You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/trustedsigning/Azure.Developer.Signing/samples). | ||
|
|
||
| ### Signing bytes | ||
|
|
||
| Sign the digest corresponding to a file using an algorithm. | ||
|
|
||
| ```C# Snippet:Azure_Developer_Signing_SigningBytes | ||
| CertificateProfile certificateProfileClient = new SigningClient(region, credential).GetCertificateProfileClient(); | ||
|
|
||
| using RequestContent content = RequestContent.Create(new | ||
| { | ||
| signatureAlgorithm, | ||
| digest, | ||
| }); | ||
|
|
||
| Operation<BinaryData> operation = certificateProfileClient.Sign(WaitUntil.Completed, accountName, profileName, content); | ||
| BinaryData responseData = operation.Value; | ||
|
|
||
| JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; | ||
| ``` | ||
|
|
||
| ### List available customer extended key usages (EKUs) | ||
|
|
||
| Request all the available customer extended key usages from a certificate profile. | ||
|
|
||
| ```C# Snippet:Azure_Developer_Signing_GetExtendedKeyUsages | ||
| CertificateProfile certificateProfileClient = new SigningClient(region, credential).GetCertificateProfileClient(); | ||
|
|
||
| List<string> ekus = new(); | ||
|
|
||
| foreach (BinaryData item in certificateProfileClient.GetExtendedKeyUsages(accountName, profileName, null)) | ||
| { | ||
| JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; | ||
| string eku = result.GetProperty("eku").ToString(); | ||
|
|
||
| ekus.Add(eku); | ||
| } | ||
| ``` | ||
|
|
||
| ### Download the root certificate | ||
|
|
||
| Request the sign root certificate from a certificate profile. | ||
|
|
||
| ```C# Snippet:Azure_Developer_Signing_GetSignRootCertificate | ||
| CertificateProfile certificateProfileClient = new SigningClient(region, credential).GetCertificateProfileClient(); | ||
|
|
||
| Response<BinaryData> response = certificateProfileClient.GetSignRootCertificate(accountName, profileName); | ||
|
|
||
| byte[] rootCertificate = response.Value.ToArray(); | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| Errors may occur during the Signing Action due to problems with Azure resources or your Azure configuration. You can view the `errorDetails` property on the SignResult if the signing action fails, it will show more information about the problem and how to resolve it. | ||
|
|
||
| Ensure that your client has the correct permissions to perform the action you are trying to perform. For example, if you are trying to sign a file, ensure that your client has the `Code Signing Certificate Profile Signer` role on the resource. | ||
|
|
||
| ## Contributing | ||
|
|
||
| See the [DeveloperSigning CONTRIBUTING.md][developersigning_contrib] for details on building, testing, and contributing to this library. | ||
|
|
||
| This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla]. | ||
|
|
||
| When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. | ||
|
|
||
| This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact [opencode@microsoft.com][email_opencode] with any additional questions or comments. | ||
|
|
||
| <!-- LINKS --> | ||
| [developersigning_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md | ||
| [style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization | ||
| [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide | ||
| [cla]: https://cla.microsoft.com | ||
| [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ | ||
| [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ | ||
| [email_opencode]: mailto:opencode@microsoft.com | ||
|
|
||
|  | ||
|
|
||
| ## Next steps | ||
|
|
||
| For more information on Azure SDK, please refer to [this website](https://azure.github.io/azure-sdk/) | ||
|
Jaxelr marked this conversation as resolved.
Outdated
|
||
|
|
||
|  | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.