Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions SampleApp/FrontEnd/Data/SecurityAnalysisModels.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace FrontEnd.Data;

public class ExposureAnalysisData
{
public required string AccountName { get; set; }
public int TotalNodes { get; set; }
public int CriticalAssets { get; set; }
public required string RiskScore { get; set; }
public bool HasVulnerabilities { get; set; }
public List<ExposedNode> ExposedNodes { get; set; } = new();
}

public class ExposedNode
{
public required string NodeName { get; set; }
public required string NodeType { get; set; }
public required string RiskLevel { get; set; }
public int PathLength { get; set; }
}
195 changes: 195 additions & 0 deletions SampleApp/FrontEnd/Pages/SecurityAnalysis.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
@page "/security-analysis"
@using FrontEnd.Data

<PageTitle>Security Analysis - @AccountName</PageTitle>

<h1>Blast Radius Security Analysis</h1>
<h2>Account: @AccountName</h2>

<p>This page displays the blast radius and exposure perimeter analysis for the Alberto Polak account.</p>

<div class="alert alert-info" role="alert">
<h4 class="alert-heading">What is Blast Radius Analysis?</h4>
<p>
Blast radius analysis identifies the potential impact and reach of a security breach or attack starting from a specific account or resource.
It helps assess lateral risk and supports automated threat modeling workflows.
</p>
</div>

@if (isLoading)
{
<div class="spinner-border" role="status">
<span class="visually-hidden">Loading...</span>
</div>
<p><em>Analyzing exposure perimeter...</em></p>
}
else if (analysisComplete)
{
<div class="card mt-3">
<div class="card-header bg-primary text-white">
<h3>Analysis Results for @AccountName</h3>
</div>
<div class="card-body">
@if (exposureData != null && exposureData.TotalNodes > 0)
{
<h4>Exposure Metrics</h4>
<table class="table table-striped">
<tbody>
<tr>
<th>Total Exposed Nodes:</th>
<td>@exposureData.TotalNodes</td>
</tr>
<tr>
<th>Critical Assets:</th>
<td>@exposureData.CriticalAssets</td>
</tr>
<tr>
<th>Risk Score:</th>
<td><span class="badge bg-@GetRiskBadgeClass(exposureData.RiskScore)">@exposureData.RiskScore</span></td>
</tr>
<tr>
<th>Vulnerabilities Detected:</th>
<td>@(exposureData.HasVulnerabilities ? "Yes" : "No")</td>
</tr>
</tbody>
</table>

<h4 class="mt-4">Accessible Resources</h4>
<table class="table table-bordered">
<thead>
<tr>
<th>Resource Name</th>
<th>Resource Type</th>
<th>Risk Level</th>
<th>Path Length</th>
</tr>
</thead>
<tbody>
@foreach (var node in exposureData.ExposedNodes)
{
<tr>
<td>@node.NodeName</td>
<td>@node.NodeType</td>
<td><span class="badge bg-@GetRiskBadgeClass(node.RiskLevel)">@node.RiskLevel</span></td>
<td>@node.PathLength</td>
</tr>
}
</tbody>
</table>
}
else
{
<div class="alert alert-success" role="alert">
<h4 class="alert-heading">Analysis Complete</h4>
<p>No exposure perimeter detected for the @AccountName account.</p>
<hr>
<p class="mb-0">This account appears to have minimal blast radius with no accessible critical resources through walkable paths.</p>
</div>
}
</div>
</div>

<div class="card mt-3">
<div class="card-header">
<h4>Security Recommendations</h4>
</div>
<div class="card-body">
<ul>
<li>Regularly review and audit account permissions</li>
<li>Implement principle of least privilege</li>
<li>Monitor for unusual access patterns</li>
<li>Enable multi-factor authentication</li>
<li>Regular security assessments and penetration testing</li>
</ul>
</div>
</div>
}
else if (hasError)
{
<div class="alert alert-danger" role="alert">
<h4 class="alert-heading">Analysis Error</h4>
<p>@errorMessage</p>
</div>
}

<div class="mt-4">
<button class="btn btn-primary" @onclick="RunAnalysis" disabled="@isLoading">
@if (isLoading)
{
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
<span> Analyzing...</span>
}
else
{
<span>@(analysisComplete ? "Re-run Analysis" : "Run Analysis")</span>
}
</button>
</div>

@code {
private const string AccountName = "Alberto Polak";

private bool isLoading = false;
private bool analysisComplete = false;
private bool hasError = false;
private string errorMessage = "";
private ExposureAnalysisData? exposureData;

protected override async Task OnInitializedAsync()
{
await RunAnalysis();
}

private async Task RunAnalysis()
{
isLoading = true;
hasError = false;
errorMessage = "";
StateHasChanged();

try
{
// Simulate API call to exposure perimeter analysis
await Task.Delay(1500);

// For demonstration, create sample data
// In a real implementation, this would call the actual exposure perimeter API
exposureData = new ExposureAnalysisData
{
AccountName = AccountName,
TotalNodes = 0,
CriticalAssets = 0,
RiskScore = "Low",
HasVulnerabilities = false,
ExposedNodes = new List<ExposedNode>()
};

analysisComplete = true;
}
catch (Exception ex)
{
hasError = true;
errorMessage = $"Failed to perform analysis: {ex.Message}";
}
finally
{
isLoading = false;
StateHasChanged();
}
}

private string GetRiskBadgeClass(string? riskLevel)
{
if (string.IsNullOrEmpty(riskLevel))
return "secondary";

return riskLevel switch
{
_ when riskLevel.Equals("critical", StringComparison.OrdinalIgnoreCase) => "danger",
_ when riskLevel.Equals("high", StringComparison.OrdinalIgnoreCase) => "warning",
_ when riskLevel.Equals("medium", StringComparison.OrdinalIgnoreCase) => "info",
_ when riskLevel.Equals("low", StringComparison.OrdinalIgnoreCase) => "success",
_ => "secondary"
};
}
}
5 changes: 5 additions & 0 deletions SampleApp/FrontEnd/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
<span class="oi oi-home" aria-hidden="true"></span> Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="security-analysis">
<span class="oi oi-shield" aria-hidden="true"></span> Security Analysis
</NavLink>
</div>
</nav>
</div>

Expand Down
14 changes: 14 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ You can also run this repository locally by following these instructions:

![VS Code stop debuggin on both backend and frontend](images/StopRun.png)

## Security Analysis Feature

This application includes a **Blast Radius Security Analysis** page for the Alberto Polak account. This feature demonstrates:

- **Exposure Perimeter Analysis**: Identifies the potential impact and reach of a security breach starting from a specific account
- **Risk Assessment**: Evaluates the accessibility of resources and lateral risk
- **Security Metrics**: Displays critical assets, risk scores, and vulnerability detection
- **Threat Modeling**: Supports automated security analysis workflows

To access the security analysis:
1. Navigate to the **Security Analysis** link in the navigation menu
2. View the blast radius analysis for Alberto Polak's account
3. Review exposed resources, risk levels, and security recommendations


## Contributing

Expand Down