You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 10, 2024. It is now read-only.
_logger.LogCritical(exception,"Could not correctly publish Azure EventGrid events for potential expired client secrets in the Azure Active Directory due to an exception");
_logger.LogEvent($"The secret {application.KeyId} for Azure Active Directory application {application.Name} has expired.",telemetryContext);
112
-
}
113
-
else
114
-
{
115
-
_logger.LogEvent($"The secret {application.KeyId} for Azure Active Directory application {application.Name} will expire within {application.RemainingValidDays} days.",telemetryContext);
telemetryContext["Description"]=$"The secret {application.KeyId} for Azure Active Directory application {application.Name} will expire within {application.RemainingValidDays} days.";
133
+
_logger.LogSecurityEvent("Soon expired Azure Active Directory application secret",telemetryContext);
134
+
break;
135
+
136
+
default:
137
+
thrownewArgumentOutOfRangeException(nameof(eventType),eventType,"Could not determine event type for potential expired Azure Application secret");
/// Represents the additional options that the user can configure during the <see cref="IServiceCollectionExtensions.AddClientSecretExpirationJob(IServiceCollection,Action{ClientSecretExpirationJobOptions})"/> call.
10
+
/// Represents the additional options that the user can configure during the <see cref="IServiceCollectionExtensions.AddClientSecretExpirationJob(IServiceCollection,Action{ClientSecretExpirationJobOptions})"/> call.
11
11
/// </summary>
12
12
publicclassClientSecretExpirationJobOptions
13
13
{
14
14
privateint_runAtHour=0;
15
15
privatebool_runImmediately=false;
16
-
privateUri_eventUri=null;
16
+
privateUri_eventUri=newUri("https://azure.net/");
17
17
privateint_expirationThreshold=14;
18
18
19
19
/// <summary>
@@ -79,25 +79,22 @@ public int ExpirationThreshold
79
79
/// </summary>
80
80
/// <param name="application">The <see cref="AzureApplication"/> containing the information regarding the application and its expiring or about to expire secret.</param>
81
81
/// <param name="type">The type used in the creation of the <see cref="CloudEvent"/>.</param>
82
-
/// <param name="eventUri">The uri used in the creation of the <see cref="CloudEvent"/>.</param>
83
82
/// <exception cref="ArgumentNullException">Thrown when the <paramref name="application"/> is null.</exception>
84
83
/// <exception cref="ArgumentException">Thrown when the <paramref name="application"/> name is blank.</exception>
85
-
/// <exception cref="ArgumentException">Thrown when the <paramref name="eventUri"/> is blank.</exception>
Copy file name to clipboardExpand all lines: src/Arcus.BackgroundJobs.AzureActiveDirectory/Extensions/IServiceCollectionExtensions.cs
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,8 @@ public static class IServiceCollectionExtensions
20
20
/// which will query Azure Active Directory for applications that have expired or soon to be expired secrets and send a CloudEvent to an Event Grid Topic.
21
21
/// </summary>
22
22
/// <remarks>
23
-
/// Make sure that the application has an Arcus EventGrid publisher configured.
24
-
/// For on the Arcus secret store: <a href="https://eventgrid.arcus-azure.net/Features/publishing-events" />.
23
+
/// Make sure that you register an <see cref="IEventGridPublisher"/> instance that the background job can use to publish events for potential expired Azure Application secrets.
24
+
/// For more information on Azure EventGrid, see: <a href="https://eventgrid.arcus-azure.net/Features/publishing-events" />.
25
25
/// </remarks>
26
26
/// <param name="services">The services to add the background job to.</param>
27
27
/// <exception cref="ArgumentNullException">Thrown when <paramref name="services"/> is <c>null</c>.</exception>
@@ -36,8 +36,8 @@ public static IServiceCollection AddClientSecretExpirationJob(this IServiceColle
36
36
/// which will query Azure Active Directory for applications that have expired or soon to be expired secrets and send a CloudEvent to an Event Grid Topic.
37
37
/// </summary>
38
38
/// <remarks>
39
-
/// Make sure that the application has an Arcus EventGrid publisher configured.
40
-
/// For on the Arcus secret store: <a href="https://eventgrid.arcus-azure.net/Features/publishing-events" />.
39
+
/// Make sure that you register an <see cref="IEventGridPublisher"/> instance that the background job can use to publish events for potential expired Azure Application secrets.
40
+
/// For more information on Azure EventGrid, see: <a href="https://eventgrid.arcus-azure.net/Features/publishing-events" />.
41
41
/// </remarks>
42
42
/// <param name="services">The services to add the background job to.</param>
43
43
/// <param name="configureOptions">The optional additional customized user configuration of options for this background job.</param>
0 commit comments