def generate_unsafe_ingress_entry(ingress_entry: dict, unsafe_ip: str) -> dict:
    """
    Generates a dictionary from an unsafe ingress entry to the analysis
    response
    """
    unsafe_ingress = {
        "IpProtocol": ingress_entry["IpProtocol"],
        "CidrIp": unsafe_ip,
        "Status": "warning",
    }
    if "FromPort" in ingress_entry:
        unsafe_ingress["FromPort"] = ingress_entry["FromPort"]
    if "ToPort" in ingress_entry:
        unsafe_ingress["ToPort"] = ingress_entry["ToPort"]
    return unsafe_ingress