SquidStd.Secrets.Aws
0.27.0
dotnet add package SquidStd.Secrets.Aws --version 0.27.0
NuGet\Install-Package SquidStd.Secrets.Aws -Version 0.27.0
<PackageReference Include="SquidStd.Secrets.Aws" Version="0.27.0" />
<PackageVersion Include="SquidStd.Secrets.Aws" Version="0.27.0" />
<PackageReference Include="SquidStd.Secrets.Aws" />
paket add SquidStd.Secrets.Aws --version 0.27.0
#r "nuget: SquidStd.Secrets.Aws, 0.27.0"
#:package SquidStd.Secrets.Aws@0.27.0
#addin nuget:?package=SquidStd.Secrets.Aws&version=0.27.0
#tool nuget:?package=SquidStd.Secrets.Aws&version=0.27.0
<h1 align="center">SquidStd.Secrets.Aws</h1>
AWS adapters for the two SquidStd secret seams: an ISecretProtector that envelope-encrypts payloads
with AWS KMS data keys, and an ISecretStore backed by AWS Secrets Manager. Drop either into the
container in place of the file-backed defaults to push key custody and secret storage into AWS-managed
services, keeping the rest of the application unchanged.
Install
dotnet add package SquidStd.Secrets.Aws
Usage
using SquidStd.Secrets.Aws.Extensions;
// KMS-backed ISecretProtector (envelope encryption)
container.RegisterKmsSecretProtector(o =>
{
o.KeyId = "alias/my-app"; // KMS key id, ARN, or alias
o.Aws.Region = "eu-west-1";
});
// Secrets Manager-backed ISecretStore
container.RegisterAwsSecretsManagerStore(o =>
{
o.NamePrefix = "my-app/"; // optional logical namespace
o.Aws.Region = "eu-west-1";
});
Both seams are then resolved like any other SquidStd secret service:
var protector = container.Resolve<ISecretProtector>();
byte[] sealed = protector.Protect(payload);
byte[] restored = protector.Unprotect(sealed);
var store = container.Resolve<ISecretStore>();
await store.SetAsync("db/main", connectionString);
string? value = await store.GetAsync("db/main");
await foreach (var name in store.ListNamesAsync("db/")) { /* ... */ }
Key types
| Type | Purpose |
|---|---|
KmsSecretProtector |
ISecretProtector using AWS KMS data keys (envelope encryption). |
AwsSecretsManagerStore |
ISecretStore backed by AWS Secrets Manager. |
KmsSecretProtectorOptions |
KMS key id/ARN/alias, region and credentials. |
AwsSecretsManagerOptions |
Optional name prefix, region and credentials. |
Notes
- Envelope encryption -
KmsSecretProtectorcallsGenerateDataKeyperProtect, encrypts the payload locally with AES-256-GCM, and frames the KMS-wrapped data key alongside the ciphertext. The plaintext data key is zeroed immediately after use;UnprotectcallsDecryptto unwrap it. KMS never sees the payload, and large payloads are not bound by the 4 KB KMS direct-encrypt limit. - NamePrefix -
AwsSecretsManagerStoreprependsNamePrefixto every secret id, giving each application its own namespace inside a shared account.ListNamesAsyncstrips the prefix so callers always see logical names.Deletereturnsfalsefor a missing secret. - Credentials - when
Aws.AccessKey/Aws.SecretKeyare omitted, the AWS SDK default credential chain is used (environment, shared profile, EC2/ECS role). SetAws.ServiceUrlto target LocalStack or another compatible endpoint. - Tested against LocalStack - the KMS and Secrets Manager adapters are covered by integration tests
running on a
localstack/localstackcontainer.
Related
- Tutorial: Secrets (KMS / Secrets Manager)
License
MIT - part of SquidStd.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AWSSDK.KeyManagementService (>= 4.0.100)
- AWSSDK.SecretsManager (>= 4.0.100)
- SquidStd.Aws.Abstractions (>= 0.27.0)
- SquidStd.Core (>= 0.27.0)
- SquidStd.Services.Core (>= 0.27.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.27.0 | 0 | 7/7/2026 |
| 0.26.0 | 0 | 7/7/2026 |
| 0.25.0 | 64 | 7/6/2026 |
| 0.24.1 | 62 | 7/6/2026 |
| 0.24.0 | 68 | 7/6/2026 |
| 0.23.0 | 69 | 7/4/2026 |
| 0.22.0 | 65 | 7/4/2026 |
| 0.21.0 | 67 | 7/3/2026 |
| 0.20.0 | 63 | 7/3/2026 |
| 0.19.0 | 68 | 7/3/2026 |
| 0.18.0 | 69 | 7/3/2026 |
| 0.17.0 | 74 | 7/3/2026 |
| 0.16.0 | 77 | 7/3/2026 |
| 0.15.0 | 69 | 7/2/2026 |
| 0.14.1 | 76 | 7/2/2026 |
| 0.14.0 | 72 | 7/2/2026 |
| 0.13.0 | 68 | 7/2/2026 |
| 0.12.0 | 72 | 7/2/2026 |
| 0.11.0 | 72 | 7/2/2026 |
| 0.10.0 | 73 | 6/30/2026 |