An open API service indexing awesome lists of open source software.

https://github.com/soyuz43/ftype-audit-safe

Safe PowerShell tool for auditing and repairing Windows file type associations with backup, dry-run, and signature support.
https://github.com/soyuz43/ftype-audit-safe

audit automation code-signing file-association infosec powershell registry secure-scripting windows

Last synced: about 1 month ago
JSON representation

Safe PowerShell tool for auditing and repairing Windows file type associations with backup, dry-run, and signature support.

Awesome Lists containing this project

README

        

# ๐Ÿ” FtypeAudit โ€” Safe File Association Analyzer

FtypeAudit is a hardened, security-aware PowerShell utility for **auditing**, **explaining**, and **repairing** Windows file association conflicts. It maps the semantic layers of the registry (UserChoice, SystemDefault, MRUList) while enforcing safety-first principles with optional backup and dry-run modes.

---

## Features

- **Audit file type handlers** using a structured `SafeAssociationProfile` model
- **Safe registry mutation** with dry-run simulation and optional `.reg` backup
- **Explain mode** interprets conflicts in user vs. system behavior
- **Literal mode** gives you raw technical diagnostic data
- **Force mode** enables controlled registry repair (with backup or preview)

---

## ๐Ÿ›  Usage

### Basic Audit

```powershell
.\ftype-audit.ps1 .json
```

Dry Run (No Changes)
```
.\ftype-audit.ps1 .txt -DryRun
```
Backup Before Repair
```
.\ftype-audit.ps1 .docx -Backup -Force
```
Technical Report
```
.\ftype-audit.ps1 .html -Literal
```
Explanation of Layers
```
.\ftype-audit.ps1 .md -Explain
```
#### Parameters
Parameter Description
-Path File or extension to analyze (e.g., .txt, C:\file.pdf)
-DryRun Preview changes without writing to registry
-Backup Create .reg backup before making any changes
-BackupPath Custom path for registry backup file
-Force Skip confirmation prompt (used with actual registry changes)
-Explain Display analysis of file association conflicts
-Literal Output raw technical details only
-Help Show usage instructions
๐Ÿงพ Output

Example technical report:
```plaintext

[Technical Analysis: .txt]
----------------------------------------
User Choice ProgID: txtfile
System Default: txtfile
MRU List Validity: Valid

Handler Inventory:
a: NOTEPAD.EXE [OK]
b: Code.exe [MISSING]
```

#### ๐Ÿ” Security & Signing

This script supports safe execution in locked-down environments:

Complies with AllSigned policies if digitally signed

Use your enterprise code-signing certificate:
```
$cert = Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigningCert
Set-AuthenticodeSignature -FilePath .\ftype-audit.ps1 -Certificate $cert
```
#### Module Packaging

To install as a reusable module:

- Rename script to `FtypeAudit.psm1`

+ Create a manifest:
```
New-ModuleManifest -Path .\FtypeAudit.psd1 `
-RootModule 'FtypeAudit.psm1' `
-FunctionsToExport '*' `
-Author 'Your Name' `
-Description 'Safe file association analyzer and repair tool'
```
- Import as needed:
```
Import-Module .\FtypeAudit.psd1
```