From b07c671e9f75d7db9072905cf6b017996b742627 Mon Sep 17 00:00:00 2001 From: larenelg Date: Mon, 31 Aug 2020 10:54:00 +1000 Subject: [PATCH 1/4] enable username password auth as admin / password --- example/SeqEnableAuth/Program.cs | 75 ++++++++++++++++++++++ example/SeqEnableAuth/SeqEnableAuth.csproj | 16 +++++ seq-api.sln | 7 ++ 3 files changed, 98 insertions(+) create mode 100644 example/SeqEnableAuth/Program.cs create mode 100644 example/SeqEnableAuth/SeqEnableAuth.csproj diff --git a/example/SeqEnableAuth/Program.cs b/example/SeqEnableAuth/Program.cs new file mode 100644 index 0000000..f92de48 --- /dev/null +++ b/example/SeqEnableAuth/Program.cs @@ -0,0 +1,75 @@ +using System; +using System.Threading.Tasks; +using DocoptNet; +using Seq.Api; +using Seq.Api.Model.Settings; + +namespace SeqEnableAuth +{ + class Program + { + const string Usage = @"seq-enable-auth: enable authentication on your Seq server. + +Usage: + seq-enable-auth.exe [--apikey=] + seq-enable-auth.exe (-h | --help) + +Options: + -h --help Show this screen. + --apikey= Seq API key. + + "; + static void Main(string[] args) + { + Task.Run(async () => + { + try + { + var arguments = new Docopt().Apply(Usage, args, version: "Seq Enable Auth 0.1", exit: true); + + var server = arguments[""].ToString(); + var apiKey = Normalize(arguments["--apikey"]); + + await Run(server, apiKey); + } + catch (Exception ex) + { + Console.ForegroundColor = ConsoleColor.White; + Console.BackgroundColor = ConsoleColor.Red; + Console.WriteLine("seq-enable-auth: {0}", ex); + Console.ResetColor(); + Environment.Exit(-1); + } + }).Wait(); + } + + static string Normalize(ValueObject v) + { + if (v == null) return null; + var s = v.ToString(); + return string.IsNullOrWhiteSpace(s) ? null : s; + } + + static async Task Run(string server, string apiKey) + { + var connection = new SeqConnection(server, apiKey); + + // check for valid license? + + var admin = await connection.Users.FindCurrentAsync(); + + admin.NewPassword = "password"; + + await connection.Users.UpdateAsync(admin); + + var iae = await connection.Settings.FindNamedAsync(SettingName.IsAuthenticationEnabled); + iae.Value = true; + await connection.Settings.UpdateAsync(iae); + + await connection.Users.LoginAsync(admin.Username, "password"); + + var result = await connection.Users.FindAsync(admin.Id); + Console.WriteLine(result); + } + } +} diff --git a/example/SeqEnableAuth/SeqEnableAuth.csproj b/example/SeqEnableAuth/SeqEnableAuth.csproj new file mode 100644 index 0000000..9353a77 --- /dev/null +++ b/example/SeqEnableAuth/SeqEnableAuth.csproj @@ -0,0 +1,16 @@ + + + + Exe + netcoreapp3.1 + + + + + + + + + + + diff --git a/seq-api.sln b/seq-api.sln index 0c8feca..d55a021 100644 --- a/seq-api.sln +++ b/seq-api.sln @@ -27,6 +27,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SeqTail", "example\SeqTail\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SignalCopy", "example\SignalCopy\SignalCopy.csproj", "{E8CDDE17-8E29-4EB4-A4BB-38BCE346A752}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeqEnableAuth", "example\SeqEnableAuth\SeqEnableAuth.csproj", "{035B62FC-CAD7-4DF9-A2A3-FAAA64DF3B55}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -53,6 +55,10 @@ Global {E8CDDE17-8E29-4EB4-A4BB-38BCE346A752}.Debug|Any CPU.Build.0 = Debug|Any CPU {E8CDDE17-8E29-4EB4-A4BB-38BCE346A752}.Release|Any CPU.ActiveCfg = Release|Any CPU {E8CDDE17-8E29-4EB4-A4BB-38BCE346A752}.Release|Any CPU.Build.0 = Release|Any CPU + {035B62FC-CAD7-4DF9-A2A3-FAAA64DF3B55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {035B62FC-CAD7-4DF9-A2A3-FAAA64DF3B55}.Debug|Any CPU.Build.0 = Debug|Any CPU + {035B62FC-CAD7-4DF9-A2A3-FAAA64DF3B55}.Release|Any CPU.ActiveCfg = Release|Any CPU + {035B62FC-CAD7-4DF9-A2A3-FAAA64DF3B55}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -63,6 +69,7 @@ Global {34BBD428-8297-484E-B771-0B72C172C264} = {1C66E116-DC21-4C8F-833E-A4C2DDF58487} {42CEBFBA-208F-40F1-AC95-13F05F6D5412} = {1C66E116-DC21-4C8F-833E-A4C2DDF58487} {E8CDDE17-8E29-4EB4-A4BB-38BCE346A752} = {1C66E116-DC21-4C8F-833E-A4C2DDF58487} + {035B62FC-CAD7-4DF9-A2A3-FAAA64DF3B55} = {1C66E116-DC21-4C8F-833E-A4C2DDF58487} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {20BAB483-FB94-4373-8E4C-0F846B6DBFFC} From 469b35e63695ae2e6a51478f1145c05c32c76c4e Mon Sep 17 00:00:00 2001 From: larenelg Date: Mon, 31 Aug 2020 14:51:55 +1000 Subject: [PATCH 2/4] add example for seq-enable-aad --- example/SeqEnableAAD/Program.cs | 88 +++++++++++++++++++ .../SeqEnableAAD.csproj} | 1 + example/SeqEnableAuth/Program.cs | 75 ---------------- seq-api.sln | 2 +- 4 files changed, 90 insertions(+), 76 deletions(-) create mode 100644 example/SeqEnableAAD/Program.cs rename example/{SeqEnableAuth/SeqEnableAuth.csproj => SeqEnableAAD/SeqEnableAAD.csproj} (88%) delete mode 100644 example/SeqEnableAuth/Program.cs diff --git a/example/SeqEnableAAD/Program.cs b/example/SeqEnableAAD/Program.cs new file mode 100644 index 0000000..a9a29fc --- /dev/null +++ b/example/SeqEnableAAD/Program.cs @@ -0,0 +1,88 @@ +using System; +using System.Threading.Tasks; +using DocoptNet; +using Seq.Api; +using Seq.Api.Model.Settings; + +namespace SeqEnableAAD +{ + class Program + { + const string Usage = @"seq-enable-aad: enable authentication on your Seq server (for initial setup of a new Seq server only). + +Usage: + seq-enable-aad.exe [--uname=] [--tenantid=] [--clientid=] [--clientkey=] (--authority=) + seq-enable-aad.exe (-h | --help) + +Options: + -h --help Show this screen. + --uname= Username. Azure Active Directory usernames must take the form of an email address. + --tenantid= Tenant ID. + --clientid= Client ID. + --clientkey= Client key. + --authority= Authority (optional, defaults to 'login.windows.net'). + "; + static void Main(string[] args) + { + Task.Run(async () => + { + try + { + var arguments = new Docopt().Apply(Usage, args, version: "Seq Enable AAD 0.1", exit: true); + + var server = arguments[""].ToString(); + var username = Normalize(arguments["--uname"]); + var tenantId = Normalize(arguments["--tenantid"]); + var clientId = Normalize(arguments["--clientid"]); + var clientKey = Normalize(arguments["--clientkey"]); + var authority = Normalize(arguments["--authority"]); + + await Run(server, username, tenantId, clientId, clientKey, authority); + } + catch (Exception ex) + { + Console.ForegroundColor = ConsoleColor.White; + Console.BackgroundColor = ConsoleColor.Red; + Console.WriteLine("seq-enable-auth: {0}", ex); + Console.ResetColor(); + Environment.Exit(-1); + } + }).Wait(); + } + + static string Normalize(ValueObject v) + { + if (v == null) return null; + var s = v.ToString(); + return string.IsNullOrWhiteSpace(s) ? null : s; + } + + static async Task Run(string server, string username, string tenantId, string clientId, string clientKey, string authority="login.windows.net") + { + var connection = new SeqConnection(server); + + var user = await connection.Users.FindCurrentAsync(); + var cid = await connection.Settings.FindNamedAsync(SettingName.AzureADClientId); + var ckey = await connection.Settings.FindNamedAsync(SettingName.AzureADClientKey); + var aut = await connection.Settings.FindNamedAsync(SettingName.AzureADAuthority); + var tid = await connection.Settings.FindNamedAsync(SettingName.AzureADTenantId); + + user.Username = username; + cid.Value = clientId; + ckey.Value = clientKey; + tid.Value = tenantId; + aut.Value = authority; + + await connection.Users.UpdateAsync(user); + await connection.Settings.UpdateAsync(cid); + await connection.Settings.UpdateAsync(ckey); + await connection.Settings.UpdateAsync(tid); + await connection.Settings.UpdateAsync(aut); + + + var iae = await connection.Settings.FindNamedAsync(SettingName.IsAuthenticationEnabled); + iae.Value = true; + await connection.Settings.UpdateAsync(iae); // this update needs to happen last, as enabling auth will lock this connection out + } + } +} diff --git a/example/SeqEnableAuth/SeqEnableAuth.csproj b/example/SeqEnableAAD/SeqEnableAAD.csproj similarity index 88% rename from example/SeqEnableAuth/SeqEnableAuth.csproj rename to example/SeqEnableAAD/SeqEnableAAD.csproj index 9353a77..499ae03 100644 --- a/example/SeqEnableAuth/SeqEnableAuth.csproj +++ b/example/SeqEnableAAD/SeqEnableAAD.csproj @@ -3,6 +3,7 @@ Exe netcoreapp3.1 + SeqEnableAuth diff --git a/example/SeqEnableAuth/Program.cs b/example/SeqEnableAuth/Program.cs deleted file mode 100644 index f92de48..0000000 --- a/example/SeqEnableAuth/Program.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Threading.Tasks; -using DocoptNet; -using Seq.Api; -using Seq.Api.Model.Settings; - -namespace SeqEnableAuth -{ - class Program - { - const string Usage = @"seq-enable-auth: enable authentication on your Seq server. - -Usage: - seq-enable-auth.exe [--apikey=] - seq-enable-auth.exe (-h | --help) - -Options: - -h --help Show this screen. - --apikey= Seq API key. - - "; - static void Main(string[] args) - { - Task.Run(async () => - { - try - { - var arguments = new Docopt().Apply(Usage, args, version: "Seq Enable Auth 0.1", exit: true); - - var server = arguments[""].ToString(); - var apiKey = Normalize(arguments["--apikey"]); - - await Run(server, apiKey); - } - catch (Exception ex) - { - Console.ForegroundColor = ConsoleColor.White; - Console.BackgroundColor = ConsoleColor.Red; - Console.WriteLine("seq-enable-auth: {0}", ex); - Console.ResetColor(); - Environment.Exit(-1); - } - }).Wait(); - } - - static string Normalize(ValueObject v) - { - if (v == null) return null; - var s = v.ToString(); - return string.IsNullOrWhiteSpace(s) ? null : s; - } - - static async Task Run(string server, string apiKey) - { - var connection = new SeqConnection(server, apiKey); - - // check for valid license? - - var admin = await connection.Users.FindCurrentAsync(); - - admin.NewPassword = "password"; - - await connection.Users.UpdateAsync(admin); - - var iae = await connection.Settings.FindNamedAsync(SettingName.IsAuthenticationEnabled); - iae.Value = true; - await connection.Settings.UpdateAsync(iae); - - await connection.Users.LoginAsync(admin.Username, "password"); - - var result = await connection.Users.FindAsync(admin.Id); - Console.WriteLine(result); - } - } -} diff --git a/seq-api.sln b/seq-api.sln index d55a021..8fda661 100644 --- a/seq-api.sln +++ b/seq-api.sln @@ -27,7 +27,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SeqTail", "example\SeqTail\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SignalCopy", "example\SignalCopy\SignalCopy.csproj", "{E8CDDE17-8E29-4EB4-A4BB-38BCE346A752}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeqEnableAuth", "example\SeqEnableAuth\SeqEnableAuth.csproj", "{035B62FC-CAD7-4DF9-A2A3-FAAA64DF3B55}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeqEnableAAD", "example\SeqEnableAAD\SeqEnableAAD.csproj", "{035B62FC-CAD7-4DF9-A2A3-FAAA64DF3B55}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From c036dbee4144bfd021692d6dc4ce269d77b8fd35 Mon Sep 17 00:00:00 2001 From: larenelg Date: Mon, 31 Aug 2020 15:12:24 +1000 Subject: [PATCH 3/4] fix missing provider update in add example, update how icon is included --- example/SeqEnableAAD/Program.cs | 5 ++++- src/Seq.Api/Seq.Api.csproj | 3 ++- src/Seq.Api/seq-api-icon.png | Bin 0 -> 6683 bytes 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 src/Seq.Api/seq-api-icon.png diff --git a/example/SeqEnableAAD/Program.cs b/example/SeqEnableAAD/Program.cs index a9a29fc..0935160 100644 --- a/example/SeqEnableAAD/Program.cs +++ b/example/SeqEnableAAD/Program.cs @@ -62,12 +62,14 @@ static async Task Run(string server, string username, string tenantId, string cl var connection = new SeqConnection(server); var user = await connection.Users.FindCurrentAsync(); + var provider = await connection.Settings.FindNamedAsync(SettingName.AuthenticationProvider); var cid = await connection.Settings.FindNamedAsync(SettingName.AzureADClientId); var ckey = await connection.Settings.FindNamedAsync(SettingName.AzureADClientKey); var aut = await connection.Settings.FindNamedAsync(SettingName.AzureADAuthority); var tid = await connection.Settings.FindNamedAsync(SettingName.AzureADTenantId); user.Username = username; + provider.Value = "Azure Active Directory"; cid.Value = clientId; ckey.Value = clientKey; tid.Value = tenantId; @@ -78,7 +80,8 @@ static async Task Run(string server, string username, string tenantId, string cl await connection.Settings.UpdateAsync(ckey); await connection.Settings.UpdateAsync(tid); await connection.Settings.UpdateAsync(aut); - + + await connection.Settings.UpdateAsync(provider); // needs to go before IsAuthenticationEnabled but after the other settings var iae = await connection.Settings.FindNamedAsync(SettingName.IsAuthenticationEnabled); iae.Value = true; diff --git a/src/Seq.Api/Seq.Api.csproj b/src/Seq.Api/Seq.Api.csproj index 65a1226..0de28ea 100644 --- a/src/Seq.Api/Seq.Api.csproj +++ b/src/Seq.Api/Seq.Api.csproj @@ -8,7 +8,7 @@ true seq Copyright © Datalust Pty Ltd and Contributors - https://datalust.co/images/seq-nuget.png + seq-api-icon.png https://github.com/datalust/seq-api Apache-2.0 8 @@ -16,5 +16,6 @@ + diff --git a/src/Seq.Api/seq-api-icon.png b/src/Seq.Api/seq-api-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ed37092a0647fa008fb640b51ac049a0e18f7472 GIT binary patch literal 6683 zcmd5>`9IX%+y6`xlf6>bFcqc6gxtC_wvzBrmfZH8lB^*#!k}cy5*6JTLM8iBvTsQw ziL9leC~L-~F+x1&b4K6i^?Lq-?+;!+=bY=h&UL-7_jR3fUK3?-R*Q#IgcCs!9v$sd zMhJpQK>xO|gBfyz;v4X9v-62FClI7Go@>>f4U9Rww9S1GL|_5^!&sPBS%OJnUrjUL zbDkG`{q4QaBVP6{9=-&R^S*cmf-FH^j*fS^3uIDsPMt6gu=)P!YDqd1cKz;{_maA8xYGkZJ7J^4ZHG0B3wp(GkMCaw?KTC z;<5y<=pogd;9V7MTaib3kLy=&1t_ySY{PyD=f>C_Y`(C5-o7rxX(d1wZv!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*w}O2EBz6E z=(>A%q4om*VB zlUhn49l@-|p~1*Y@hNn1@*2_hlGC9;QfnPHWfN*kvTq)U{!5}EvlLXcObe|;CQl;; z3R)B%s#FX1FfapQfWl717wuUr*@)MYVihO^zuDd9JJUfao){qo&bj$03xOW`DRvd2ptA*538A%^`lg4cy^B!}xLXo%>Nm4_e-UQ

4EyzzsQ7ysoP= z8_lFxRNWc)AS9OH&X^m0ebJ-jIjIv-(g!M|WVeDVIG;XOwgfR?(Ggol@-mqZW+-8t zbiwj#G9bBFSDJ9Gb=_%XCWcj}VY%GEtchr5Ffk?9hiA0_)Ox{dMkh1?#z#r+W3DeIXKr#cs z__Zt^^bFHyLrqcBGdKf15UrF@!biY|uX{BHjYct_shB${-1fRBaN`e2QcF3@B+Q*~ zFz#m0q3%>ZE_>+j6G4T@YXHVW1FR8;hq>DRfc#}8%pK56bWfnb+1&zP7{UcI9KVAD?e*t6ti5;6#i zJCRQ22A#~OZvfLM07Bx%jh8N`jb3E@g_LMTlt?9Erg#N-D5AAGzn2m8=$M)(d(n_I z^lOw{kl)4o*05n8vI2HjQotW#cV^RiV#`P71G|d}CCuPdx78Z{wm?=vb-Rp_Z^e!f zTZ%D_5@07q9&J#DzgH3TyZ~>E-svwZ9i^@V~_JYx)z6$AD=kB0p=>EyA=59UT5>He4h ks__4Q0GT!4u_|%qCMi5^s9g^Hkb~%Go;_7`(k|?O0Xp`D!T Date: Mon, 31 Aug 2020 16:08:05 +1000 Subject: [PATCH 4/4] add extra info for AAD example --- example/SeqEnableAAD/Program.cs | 4 ++-- example/SeqEnableAAD/README.md | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 example/SeqEnableAAD/README.md diff --git a/example/SeqEnableAAD/Program.cs b/example/SeqEnableAAD/Program.cs index 0935160..259a6e1 100644 --- a/example/SeqEnableAAD/Program.cs +++ b/example/SeqEnableAAD/Program.cs @@ -11,7 +11,7 @@ class Program const string Usage = @"seq-enable-aad: enable authentication on your Seq server (for initial setup of a new Seq server only). Usage: - seq-enable-aad.exe [--uname=] [--tenantid=] [--clientid=] [--clientkey=] (--authority=) + seq-enable-aad.exe --uname= --tenantid= --clientid= --clientkey= [--authority=] seq-enable-aad.exe (-h | --help) Options: @@ -43,7 +43,7 @@ static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.White; Console.BackgroundColor = ConsoleColor.Red; - Console.WriteLine("seq-enable-auth: {0}", ex); + Console.WriteLine("seq-enable-aad: {0}", ex); Console.ResetColor(); Environment.Exit(-1); } diff --git a/example/SeqEnableAAD/README.md b/example/SeqEnableAAD/README.md new file mode 100644 index 0000000..14c67af --- /dev/null +++ b/example/SeqEnableAAD/README.md @@ -0,0 +1,34 @@ +# Seq Enable AAD (Azure Active Directory) + +Be sure to read the [Seq Azure Active Directory documentation](https://docs.datalust.co/docs/azure-active-directory) to find the manual AAD setup instructions. + +## Example usage: + +``` +seq-enable-aad.exe https://seq.example.com --uname=example@microsoft.com --clientid=xxxxxx --tenantid=xxxxxx --clientkey=xxxxxx --authority=login.windows.net +``` + +### **Important note:** + +#### Windows + +Don't forget to set the "canonical URI" which Seq uses as a reply address for AAD. + +``` +seq config -k api.canonicalUri -v https://seq.example.com +seq service restart +``` + +#### Linux / Docker + +Don't forget to include the BASE_URI which Seq uses as a reply address for AAD. + +``` +docker run -d \ + --restart unless-stopped \ + --name seq \ + -p 5341:80 \ + -e ACCEPT_EULA=Y \ + -e BASE_URI=https://seq.example.com \ + datalust/seq:latest +``` \ No newline at end of file