Skip to content

Metrics sink should use private permissions and bounded rotation #2853

Description

@Widthdom

Problem

src/CodeIndex/Cli/MetricsSink.cs opens the metrics JSONL file with FileMode.Append after creating the directory, but it does not force owner-only file permissions and does not enforce a maximum size or rotation policy.

Impact

Metrics can include command, path, timing, and failure details. On shared POSIX systems a permissive umask can expose the file, and long-running usage can grow it without bound.

Expected

Create metrics files with private permissions where supported, and add bounded rotation or a maximum-size policy similar to other long-lived logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsecurity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions