Skip to content

bashirk/WUOP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Windows Update Orchestrator Project

A comprehensive Windows Update management system that provides enterprise-grade update orchestration with deployment ring support, rollback capabilities, and extensive telemetry.

Overview

The Windows Update Orchestrator (WUO) is a sophisticated update management system designed for enterprise environments. It provides:

  • Deployment Ring Management: Support for Stable, Beta, Dev, and Canary deployment rings
  • Update Orchestration: Intelligent update installation with rollback capabilities
  • Security & Validation: Cryptographic signature verification and secure download protocols
  • Comprehensive Telemetry: ETW events and Application Insights integration
  • PowerShell Management: Complete administrative control via PowerShell module
  • Cross-Platform Build: Support for both Windows and Unix build environments

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                    WUOrchestrator Service                      │
│  ┌─────────────────────────────────────────────────────────┐  │
│  │              C++ Win32 Service Core                     │  │
│  │  ┌─────────────┐ ┌─────────────┐ ┌──────────────┐     │  │
│  │  │Update Engine│ │Ring Manager │ │ETW Provider  │     │  │
│  │  └─────────────┘ └─────────────┘ └──────────────┘     │  │
│  └─────────────────────────────────────────────────────────┘  │
│                           │                                     │
└───────────────────────────┼─────────────────────────────────────┘
                            │
                            │ Named Pipe
                            │
┌───────────────────────────┼─────────────────────────────────────┐
│                           │                                     │
│  ┌────────────────────────▼─────────────────────────┐            │
│  │              C# Update Agent                       │            │
│  │  ┌─────────────┐ ┌─────────────┐ ┌────────┐  │            │
│  │  │Downloader   │ │Validator    │ │Installer│  │            │
│  │  └─────────────┘ └─────────────┘ └────────┘  │            │
│  └──────────────────────────────────────────────────┘            │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘
                            │
                            │ HTTPS
                            │
┌───────────────────────────┼─────────────────────────────────────┐
│                           ▼                                     │
│              Update Manifest Repository                         │
│  ┌─────────────────────────────────────────────────────────┐     │
│  │              JSON Manifest Format                       │     │
│  │  ┌─────────────┐ ┌─────────────┐ ┌──────────────┐  │     │
│  │  │Package Info │ │Prerequisites│ │Install Steps │  │     │
│  │  └─────────────┘ └─────────────┘ └──────────────┘  │     │
│  └─────────────────────────────────────────────────────────┘     │
└─────────────────────────────────────────────────────────────────┘

Components

1. WUOrchestrator Service (C++ Win32)

  • Location: src/orchestrator/WUOrchestratorService.cpp
  • Purpose: Core service that manages update orchestration
  • Features:
    • Windows Service integration with SCM
    • Named pipe server for IPC
    • ETW event provider
    • Deployment ring management
    • Update installation coordination

2. Update Agent (C#)

  • Location: src/agent/
  • Purpose: Handles actual update downloads, validation, and installation
  • Features:
    • Secure HTTPS downloads with certificate validation
    • Cryptographic signature verification
    • Update package installation and rollback
    • Application Insights telemetry
    • Configurable retry policies

3. PowerShell Management Module

  • Location: scripts/WUOrchestrator.psm1
  • Purpose: Administrative interface for managing the orchestrator
  • Features:
    • Service status monitoring
    • Deployment ring switching
    • Update installation control
    • Diagnostic log retrieval
    • Rollback testing capabilities

4. Update Manifests

  • Location: src/manifests/
  • Purpose: JSON-based update definitions
  • Features:
    • Cryptographic signatures
    • Prerequisite validation
    • Hardware requirements
    • Installation instructions
    • Rollback procedures

Deployment Rings

The system supports four deployment rings with increasing risk levels:

Ring Description Target Audience Update Frequency
Stable Production-ready updates General users Monthly
Beta Pre-release validation IT Pros Bi-weekly
Dev Development builds Developers Weekly
Canary Latest features Testers Daily

Quick Start

Prerequisites

  • Windows 10/11 (Build 19041 or later)
  • Visual Studio 2022 with C++ workload
  • .NET 6.0 SDK or later
  • PowerShell 5.1 or later
  • Administrator privileges

Build Instructions

Option 1: Windows Build (Recommended)

# Clone the repository
git clone https://github.com/bashirk/WUOP
cd WUOP

# Build the project
.\scripts\build.bat

# Install the service (requires admin)
.\scripts\install.bat

Option 2: Cross-Platform Build

# Build C# components only
./scripts/build.sh

# Note: C++ service requires Windows environment

Installation

  1. Run the installer (requires administrator privileges):

    .\scripts\install.bat
  2. Verify installation:

    Get-Service -Name "Windows Update Orchestrator"
  3. Check event logs:

    Get-WinEvent -LogName "WUOrchestrator/Operational" -MaxEvents 10

Configuration

Service Configuration

The orchestrator service reads configuration from the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WUOrchestrator
├── DeploymentRing (REG_SZ) - Current ring: Stable/Beta/Dev/Canary
├── ManifestURL (REG_SZ) - Update manifest repository
├── UpdateInterval (REG_DWORD) - Check interval in minutes
├── EnableTelemetry (REG_DWORD) - Telemetry enabled: 0/1
└── LogLevel (REG_DWORD) - Logging level: 0-4

Update Agent Configuration

The C# agent uses appsettings.json:

{
  "AgentConfiguration": {
    "UpdateCheckInterval": 3600,
    "MaxConcurrentDownloads": 3,
    "DownloadTimeout": 1800,
    "InstallationTimeout": 3600
  },
  "Security": {
    "RequireSignatureValidation": true,
    "TrustedPublishers": ["Microsoft Corporation", "Intel Corporation"]
  }
}

Usage

PowerShell Module Commands

# Import the module
Import-Module .\scripts\WUOrchestrator.psm1

# Check service status
Get-WUOrchStatus

# Switch deployment ring
Set-WUOrchRing -Ring "Beta"

# Trigger update check
Invoke-WUOrchCommand -Command "CheckForUpdates"

# Get recent logs
Get-WUOrchLogs -MaxEvents 50

# Test rollback functionality
Test-WUOrchRollback -PackageId "KB5034123"

# Restart the service
Restart-WUOrchService

Service Management

# Start the service
Start-Service -Name "Windows Update Orchestrator"

# Stop the service
Stop-Service -Name "Windows Update Orchestrator"

# Check service status
Get-Service -Name "Windows Update Orchestrator"

Telemetry and Monitoring

ETW Events

The service provides comprehensive ETW events for monitoring:

  • Operational Channel: Service operations and update lifecycle
  • Admin Channel: Administrative events and configuration changes
  • Debug Channel: Detailed debugging information
  • Analytic Channel: Performance metrics and analytics

Performance Counters

Custom performance counters track:

  • Manifest download rate
  • Update installation success rate
  • Active update sessions
  • Failed update attempts
  • Average update duration
  • Ring switch frequency
  • Rollback operations

Application Insights

The C# agent sends telemetry to Application Insights:

  • Update installation metrics
  • Download performance
  • Error rates and types
  • User experience data
  • System health indicators

Security Features

Cryptographic Validation

  • Manifest Signatures: All update manifests are cryptographically signed
  • Package Verification: Update packages include SHA256 checksums
  • Certificate Validation: HTTPS downloads with certificate chain validation
  • Publisher Verification: Trusted publisher validation

Access Control

  • Service Permissions: Runs as LocalSystem with restricted permissions
  • Named Pipe Security: Secure IPC with authentication
  • Registry Protection: Configuration stored in protected registry keys
  • File System Security: Secure file operations with proper ACLs

Troubleshooting

Common Issues

  1. Service won't start

    # Check event logs
    Get-WinEvent -LogName "System" -MaxEvents 50 | Where-Object {$_.Id -eq 7034}
    
    # Verify dependencies
    sc.exe qc "Windows Update Orchestrator"
  2. Update installation failures

    # Check operational logs
    Get-WinEvent -LogName "WUOrchestrator/Operational" -MaxEvents 20
    
    # Test manifest validation
    Test-WUOrchManifestValidation -ManifestPath "path\to\manifest.json"
  3. Network connectivity issues

    # Test manifest download
    Test-WUOrchManifestDownload -ManifestURL "https://example.com/manifest.json"
    
    # Check proxy settings
    netsh winhttp show proxy

Diagnostic Commands

# Comprehensive health check
Test-WUOrchHealth

# Network connectivity test
Test-WUOrchNetwork

# Service dependencies check
Test-WUOrchDependencies

# Performance baseline
Get-WUOrchPerformanceMetrics

Development

Building from Source

  1. Clone the repository

    git clone <repository-url>
    cd WUOP
  2. Build the project

    # Windows build
    .\scripts\build.bat
    
    # Cross-platform build (C# only)
    ./scripts/build.sh
  3. Run tests

    # PowerShell tests
    Invoke-Pester .\scripts\tests\
    
    # C# unit tests
    dotnet test src\agent\tests\

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

Uninstallation

To completely remove the Windows Update Orchestrator:

# Run the uninstaller (requires admin)
.\scripts\uninstall.bat

This will:

  • Stop and remove the service
  • Remove registry entries
  • Delete installed files
  • Unregister ETW manifest
  • Remove PowerShell module

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

For issues and questions:

  • Check the troubleshooting section
  • Review event logs
  • Submit issues to the project repository
  • Contact your system administrator

Version History

v1.0.0 (Current)

  • Initial release
  • C++ Win32 service implementation
  • C# Update Agent
  • PowerShell management module
  • ETW telemetry integration
  • Deployment ring support
  • Rollback capabilities

Note: This is an enterprise-grade update management system. Always test in a non-production environment before deploying to production systems.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published