Skip to content

Commit

Permalink
Rewritten GUI (#533)
Browse files Browse the repository at this point in the history
* WIP Blazor Interface

* Namespace move

* Add Collector Options

* More Options Files

* Update Guided.razor

* WIP

* WIP

* Collecting through working

* Guided mode end to end

* Update Analysis Options Section to have a header

* Component breakdowns

* Update site.css

* Fix versioning

* Add GitHub Link

* Update Sidebar

* Glows

* Add Pages, Update Sidebar

* Update MainLayout.razor

* Redo Glow

* Finish gglowing

* Update NavMenu.razor

* Update top bar

* Update site.css

* Refactor Glow toggling

* Update Nav

* Update site.css

* Update site.css

* Update NavMenu.razor

* Update MainLayout.razor

* Add Options Card CSS

* Add FileCollector Options Card

* Improve FileCollector Directory Selection

* Fix glow on add/remove entries from selected directories

* Card-ify Rest Of Options

* Move Cards Into Containers

* Style Card Containers

* Update Options Panes

* Update Guided Styling, Move Containers

* Update checkbox sizes

* Update RunID Input Box

* Fix build break

* Respect UseTimestamp Checkbox

* Tone Down the Glow

* Update UserCollectorOptions.Razor

* Registry collector Add paths

* Update Title & Icon

* Fix Add/Removing selected directories in options

* Update Collector Titles

* Fix FileMonitor

* Fix Monitor mode analysis results showing

* Remove unneeded glow

* Remove old cli

* Guided Page Fixes

* Format Results

* Remove Results Counter HTML

* Add NoLaunch options to disable launching browser

* Remove old Cli references

* Update <p> Font

* Add Spinners

* Update FileCollectorOptions.razor

* Fix Options and Label Sizes

* Update RegistryCollectorOptions.razor

* Remove Random Div

* Build break fix

* Move Blazor to Cli

* Update Tests.csproj

* Implementes Analyze and Scan Pages

Report page is WIP.  Doesn't appear to be refreshing when needed to grab the right results.

Co-authored-by: David Alcantar <daalcant@microsoft.com>
  • Loading branch information
gfs and daalcant committed Aug 21, 2020
1 parent 6811914 commit 56ce87d
Show file tree
Hide file tree
Showing 197 changed files with 3,525 additions and 14,110 deletions.
10 changes: 5 additions & 5 deletions AttackSurfaceAnalyzer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "Benchmarks\Be
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "Tests\Tests.csproj", "{084DAC81-7495-4BF5-A3BE-0DC61F177245}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cli", "Cli\Cli.csproj", "{2BE92A57-DAEF-4D62-A5C3-B562F72DC6A2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cli", "Cli\Cli.csproj", "{0E5AE46A-897E-4FEC-897B-19ECEDD8BC88}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -44,10 +44,10 @@ Global
{084DAC81-7495-4BF5-A3BE-0DC61F177245}.Debug|Any CPU.Build.0 = Debug|Any CPU
{084DAC81-7495-4BF5-A3BE-0DC61F177245}.Release|Any CPU.ActiveCfg = Release|Any CPU
{084DAC81-7495-4BF5-A3BE-0DC61F177245}.Release|Any CPU.Build.0 = Release|Any CPU
{2BE92A57-DAEF-4D62-A5C3-B562F72DC6A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2BE92A57-DAEF-4D62-A5C3-B562F72DC6A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2BE92A57-DAEF-4D62-A5C3-B562F72DC6A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2BE92A57-DAEF-4D62-A5C3-B562F72DC6A2}.Release|Any CPU.Build.0 = Release|Any CPU
{0E5AE46A-897E-4FEC-897B-19ECEDD8BC88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E5AE46A-897E-4FEC-897B-19ECEDD8BC88}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E5AE46A-897E-4FEC-897B-19ECEDD8BC88}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E5AE46A-897E-4FEC-897B-19ECEDD8BC88}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 3 additions & 3 deletions Benchmarks/AsaDatabaseBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using AttackSurfaceAnalyzer.Objects;
using AttackSurfaceAnalyzer.Utils;
using Microsoft.CST.AttackSurfaceAnalyzer.Objects;
using Microsoft.CST.AttackSurfaceAnalyzer.Utils;
using System.Collections.Concurrent;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
public class AsaDatabaseBenchmark
{
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/CommitTest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using AttackSurfaceAnalyzer.Utils;
using Microsoft.CST.AttackSurfaceAnalyzer.Utils;
using BenchmarkDotNet.Attributes;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
[MarkdownExporterAttribute.GitHub]
[JsonExporterAttribute.Full]
Expand Down
2 changes: 1 addition & 1 deletion Benchmarks/CryptoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Security.Cryptography;
using System.Text;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
[MarkdownExporterAttribute.GitHub]
[JsonExporterAttribute.Full]
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/InsertTestsWithIntermittentTransactions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AttackSurfaceAnalyzer.Utils;
using Microsoft.CST.AttackSurfaceAnalyzer.Utils;
using BenchmarkDotNet.Attributes;
using System.Threading;
using System.Threading.Tasks;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
[MarkdownExporterAttribute.GitHub]
[JsonExporterAttribute.Full]
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/InsertTestsWithoutTransactions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AttackSurfaceAnalyzer.Utils;
using Microsoft.CST.AttackSurfaceAnalyzer.Utils;
using BenchmarkDotNet.Attributes;
using System.Threading;
using System.Threading.Tasks;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
[MarkdownExporterAttribute.GitHub]
[JsonExporterAttribute.Full]
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/LiteDbInsertTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AttackSurfaceAnalyzer.Utils;
using Microsoft.CST.AttackSurfaceAnalyzer.Utils;
using BenchmarkDotNet.Attributes;
using System.Threading;
using System.Threading.Tasks;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
[MarkdownExporterAttribute.GitHub]
[JsonExporterAttribute.Full]
Expand Down
6 changes: 3 additions & 3 deletions Benchmarks/LiteDbManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.
using AttackSurfaceAnalyzer.Objects;
using AttackSurfaceAnalyzer.Types;
using Microsoft.CST.AttackSurfaceAnalyzer.Objects;
using Microsoft.CST.AttackSurfaceAnalyzer.Types;
using LiteDB;
using Newtonsoft.Json;
using Serilog;
Expand All @@ -12,7 +12,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace AttackSurfaceAnalyzer.Utils
namespace Microsoft.CST.AttackSurfaceAnalyzer.Utils
{
public static class LiteDbManager
{
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/LiteDbQueryTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using AttackSurfaceAnalyzer.Utils;
using Microsoft.CST.AttackSurfaceAnalyzer.Utils;
using BenchmarkDotNet.Attributes;
using System.Collections.Concurrent;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
[MarkdownExporterAttribute.GitHub]
[JsonExporterAttribute.Full]
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/OpenTransactionTest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using AttackSurfaceAnalyzer.Utils;
using Microsoft.CST.AttackSurfaceAnalyzer.Utils;
using BenchmarkDotNet.Attributes;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
[MarkdownExporterAttribute.GitHub]
[JsonExporterAttribute.Full]
Expand Down
2 changes: 1 addition & 1 deletion Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using BenchmarkDotNet.Running;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
public class Program
{
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/QueryTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using AttackSurfaceAnalyzer.Utils;
using Microsoft.CST.AttackSurfaceAnalyzer.Utils;
using BenchmarkDotNet.Attributes;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
[MarkdownExporterAttribute.GitHub]
[JsonExporterAttribute.Full]
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/SetupTimeTest.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AttackSurfaceAnalyzer.Utils;
using Microsoft.CST.AttackSurfaceAnalyzer.Utils;
using BenchmarkDotNet.Attributes;
using System.Threading;
using System.Threading.Tasks;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
[MarkdownExporterAttribute.GitHub]
[JsonExporterAttribute.Full]
Expand Down
6 changes: 3 additions & 3 deletions Benchmarks/SystemSqliteDatabaseManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.
using AttackSurfaceAnalyzer.Objects;
using AttackSurfaceAnalyzer.Types;
using Microsoft.CST.AttackSurfaceAnalyzer.Objects;
using Microsoft.CST.AttackSurfaceAnalyzer.Types;
using Newtonsoft.Json;
using Serilog;
using System;
Expand All @@ -11,7 +11,7 @@
using System.Linq;
using System.Reflection;

namespace AttackSurfaceAnalyzer.Utils
namespace Microsoft.CST.AttackSurfaceAnalyzer.Utils
{
public static class SystemSQLiteDatabaseManager
{
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/SystemSqliteInsertTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AttackSurfaceAnalyzer.Utils;
using Microsoft.CST.AttackSurfaceAnalyzer.Utils;
using BenchmarkDotNet.Attributes;
using System.Threading;
using System.Threading.Tasks;

namespace AttackSurfaceAnalyzer.Benchmarks
namespace Microsoft.CST.AttackSurfaceAnalyzer.Benchmarks
{
[MarkdownExporterAttribute.GitHub]
[JsonExporterAttribute.Full]
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/SystemSqliteSqlConnectionHolder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using AttackSurfaceAnalyzer.Utils;
using Microsoft.CST.AttackSurfaceAnalyzer.Utils;
using Serilog;
using System;
using System.Collections.Concurrent;
Expand All @@ -8,7 +8,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace AttackSurfaceAnalyzer.Objects
namespace Microsoft.CST.AttackSurfaceAnalyzer.Objects
{
public class SystemSQLiteSqlConnectionHolder
{
Expand Down
1 change: 0 additions & 1 deletion Cli/.gitignore

This file was deleted.

11 changes: 11 additions & 0 deletions Cli/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<Router AppAssembly="@typeof(AttackSurfaceAnalyzerClient).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
51 changes: 51 additions & 0 deletions Cli/AppData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using Microsoft.CST.AttackSurfaceAnalyzer.Objects;
using System.Collections.Generic;

namespace Microsoft.CST.AttackSurfaceAnalyzer.Cli
{
public class AppData
{
public CollectCommandOptions CollectOptions { get; set; } = new CollectCommandOptions();
public MonitorCommandOptions MonitorOptions { get; set; } = new MonitorCommandOptions();
public ExportCollectCommandOptions ExportCollectCommandOptions { get; set; } = new ExportCollectCommandOptions();
public string FirstRunId
{
get
{
return $"{RunId}-before";
}
}

public string SecondRunId
{
get
{
return $"{RunId}-after";
}
}

public string MonitorRunId
{
get
{
return $"{RunId}-monitoring";
}
}

public string RunId { get; set; } = string.Empty;
public CompareCommandOptions CompareCommandOptions {
get
{
return new CompareCommandOptions(ExportCollectCommandOptions.FirstRunId, ExportCollectCommandOptions.SecondRunId)
{
ApplySubObjectRulesToMonitor = true,
AnalysesFile = RuleFile.LoadEmbeddedFilters(),
DatabaseFilename = ExportCollectCommandOptions.DatabaseFilename,
DisableAnalysis = ExportCollectCommandOptions.DisableAnalysis,
SaveToDatabase = ExportCollectCommandOptions.SaveToDatabase,
RunScripts = ExportCollectCommandOptions.RunScripts
};
}
}
}
}
Loading

0 comments on commit 56ce87d

Please sign in to comment.