Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit 5ba1736

Browse files
authored
docs: mention arcus secret store (#85)
* docs: mention arcus secret store * pr-add: update also v0.3 feature docs
1 parent e6e24bf commit 5ba1736

File tree

4 files changed

+142
-22
lines changed

4 files changed

+142
-22
lines changed

docs/preview/02-Features/02-Security/auto-invalidate-secrets.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,40 @@ To make this automation opperational, following Azure Resources has to be used:
2525

2626
## Usage
2727

28+
Make sure that you have registered the [Arcus secret store](https://security.arcus-azure.net/features/secret-store/) so an `ISecretProvider`/`ICachedSecretProvider` is available to auto invalidate.
29+
This is usually done in the `Program.cs`. See our [dedicated documentation](https://security.arcus-azure.net/features/secret-store/) for more information on the secret store.
30+
31+
```csharp
32+
using Microsoft.Extensions.Hosting;
33+
34+
public class Program
35+
{
36+
public static void Main(string[] args)
37+
{
38+
CreateHostBuilder(args).Build().Run();
39+
}
40+
41+
public static IHostBuilder CreateHostBuilder(string[] args) =>
42+
Host.CreateDefaultBuilder(args)
43+
.ConfigureAppConfiguration((context, config) =>
44+
{
45+
config.AddJsonFile("appsettings.json")
46+
.AddJsonFile("appsettings.Development.json");
47+
})
48+
.ConfigureSecretStore((context, config, builder) =>
49+
{
50+
#if DEBUG
51+
builder.AddConfiguration(config);
52+
#endif
53+
var keyVaultName = config["KeyVault_Name"];
54+
builder.AddEnvironmentVariables()
55+
.AddAzureKeyVaultWithManagedServiceIdentity($"https://{keyVaultName}.vault.azure.net");
56+
})
57+
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>());
58+
}
59+
}
60+
```
61+
2862
Our background job has to be configured in `ConfigureServices` method:
2963

3064
```csharp
@@ -36,19 +70,13 @@ public class Startup
3670
{
3771
public void ConfigureServices(IServiceCollection services)
3872
{
39-
// An 'ISecretProvider' implementation (see: https://security.arcus-azure.net/) to access the Azure Service Bus Topic resource;
40-
// this will get the 'serviceBusTopicConnectionStringSecretKey' string (configured below) and has to retrieve the connection string for the topic.
41-
services.AddSingleton<ISecretProvider>(serviceProvider => ...);
42-
43-
// An `ICachedSecretProvider` implementation which secret keys will automatically be invalidated.
44-
services.AddSingleton<ICachedSecretProvider>(serviceProvider => new CachedSecretProvider(mySecretProvider));
45-
4673
services.AddAutoInvalidateKeyVaultSecretBackgroundJob(
4774
// Prefix of the Azure Service Bus Topic subscription;
4875
// this allows the background jobs to support applications that are running multiple instances, processing the same type of events, without conflicting subscription names.
4976
subscriptionNamePrefix: "MyPrefix"
5077

5178
// Connection string secret key to a Azure Service Bus Topic.
79+
// Make sure that this key is available in the Arcus secret store.
5280
serviceBusTopicConnectionStringSecretKey: "MySecretKeyToServiceBusTopicConnectionString");
5381
}
5482
}

docs/preview/02-Features/03-Databricks/job-metrics.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,40 @@ PM > Install-Package Arcus.BackgroundJobs.Databricks
1919

2020
## Usage
2121

22+
Make sure that you have registered the [Arcus secret store](https://security.arcus-azure.net/features/secret-store/) so an `ISecretProvider` is available to retrieve the connection token for the Databricks instance.
23+
This is usually done in the `Program.cs`. See our [dedicated documentation](https://security.arcus-azure.net/features/secret-store/) for more information on the secret store.
24+
25+
```csharp
26+
using Microsoft.Extensions.Hosting;
27+
28+
public class Program
29+
{
30+
public static void Main(string[] args)
31+
{
32+
CreateHostBuilder(args).Build().Run();
33+
}
34+
35+
public static IHostBuilder CreateHostBuilder(string[] args) =>
36+
Host.CreateDefaultBuilder(args)
37+
.ConfigureAppConfiguration((context, config) =>
38+
{
39+
config.AddJsonFile("appsettings.json")
40+
.AddJsonFile("appsettings.Development.json");
41+
})
42+
.ConfigureSecretStore((context, config, builder) =>
43+
{
44+
#if DEBUG
45+
builder.AddConfiguration(config);
46+
#endif
47+
var keyVaultName = config["KeyVault_Name"];
48+
builder.AddEnvironmentVariables()
49+
.AddAzureKeyVaultWithManagedServiceIdentity($"https://{keyVaultName}.vault.azure.net");
50+
})
51+
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>());
52+
}
53+
}
54+
```
55+
2256
Our background job has to be configured in `ConfigureServices` method:
2357

2458
```csharp
@@ -29,20 +63,18 @@ public class Startup
2963
{
3064
public void ConfigureServices(IServiceCollection services)
3165
{
32-
// An 'ISecretProvider' implementation (see: https://security.arcus-azure.net/) to access the Azure Service Bus Topic resource;
33-
// this will get the 'tokenSecretKey' string (configured below) and has to retrieve the connection token for the Databricks instance.
34-
services.AddSingleton<ISecretProvider>(serviceProvider => ...);
35-
3666
// Simplest registration of the scheduler job:
3767
services.AddDatabricksJobMetricsJob(
3868
baseUrl: "https://url.to.databricks.instance/"
3969
// Token secret key to connect to the Databricks token.
70+
// Make sure that this key is available in the Arcus secret store.
4071
tokenSecretKey: "Databricks.Token");
4172

4273
// Customized registration of the scheduler job:
4374
services.AddDatabricksJobMetricsJob(
4475
baseUrl: "https://url.to.databricks.instance/"
4576
// Token secret key to connect to the Databricks token.
77+
// Make sure that this key is available in the Arcus secret store.
4678
tokenSecretKey: "Databricks.Token",
4779
options =>
4880
{

docs/versioned_docs/version-v0.3/02-Features/02-Security/auto-invalidate-secrets.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,40 @@ To make this automation opperational, following Azure Resources has to be used:
2525

2626
## Usage
2727

28+
Make sure that you have registered the [Arcus secret store](https://security.arcus-azure.net/features/secret-store/) so an `ISecretProvider`/`ICachedSecretProvider` is available to auto invalidate.
29+
This is usually done in the `Program.cs`. See our [dedicated documentation](https://security.arcus-azure.net/features/secret-store/) for more information on the secret store.
30+
31+
```csharp
32+
using Microsoft.Extensions.Hosting;
33+
34+
public class Program
35+
{
36+
public static void Main(string[] args)
37+
{
38+
CreateHostBuilder(args).Build().Run();
39+
}
40+
41+
public static IHostBuilder CreateHostBuilder(string[] args) =>
42+
Host.CreateDefaultBuilder(args)
43+
.ConfigureAppConfiguration((context, config) =>
44+
{
45+
config.AddJsonFile("appsettings.json")
46+
.AddJsonFile("appsettings.Development.json");
47+
})
48+
.ConfigureSecretStore((context, config, builder) =>
49+
{
50+
#if DEBUG
51+
builder.AddConfiguration(config);
52+
#endif
53+
var keyVaultName = config["KeyVault_Name"];
54+
builder.AddEnvironmentVariables()
55+
.AddAzureKeyVaultWithManagedServiceIdentity($"https://{keyVaultName}.vault.azure.net");
56+
})
57+
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>());
58+
}
59+
}
60+
```
61+
2862
Our background job has to be configured in `ConfigureServices` method:
2963

3064
```csharp
@@ -36,19 +70,13 @@ public class Startup
3670
{
3771
public void ConfigureServices(IServiceCollection services)
3872
{
39-
// An 'ISecretProvider' implementation (see: https://security.arcus-azure.net/) to access the Azure Service Bus Topic resource;
40-
// this will get the 'serviceBusTopicConnectionStringSecretKey' string (configured below) and has to retrieve the connection string for the topic.
41-
services.AddSingleton<ISecretProvider>(serviceProvider => ...);
42-
43-
// An `ICachedSecretProvider` implementation which secret keys will automatically be invalidated.
44-
services.AddSingleton<ICachedSecretProvider>(serviceProvider => new CachedSecretProvider(mySecretProvider));
45-
4673
services.AddAutoInvalidateKeyVaultSecretBackgroundJob(
4774
// Prefix of the Azure Service Bus Topic subscription;
4875
// this allows the background jobs to support applications that are running multiple instances, processing the same type of events, without conflicting subscription names.
4976
subscriptionNamePrefix: "MyPrefix"
5077

5178
// Connection string secret key to a Azure Service Bus Topic.
79+
// Make sure that this key is available in the Arcus secret store.
5280
serviceBusTopicConnectionStringSecretKey: "MySecretKeyToServiceBusTopicConnectionString");
5381
}
5482
}

docs/versioned_docs/version-v0.3/02-Features/03-Databricks/job-metrics.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,40 @@ PM > Install-Package Arcus.BackgroundJobs.Databricks -Version 0.3.0
1919

2020
## Usage
2121

22+
Make sure that you have registered the [Arcus secret store](https://security.arcus-azure.net/features/secret-store/) so an `ISecretProvider` is available to retrieve the connection token for the Databricks instance.
23+
This is usually done in the `Program.cs`. See our [dedicated documentation](https://security.arcus-azure.net/features/secret-store/) for more information on the secret store.
24+
25+
```csharp
26+
using Microsoft.Extensions.Hosting;
27+
28+
public class Program
29+
{
30+
public static void Main(string[] args)
31+
{
32+
CreateHostBuilder(args).Build().Run();
33+
}
34+
35+
public static IHostBuilder CreateHostBuilder(string[] args) =>
36+
Host.CreateDefaultBuilder(args)
37+
.ConfigureAppConfiguration((context, config) =>
38+
{
39+
config.AddJsonFile("appsettings.json")
40+
.AddJsonFile("appsettings.Development.json");
41+
})
42+
.ConfigureSecretStore((context, config, builder) =>
43+
{
44+
#if DEBUG
45+
builder.AddConfiguration(config);
46+
#endif
47+
var keyVaultName = config["KeyVault_Name"];
48+
builder.AddEnvironmentVariables()
49+
.AddAzureKeyVaultWithManagedServiceIdentity($"https://{keyVaultName}.vault.azure.net");
50+
})
51+
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>());
52+
}
53+
}
54+
```
55+
2256
Our background job has to be configured in `ConfigureServices` method:
2357

2458
```csharp
@@ -29,20 +63,18 @@ public class Startup
2963
{
3064
public void ConfigureServices(IServiceCollection services)
3165
{
32-
// An 'ISecretProvider' implementation (see: https://security.arcus-azure.net/) to access the Azure Service Bus Topic resource;
33-
// this will get the 'tokenSecretKey' string (configured below) and has to retrieve the connection token for the Databricks instance.
34-
services.AddSingleton<ISecretProvider>(serviceProvider => ...);
35-
3666
// Simplest registration of the scheduler job:
3767
services.AddDatabricksJobMetricsJob(
3868
baseUrl: "https://url.to.databricks.instance/"
3969
// Token secret key to connect to the Databricks token.
70+
// Make sure that this key is available in the Arcus secret store.
4071
tokenSecretKey: "Databricks.Token");
4172

4273
// Customized registration of the scheduler job:
4374
services.AddDatabricksJobMetricsJob(
4475
baseUrl: "https://url.to.databricks.instance/"
4576
// Token secret key to connect to the Databricks token.
77+
// Make sure that this key is available in the Arcus secret store.
4678
tokenSecretKey: "Databricks.Token",
4779
options =>
4880
{

0 commit comments

Comments
 (0)