ECS instance has endpoint protection installed
Alibaba Cloud Security Center provides endpoint protection for ECS instances with real-time detection and removal of malicious software. This check verifies the Security Center agent is installed and active on all ECS instances, ensuring alerts notify administrators when malicious software attempts to install or execute.
Risk
ECS instances without endpoint protection are vulnerable to malware, viruses, webshells, and other security threats that can compromise confidentiality, integrity, and availability. Without real-time monitoring, security incidents may go undetected, allowing attackers to maintain persistent access and exfiltrate sensitive data.
Run this check with Prowler
Run in Prowler Cloudprowler alibabacloud --checks ecs_instance_endpoint_protection_installedRecommendation
Install the Alibaba Cloud Security Center agent on all ECS instances to enable real-time endpoint protection, malware detection, and vulnerability scanning.
Remediation
CLI
aliyun sas InstallBackupClient --Uuid <instance_uuid>Other
Check Code
from prowler.lib.check.models import Check, CheckReportAlibabaCloud
from prowler.providers.alibabacloud.services.ecs.ecs_client import ecs_client
from prowler.providers.alibabacloud.services.securitycenter.securitycenter_client import (
securitycenter_client,
)
class ecs_instance_endpoint_protection_installed(Check):
"""Check if endpoint protection for all Virtual Machines is installed."""
def execute(self) -> list[CheckReportAlibabaCloud]:
findings = []
# Check each ECS instance for Security Center agent
for instance in ecs_client.instances:
# Only check running instances
if instance.status.lower() not in ["running", "starting"]:
continue
report = CheckReportAlibabaCloud(
metadata=self.metadata(), resource=instance
)
report.region = instance.region
report.resource_id = instance.id
report.resource_arn = f"acs:ecs:{instance.region}:{ecs_client.audited_account}:instance/{instance.id}"
# Check if Security Center agent is installed
instance_key = f"{instance.region}:{instance.id}"
agent = securitycenter_client.instance_agents.get(instance_key)
if agent:
if agent.agent_installed and agent.agent_status == "online":
report.status = "PASS"
report.status_extended = (
f"ECS instance {instance.name if instance.name else instance.id} "
"has Security Center agent installed and online."
)
else:
report.status = "FAIL"
report.status_extended = (
f"ECS instance {instance.name if instance.name else instance.id} "
f"does not have Security Center agent installed or agent is {agent.agent_status}."
)
findings.append(report)
return findings