Checks/Aws/Test-Ec2InstancePortLdapExposedToInternet.ps1

function Test-Ec2InstancePortLdapExposedToInternet {
    <#
    .SYNOPSIS
        EC2 instance does not allow ingress from the Internet to TCP ports 389 or 636 (LDAP/LDAPS)

    .DESCRIPTION
        **EC2 instances** with security groups permitting Internet-sourced access to **LDAP** on `TCP 389` or **LDAPS** on `TCP 636` are identified.
        
        Public exposure context (presence of public IP and subnet reachability) is considered to gauge how broadly these ports can be accessed.

    .PARAMETER Check
        CIEMCheck object containing check metadata.
    #>

    [CmdletBinding()]
    [OutputType([PSCustomObject[]])]
    param(
        [Parameter(Mandatory)]
        [CIEMCheck]$Check
    )

    $ErrorActionPreference = 'Stop'

    # TODO: Implement check logic based on Prowler check: ec2_instance_port_ldap_exposed_to_internet

    [CIEMScanResult]::Create($Check, 'MANUAL', 'This check requires manual implementation. See Prowler check ec2_instance_port_ldap_exposed_to_internet for reference.', 'N/A', 'ec2 Resources')
}