-
Notifications
You must be signed in to change notification settings - Fork 290
Using AsaLib
Gabe Stocco edited this page Apr 15, 2020
·
20 revisions
Search Nuget for Microsoft.CST.AttackSurfaceAnalyzer.
API Documentation is available at https://microsoft.github.io/AttackSurfaceAnalyzer/.
Setting up for using the database
DatabaseManager.Setup(dbPath);
For logging messages (optional)
Logger.Setup(false, true);
Strings.Setup();
Disable telemetry (optional)
AsaTelemetry.Setup(test: true);
You can perform collection and get the results in memory.
var fsc = new CertificateCollector();
fsc.Execute();
ConcurrentQueue<CollectObject> results = fsc.Results;
You can also choose to write the results to the database.
fsc.Results.AsParallel().ForAll(x => DatabaseManager.Write(x, FirstRunId));
while (DatabaseManager.HasElements)
{
Thread.Sleep(1);
}
Comparison is performed directly from the database.
BaseCompare bc = new BaseCompare();
if (!bc.TryCompare(FirstRunId, SecondRunId))
{
// Error while comparing
}
else
{
var results = bc.Results;
}