Skip to content

fix: Harden ama-logs ConfigMap handling - #1828

Open
Grace Wehner (gracewehner) wants to merge 7 commits into
ci_prodfrom
grwehner/clean-ama-logs-draft-pr
Open

Grace Wehner (gracewehner) wants to merge 7 commits into
ci_prodfrom
grwehner/clean-ama-logs-draft-pr

Conversation

@gracewehner

@gracewehner Grace Wehner (gracewehner) commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Validate agent durations, multi-tenant settings and OSM namespaces before generating configuration.
  • Validate telegraf inputs
  • Safely write Linux configuration-version metadata and report bounded environment-reference names.

Validation

  • Ruby parser/service tests and shell syntax checks passed locally.
  • Telegraf parser run passed 53 runs and 872 assertions with no skips.

Backdoor Testing Scenarios

Fix Scenario tested and result
Duration validation Valid tail_ignore_older values survived; a value with a newline and command was rejected without execution.
Valid network-flow throttle intervals survived; a multiline value was rejected and fell back to 1s.
Fluent Bit tenant configuration Valid namespaces were trimmed, lowercased and deduplicated; invalid namespaces were rejected
Valid global and per-namespace settings, including storage, buffers, throttling, retry and acknowledgement settings, were preserved. Unknown keys and values containing control-character breakouts were rejected or defaulted
Invalid service buffer sizes fell back to 10m/30m; the pods started with those safe values
Valid tenant configuration started forwarding workers with acknowledgements and delivered synthetic logs to the workspace from Linux and both Windows hosts
Linux metadata serialization Command-like agent schema, config-version and OSM schema values remained literal during startup and later sourcing; no command marker was created
An unsupported schema followed the existing disabled/default fallback rather than executing its contents.
Fix Scenario tested and result
Telegraf environment allowlist Env Vars still rendered rendered in both $NAME and ${NAME} forms for prometheus scraping
Only agent-owned structural placeholders were resolved before strict Telegraf validation; customer values remained quoted. Default, custom and process-metrics launch paths used strict handling.
A ConfigMap-derived carrier and a malicious fielddrop value did not create an inputs.exec plugin or execute the marker.
Telegraf OSM namespace validation Valid monitor namespaces remained configured; an invalid namespace attempting to add a Telegraf plugin was skipped. Linux sidecar and ReplicaSet paths were exercised.
Existing TOML-serialization fix, regression rerun Breakouts through fielddrop were checked for Linux DaemonSet, ReplicaSet, sidecar and Windows rendering.
Compatibility Unfiltered, empty-filter and selected-namespace scraping retained selectors, the 15-second timeout and fieldpass/fielddrop mappings. Valid filtered and unfiltered scraping also ran in the cluster.

Grace Wehner and others added 2 commits November 9, 2026 13:25
Validate tenant and OSM values before generating parser configs, keep customer values literal, and run Telegraf with strict environment handling. Add regression coverage for injection and environment expansion.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@gracewehner Grace Wehner (gracewehner) changed the title Harden config-map handling for Telegraf configurations feat: Harden config-map handling for Telegraf configurations Nov 9, 2026
@gracewehner Grace Wehner (gracewehner) changed the title feat: Harden config-map handling for Telegraf configurations fix: Harden ama-logs ConfigMap handling Nov 9, 2026
Grace Wehner and others added 3 commits November 9, 2026 14:10
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Drop the test that starts a local HTTP server to avoid DevSkim localhost findings. Keep default config coverage using a documentation-only address.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com
Keep environment references available to Telegraf while continuing to collect bounded reference telemetry.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com
@gracewehner

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.

Avoid plaintext HTTP URL findings in DevSkim by using HTTPS for inert parser test values.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com
@gracewehner

Copy link
Copy Markdown
Member Author

/azp run

@gracewehner
Grace Wehner (gracewehner) marked this pull request as ready for review November 10, 2026 21:03
@gracewehner
Grace Wehner (gracewehner) requested a review from a team as a code owner November 10, 2026 21:03
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@gracewehner

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants