Repository navigation
database-monitoring: run Elastio's encryption detector beside the agent (content_analysis) - #125
Conversation
…nt (content_analysis) Opt-in content_analysis runs ED as a second, non-essential container in the agent's ARM64 task, as the agent's user, on loopback, reading a task-local scratch volume at the same path. ED takes 384 MiB (measured 158 idle, 231 after a window); the agent gets the rest and GOMEMLIMIT follows its share. Needs task_memory >= 1024. Defaults move to agent 0.1.7 and its ED image. Module 0.2.0. Tracking: elastio/blue-stack#17198
| command = [ | ||
| "--host", "127.0.0.1", | ||
| "--port", tostring(local.ed_port), | ||
| "--metrics-port", tostring(local.ed_port + 1), |
There was a problem hiding this comment.
@anchoo2kewl which ED server does the image run, Python or Rust?
Is the metrics port also on loopback only?
The Rust server binds metrics to --host, so it is fine.
The Python server calls start_http_server(port) with no address, so it listens on 0.0.0.0.
If it is Python, 50052 is open on the task ENI to anything the security group lets in.
Then we can fix it in ED by passing the host, or change the "loopback only" comment and say that the security group must block the port.
There was a problem hiding this comment.
It's the Python server: the image is ED's own Dockerfile at 624e66b, which ships grpc_server. You're right about metrics. On the image with these flags, 50051 is on 127.0.0.1 and 50052 is on 0.0.0.0, from start_http_server(port) in grpc_server/metrics.py. ED master has the same line. I've fixed the comment and README in 1146458: the metrics port is on all interfaces, so the security groups must not allow inbound 50052 (the agent needs no inbound rules; UAT's task SG has none). I'll open the one-line fix in elastio/ed to bind metrics to --host, and we pick it up with the next pin bump.
There was a problem hiding this comment.
@maksvet the ED fix is open: elastio/ed#42. It binds the Prometheus metrics server to --host (and serves the collector's own registry). I built the image from that branch and ran it with this module's flags: 50051 and 50052 are both on 127.0.0.1. Once it merges, the pin bump comes through as a Dependabot PR on elastio/database-monitoring-agent (third_party/ed), and CI tests it. Until then, the README says the security groups must not allow inbound 50052. Noted on merge order: after agent 0.1.7 is released and the ED ECR repo exists.
… keeps it in Review (maksvet): ED's Python server starts Prometheus with start_http_server(port) and no address, so --host does not bind it. Verified on the image: 50051 on 127.0.0.1, 50052 on 0.0.0.0.
Tracking: elastio/blue-stack#17198
What changed
Adds
content_analysis(default false) toaws-elastio-database-monitoring-agentand bumps the module to 0.2.0.With it on, Elastio's encryption detector (ED) runs as a second container in the agent's task:
ed_image, built by elastio/database-monitoring-agent from its pinnedelastio/edcommit for arm64 and amd64. The task stays ARM64.127.0.0.1:50051, loopback only./var/lib/elastio-dbmon-ed, read-only, mounted at the same path as in the agent, which writes it. It is never EFS.restartPolicybrings ED back.GOMEMLIMITis 80% of that share, not of the task.content_analysisneedstask_memory >= 1024, enforced by a validation.Defaults move to agent 0.1.7 and
elastio-database-monitoring-ed:0.1.7. Withcontent_analysis = falsethe task definition is unchanged apart from the image tag.Order
Merge after agent 0.1.7 is released. The new default image tags only exist once
agent-v0.1.7is tagged, and the ED image also needs the ECR repo from elastio/infraworld#2399. The agent change is elastio/database-monitoring-agent#5.Verified
terraform fmt -check,terraform validate, andterraform test: 17/17, 3 of them new:GOMEMLIMITis 512MiB, andELASTIO_DBMON_ED_ADDRis set;task_memory = 512withcontent_analysisis refused.GOMEMLIMITback to 80% of the task fails the "on" run.terraform-docs0.19.0 plus prettier regenerated the README, so the terraform-docs job has no diff.--workers 1and passed the agent's gRPC contract tests.Not verified