Checks/Aws/Test-Ec2InstancePortElasticsearchKibanaExposedToInternet.ps1

function Test-Ec2InstancePortElasticsearchKibanaExposedToInternet {
    <#
    .SYNOPSIS
        EC2 instance does not allow ingress from the Internet to Elasticsearch and Kibana ports (TCP 9200, 9300, 5601)

    .DESCRIPTION
        **EC2 instances** with **Elasticsearch/Kibana ports** (`9200`, `9300`, `5601`) exposed to the Internet through inbound security group rules.
        
        Assesses reachability considering instance public IP and subnet to reflect real exposure.

    .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_elasticsearch_kibana_exposed_to_internet

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