-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a different log file for sensitive data #4129
Conversation
This pull request does not have a backport label. Could you fix it @belimawr? 🙏
NOTE: |
This pull request is now in conflicts. Could you fix it? 🙏
|
00d1eb4
to
4be50d6
Compare
4be50d6
to
c7b443a
Compare
change the folder for the sensitive logger so it is not collected by the monitoring Filebeat.
25ae2fa
to
f4b3c15
Compare
This pull request is now in conflicts. Could you fix it? 🙏
|
Closing this as the behaviour has changed and it was easier to start from a new branch. The new PR: #4549 |
What does this PR do?
This PR introduces the 'sensitive logger': when gathering logs from any component, if the log entry contains the key/value
log.type: sensitive
it is logged to a different file.Why is it important?
It prevents raw events and sensitive data logged by components from being mixed with the normal logs and shipped to monitoring clusters.
Open questions
Does the sensitive logger needs to be configurable?
I made the sensitive logger non configurable, following the example from the logs written to
data/elastic-agent-<hash>/logs/
because the sensitive logger also writes there.Checklist
[ ] I have made corresponding change to the default configuration files./changelog/fragments
using the changelog toolAuthor's Checklist
How to test this PR locally
/tmp/flog.log
with a few lines, the data is not importantTo create ingest failures the easiest way is to close the write index from the datastream, to do that go to Kibana -> Dev Tools
To get the backing index for a datastream:
This will return something like:
Take note of the index_name
.ds-logs-generic-default-2024.01.22-000001
.Close this index:
/tmp/flog.log
data/elastic-agent-<hash>/logs/sensitive
the file name is something likeelastic-agent-sensitive-20240125.ndjson
. You should see a log entry like this one:Note the
"log.type": "sensitive"
and that this log entry is not present in other log files or the logs that go to stdout/stderr.Related issues
## Use cases## Screenshots## LogsQuestions to ask yourself