![]() |
VOOZH | about |
dotnet add package SecureRequest.GcpSecretManager --version 1.0.0
NuGet\Install-Package SecureRequest.GcpSecretManager -Version 1.0.0
<PackageReference Include="SecureRequest.GcpSecretManager" Version="1.0.0" />
<PackageVersion Include="SecureRequest.GcpSecretManager" Version="1.0.0" />Directory.Packages.props
<PackageReference Include="SecureRequest.GcpSecretManager" />Project file
paket add SecureRequest.GcpSecretManager --version 1.0.0
#r "nuget: SecureRequest.GcpSecretManager, 1.0.0"
#:package SecureRequest.GcpSecretManager@1.0.0
#addin nuget:?package=SecureRequest.GcpSecretManager&version=1.0.0Install as a Cake Addin
#tool nuget:?package=SecureRequest.GcpSecretManager&version=1.0.0Install as a Cake Tool
Google Cloud Secret Manager provider for the SecureRequest NuGet package.
Stores the RSA private key inside GCP Secret Manager instead of Redis/IDistributedCache,
protected by IAM access control, Cloud Audit Logs, and optional CMEK encryption.
dotnet add package SecureRequest
dotnet add package SecureRequest.GcpSecretManager
Chain .WithGcpSecretManager() onto AddSecureRequest():
builder.Services
.AddSecureRequest(builder.Configuration)
.WithGcpSecretManager(projectId: "my-gcp-project");
Application Default Credentials (ADC) are used automatically — picks up Workload Identity in GKE, GOOGLE_APPLICATION_CREDENTIALS environment variable, and gcloud auth application-default login in development.
builder.Services
.AddSecureRequest(builder.Configuration)
.WithGcpSecretManager(
projectId : "my-gcp-project",
secretId : "myapp-rsa-private-key");
builder.Services.AddSingleton(SecretManagerServiceClient.Create());
builder.Services
.AddSecureRequest(builder.Configuration)
.WithGcpSecretManager(
projectId : "my-gcp-project",
clientFactory : sp => sp.GetRequiredService<SecretManagerServiceClient>());
Grant the service account running the application the following roles on the secret resource:
| Role | Purpose |
|---|---|
roles/secretmanager.secretAccessor |
Read secret versions (AccessSecretVersion) |
roles/secretmanager.secretVersionAdder |
Add new versions (AddSecretVersion) |
roles/secretmanager.admin |
Create secret on first startup (CreateSecret) — can be reduced to secretVersionAdder after first run |
Minimum policy (after secret is created):
roles/secretmanager.secretAccessor
roles/secretmanager.secretVersionAdder
GcpSecretManagerKeyStorageProvider creates it (Automatic replication policy) and adds the first version.latest version to load the private key.latest points to the new key.No changes needed — SecureRequest options are bound from the same section:
"SecureRequest": {
"Enabled": true,
"EnableBodyEncryption": true,
"EnableHmacSigning": true,
"TimestampToleranceSeconds": 300,
"NonceCacheTtlSeconds": 700,
"SecuredMethods": ["POST", "PUT", "PATCH"],
"ExcludedPaths": []
}
Note:
IDistributedCacheis still required for nonce anti-replay storage. Only the RSA private key moves to Secret Manager — nonces remain in Redis/in-memory cache.
| Default (Redis) | GcpSecretManagerKeyStorageProvider |
|
|---|---|---|
| Key stored in | Redis (plain Base64) | GCP Secret Manager (AES-256 encrypted) |
| Access control | Redis connection string | IAM roles |
| Audit trail | None | Cloud Audit Logs |
| Encryption at rest | Depends on Redis config | AES-256 (optional CMEK) |
| Compliance | Not sufficient for PCI-DSS / HIPAA | Satisfies requirements |
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 34,518 | 6/12/2026 |