Attack Surface Analyzer

repository·main·Indexed 25 days ago

https://github.com/microsoft/attacksurfaceanalyzer

An open-source security tool by Microsoft that analyzes a target system's attack surface by comparing system states before and after software installation. It identifies vulnerabilities and misconfigurations across components including the file system, registry, network ports, services, and user accounts. The tool provides a CLI and a Blazor-based GUI, supports automated Guided Mode for baseline and monitoring workflows, and can export analysis results to SARIF or JSON formats.

Tokens
5.7K
Snippets
12
Records
47
Agent score
81%

What's inside Attack Surface Analyzer

  1. Overview of Attack Surface Analyzer Features

    main

    Attack Surface Analyzer (ASA) analyzes the security configuration of an operating system by "diffing" the state before and after software installation. It identifies potential vulnerabilities introduced by system misconfigurations or elevated privilege requirements during installation.

    Monitored Components

    ASA reports on changes to:

    • File system (static snapshot and live monitoring)
    • User accounts
    • Services
    • Network Ports
    • Certificates
    • Registry
    • COM Objects
    • Event Logs
    • Firewall Settings
    • Wifi Networks
    • Cryptographic Keys
    • Processes
    • TPM Information

    All collected data is stored in local SQLite databases.

  2. Install pre-requisites for building Attack Surface Analyzer

    main

    To build Attack Surface Analyzer, you must install the following dependencies:

    • .NET Core SDK 5.0 (or later).
    • GitVersioning: Install this globally using the dotnet tool command.

    If you intend to build the GUI component, ensure that the ASP.NET Components workload is selected during your Visual Studio installation; otherwise, the project will fail to open.

    dotnet tool install -g nbgv
  3. Use Open Iconic SVG Sprites

    main

    The SVG sprite allows you to load all icons in a single request. To use an icon, reference the specific ID within the open-iconic.svg file using the <use> tag.

    Styling Tips:

    • Sizing: Set equal width and height on the <svg> tag.
    • Coloring: Use the CSS fill property on the <use> tag to change the icon color.
    <svg class="icon">
      <use xlink:href="open-iconic.svg#account-login" class="icon-account-login"></use>
    </svg>
    
    <style>
    .icon {
      width: 16px;
      height: 16px;
    }
    
    .icon-account-login {
      fill: #f00;
    }
    </style>
  4. Build a Debug version of a component

    main

    To build a debug version of a component (such as Cli or Gui), navigate to the appropriate project directory and use the dotnet build command with the Debug configuration. Note that dotnet build is only supported with the Debug configuration.

    dotnet build -c Debug
  5. Install Attack Surface Analyzer

    main

    You can install Attack Surface Analyzer using the .NET SDK via the dotnet tool command. Alternatively, platform-specific binaries are available on the GitHub releases page.

    Linux and Docker Installation

    Because ASA is built on .NET, you must ensure that the necessary .NET Linux dependencies are installed on your system.

    When using Docker, use a base image that includes the .NET SDK (such as the official microsoft-dotnet-sdk image) and install the tool within your Dockerfile.

    dotnet tool install -g Microsoft.CST.AttackSurfaceAnalyzer.CLI