Skip to content

Exclude azuresecuritylinuxagent namespace from log collection by default#1680

Open
zanejohnson-azure wants to merge 1 commit into
ci_prodfrom
zanejohnson-azure/didactic-memory
Open

Exclude azuresecuritylinuxagent namespace from log collection by default#1680
zanejohnson-azure wants to merge 1 commit into
ci_prodfrom
zanejohnson-azure/didactic-memory

Conversation

@zanejohnson-azure
Copy link
Copy Markdown
Contributor

What

Adds azuresecuritylinuxagent to the built-in default exclusion lists so logs from the azuresecuritylinuxagent namespace (deployed by a sister team) are not collected by ama-logs out of the box.

Changes

  • build/common/installer/scripts/tomlparser.rb
    • @stdoutExcludeNamespaces and @stderrExcludeNamespaces defaults now include azuresecuritylinuxagent.
    • @excludePath defaults (no-configmap, parse-error, unsupported-schema-version branches) now include *_azuresecuritylinuxagent_*.log.
  • kubernetes/container-azm-ms-agentconfig.yaml
    • Example stdout/stderr exclude_namespaces arrays and surrounding comments updated.

Effect

  • Fluent Bit tail input skips opening files in this namespace via Exclude_Path (no I/O, no parsing).
  • out_oms additionally drops any record with this namespace as a backstop.

Caveat

The customer-supplied configmap replaces the default arrays. If a customer has an exclude_namespaces setting in their configmap that does not include azuresecuritylinuxagent, the namespace will still be collected. Documenting this and deciding whether to force-append is left as a follow-up.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@zanejohnson-azure zanejohnson-azure requested a review from a team as a code owner May 13, 2026 19:44
exclude_namespaces = ["kube-system","gatekeeper-system"]
# kube-system,gatekeeper-system,azuresecuritylinuxagent log collection are disabled by default in the absence of 'log_collection_settings.stderr' setting. If you want to enable kube-system,gatekeeper-system,azuresecuritylinuxagent, remove them from the following setting.
# If you want to continue to disable kube-system,gatekeeper-system,azuresecuritylinuxagent log collection keep the namespaces in the following setting and add any other namespace you want to disable log collection to the array.
# In the absense of this configmap, default value for exclude_namespaces = ["kube-system","gatekeeper-system","azuresecuritylinuxagent"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @zanejohnson-azure . shoudl we also add a test to ensure data from this namespace is excluded?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested on a cluster.

see below. when new image is deployed around 4:56 AM, we see logs from azure linux security agent is NOT collected anymore.

image

i also checked logs from other namespace, and confirm they are not affected by this change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if an cx wants to collect it, they can enable through using configmap
by changing
exclude_namespaces = ["kube-system","gatekeeper-system","azuresecuritylinuxagent"]
to
exclude_namespaces = ["kube-system","gatekeeper-system"]

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