feat(nrdot-mssql): add debian.yml/rhel.yml recipes for Linux SQL Server monitoring - #1412
feat(nrdot-mssql): add debian.yml/rhel.yml recipes for Linux SQL Server monitoring#1412RamanaReddy8801 wants to merge 26 commits into
Conversation
|
It looks like SA_PASSWORD and a few other vars are getting inserted straight into the script text using The |
|
One more thing — in if [ -z "{{.NR_CLI_MSSQL_LOGIN_PASSWORD}}" ]; then
NR_PASSWORD=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 24)
else
NR_PASSWORD="{{.NR_CLI_MSSQL_LOGIN_PASSWORD}}"
fi
Not a security issue, just dead code right now. The inputVars:
- name: NR_CLI_RABBITMQ_PASSWORD
prompt: "RabbitMQ password: "
secret: trueIt's declared in If a custom password isn't actually needed, simplest is to just drop the |
| printf '%s' "$NR_PASSWORD" > "$PW_FILE" | ||
| chmod 600 "$PW_FILE" | ||
|
|
||
| cat > "$SQL_FILE" << EOF |
There was a problem hiding this comment.
Similar issue as the config file, but on SQL_FILE="/tmp/nr-mssql-grant.sql" (same in both debian.yml and rhel.yml): it's written with the new monitoring password in plain text but never gets chmod 600 like PW_FILE does — so it's readable by any user on the box. Worse, if sqlcmd fails, the script exits before rm -f "$SQL_FILE" ever runs, so the file (with the password) is left behind permanently.
Could you add chmod 600 "$SQL_FILE" right after it's written, and clean up both temp files even on failure (e.g. a trap ... EXIT)? Or use mktemp instead of a fixed name — other recipes here (agent-control, PHP agent) already do that, and it gets you 600 perms + an unguessable filename in one step.
There was a problem hiding this comment.
Fixed in both debian.yml and rhel.yml. Went with mktemp for SQL_FILE (unguessable name + 600 perms in one step, as you suggested), plus a trap cleanup EXIT that removes it on every exit path — including a failed sqlcmd run.
…on with self-hosted recipes
…stead of feeding garbage to rpm/dpkg
Jira Ticket: https://new-relic.atlassian.net/browse/NR-595360
Summary
recipes/newrelic/infrastructure/nrdot/mssql-otel/debian.ymlandrhel.yml— New Relic CLI install recipes for monitoring Microsoft SQL Server on Linux via the NRDOT OpenTelemetry collector, driven from https://docs.newrelic.com/docs/opentelemetry/database/mssql/linux-hosted/I’ve attached the test [documentation] covering several key integration scenarios for your review.