Skip to content
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

Filter sensitive data from the logs #5036

Closed
simianhacker opened this issue Sep 25, 2015 · 4 comments
Closed

Filter sensitive data from the logs #5036

simianhacker opened this issue Sep 25, 2015 · 4 comments

Comments

@simianhacker
Copy link
Member

We should make an effort to filter sensitive data from the logs. An good example would be to censor req.headers.authorization which would change this log entry:

{
    "@timestamp": "2015-09-25T16:19:02+00:00",
    "message": "GET /elasticsearch 200 5ms - 9.0B",
    "method": "get",
    "pid": 85866,
    "req": {
        "headers": {
            "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
            "accept-encoding": "gzip, deflate, sdch",
            "accept-language": "en-US,en;q=0.8",
            "authorization": "Basic dGVzdDp0ZXN0",
            "connection": "keep-alive",
            "host": "localhost:5601",
            "upgrade-insecure-requests": "1",
            "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36"
        },
        "method": "get",
        "remoteAddress": "127.0.0.1",
        "url": "/elasticsearch",
        "userAgent": "127.0.0.1"
    },
    "res": {
        "contentLength": 9,
        "responseTime": 5,
        "statusCode": 200
    },
    "statusCode": 200,
    "tags": [],
    "type": "response"
}

to this

{
    "@timestamp": "2015-09-25T16:19:02+00:00",
    "message": "GET /elasticsearch 200 5ms - 9.0B",
    "method": "get",
    "pid": 85866,
    "req": {
        "headers": {
            "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
            "accept-encoding": "gzip, deflate, sdch",
            "accept-language": "en-US,en;q=0.8",
            "authorization": "Basic XXXXXXXXXXXX",
            "connection": "keep-alive",
            "host": "localhost:5601",
            "upgrade-insecure-requests": "1",
            "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36"
        },
        "method": "get",
        "remoteAddress": "127.0.0.1",
        "url": "/elasticsearch",
        "userAgent": "127.0.0.1"
    },
    "res": {
        "contentLength": 9,
        "responseTime": 5,
        "statusCode": 200
    },
    "statusCode": 200,
    "tags": [],
    "type": "response"
}
simianhacker added a commit to simianhacker/kibana that referenced this issue Sep 25, 2015
- Closes elastic#5036
- Add `applyFilterToKey()`
- Add test for `applyFilterToKey()`
- Add `filter` attribute to config for reporters
- Add `this.filter` method to `LogFormat` class
@tbragin tbragin added v4.2.0 and removed v4.3.0 labels Sep 25, 2015
@GlenRSmith
Copy link
Contributor

Would it be possible for the filtered behavior to be the default, and require configuration/option application?

@spalger
Copy link
Contributor

spalger commented Sep 30, 2015

@GlenRSmith The defaults implemented in #5038 automatically remove any authorization values in log messages. Not sure if that answers your question.

@jcollie
Copy link

jcollie commented Nov 5, 2015

These patches never made it into 4.2.0 so the logging of sensitive data is still a problem.

@simianhacker
Copy link
Member Author

It will go into 4.3 and possibly 4.2.1

epixa pushed a commit to epixa/kibana that referenced this issue Nov 5, 2015
- Closes elastic#5036
- Add `applyFilterToKey()`
- Add test for `applyFilterToKey()`
- Add `filter` attribute to config for reporters
- Add `this.filter` method to `LogFormat` class
epixa added a commit that referenced this issue Nov 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants