🛡️

cWAP

DSC resources for managing Windows Server Web Application Proxy (WAP) and publishing applications with declarative PowerShell configurations.

3 Stars
⬇️ 1,024 Downloads
🏷️ v0.4.0 Version
📜 MIT License
Install: Install-Module -Name cWAP
⬇️ PowerShell Gallery View on GitHub

Documentation

Overview

cWAP is a PowerShell DSC module for configuring and managing Windows Server Web Application Proxy (WAP). It lets you describe WAP setup and published applications declaratively, then enforce that desired state consistently across environments.

The module exports two DSC resources:

  • cWAPConfiguration for WAP server and federation settings
  • cWAPWebsite for published application definitions

Installation

Install from the PowerShell Gallery:

# Install for current user
Install-Module -Name cWAP -Scope CurrentUser

# Import
Import-Module cWAP

Quick Start

Use cWAP in a DSC configuration to install and configure WAP, then publish applications.

Configuration ConfigureWap {
    param(
        [PSCredential]$FederationCredential,
        [string]$FederationServiceName,
        [string]$CertificateThumbprint,
        [string]$ExternalUrl,
        [string]$BackendServerUrl
    )

    Import-DscResource -ModuleName cWAP

    Node localhost {
        cWAPConfiguration WapBaseConfig {
            Ensure                = "Present"
            FederationServiceName = $FederationServiceName
            Credential            = $FederationCredential
            CertificateThumbprint = $CertificateThumbprint
            HttpsPort             = 443
            TlsClientPort         = 49443
        }

        cWAPWebsite PublishedApp {
            Ensure                        = "Present"
            ApplicationName               = "Contoso App"
            BackendServerUrl              = $BackendServerUrl
            ExternalCertificateThumbprint = $CertificateThumbprint
            ExternalUrl                   = $ExternalUrl
            ExternalPreauthentication     = "ADFS"
            DependsOn                     = "[cWAPConfiguration]WapBaseConfig"
        }
    }
}

DSC Resources

cWAPConfiguration

Configures the Web Application Proxy role connection to ADFS and related WAP settings.

PropertyTypeRequiredDescription
EnsurePresent/AbsentNoWhether WAP configuration should exist
FederationServiceNamestringYes (key)ADFS service name (for example adfs.contoso.com)
CredentialPSCredentialYesDomain admin credential used to register WAP
CertificateThumbprintstringYesCertificate thumbprint bound to the federation service
ForwardProxystringNoOptional outbound proxy in FQDN:Port format
HttpsPortintNoHTTPS listener port, default 443
TlsClientPortintNoTLS client auth port, default 49443
ADFSTokenAcceptanceDurationSecintNoOptional ADFS token acceptance duration
UserIdleTimeoutSecintNoOptional user idle timeout
UserIdleTimeoutActionstringNoIdle timeout action, for example Signout

cWAPWebsite

Defines and maintains published applications behind WAP.

PropertyTypeRequiredDescription
EnsurePresent/AbsentYesWhether the published app should exist
ApplicationNamestringYesDisplay name for the WAP application
BackendServerUrlstringYes (key)Internal URL of the backend application
ExternalCertificateThumbprintstringYesExternal certificate thumbprint
ExternalUrlstringYesPublic URL for client access
ExternalPreauthenticationstringNoPre-auth mode, defaults to ADFS
ADFSRelyingPartyNamestringNoRelying party name when using ADFS
BackendServerAuthenticationModestringNoBackend auth mode
EnableHTTPRedirectboolNoEnable HTTP to HTTPS redirect

Validation Helper

The module also exposes Test-sslBinding, a helper function used to validate certificate binding state.

Import-Module cWAP

$ok = Test-sslBinding -port 443 -certificateThumbprint "0123456789ABCDEF0123456789ABCDEF01234567"
if ($ok) {
    Write-Host "SSL binding is configured correctly"
}

When to Use cWAP

  • You manage WAP infrastructure with DSC and want repeatable configuration.
  • You need idempotent publishing of multiple ADFS pre-authenticated applications.
  • You want WAP settings to be source-controlled and deployable through CI/CD.

Contributing

Contributions are welcome. See the GitHub repository for source, issues, and pull requests.


License

cWAP is released under the MIT License.

Related Blog Posts