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

[Check Point] Field checkpoint.source_object mapped incorrectly as long #25124

Closed
inqueue opened this issue Apr 16, 2021 · 4 comments · Fixed by #25145
Closed

[Check Point] Field checkpoint.source_object mapped incorrectly as long #25124

inqueue opened this issue Apr 16, 2021 · 4 comments · Fixed by #25145
Labels

Comments

@inqueue
Copy link
Member

inqueue commented Apr 16, 2021

  • Version: 7.11.2
  • Operating System: n/a
  • Steps to Reproduce:
  1. ./filebeat setup
  2. observe field mapping for checkpoint.source_object

According to https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk144192, Check Point module field checkpoint.source_object should be mapped as a string type instead of long. Events with the field can encounter a mapper_parsing_exception with the current template:

[2021-04-02T17:07:49,508][WARN ][logstash.outputs.elasticsearch][checkpoint-security][checkpoint-security] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"checkpoint-security_filebeat-7.11.2", :routing=>nil, :pipeline=>"filebeat-7.11.2-checkpoint-firewall-pipeline"}, #LogStash::Event:0x36ebe333], :response=>{"index"=>{"_index"=>"checkpoint-security_filebeat-7.11.2-2021.04.02-000021", "_type"=>"_doc", "_id"=>"2FYgk3gB7n6nMgM0RtU0", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [checkpoint.source_object] of type [long] in document with id '2FYgk3gB7n6nMgM0RtU0'. Preview of field's value: 'Africa'", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"For input string: "Africa""}}}}}

Workaround

To workaround, override the default field mapping with an additional higher order template.

PUT /_template/filebeat-checkpoint-source-object-override
{
  "order": 10,
  "index_patterns": [
    "filebeat-*"
  ],
  "mappings": {
    "properties": {
      "checkpoint": {
        "properties": {
          "source_object": {
            "ignore_above": 1024,
            "type": "keyword"
          }
        }
      }
    }
  }
}

The field will have the correct mapping when a new Filebeat index is created.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 16, 2021
@legoguy1000
Copy link
Contributor

Good find. Easy fix to update the module.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Apr 19, 2021
@jamiehynds jamiehynds removed the module label Apr 19, 2021
@legoguy1000
Copy link
Contributor

I made the change to source_object but I'm not even seeing it as a field thats parsed/set via Filebeat or the ingest pipeline (https://github.com/elastic/beats/blob/master/x-pack/filebeat/module/checkpoint/firewall/ingest/pipeline.yml). Are you doing it via a custom logstash pipeline?

@legoguy1000
Copy link
Contributor

I just created a draft PR. If you think it solves your issue, I will move take it out of draft.

andrewkroh added a commit that referenced this issue Apr 26, 2021
* #25124: Update `checkpoint.source_object` mapping

* Update generated

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
mergify bot pushed a commit that referenced this issue Apr 26, 2021
* #25124: Update `checkpoint.source_object` mapping

* Update generated

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
(cherry picked from commit a5e6e5b)
andrewkroh pushed a commit that referenced this issue Apr 26, 2021
* #25124: Update `checkpoint.source_object` mapping

* Update generated

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
(cherry picked from commit a5e6e5b)

Co-authored-by: Alex Resnick <adr8292@gmail.com>
andrewkroh added a commit to andrewkroh/integrations that referenced this issue Mar 31, 2022
According to https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk144192,
Check Point module field checkpoint.source_object should be mapped as a string type instead of long.

Syncs change from:
elastic/beats@a5e6e5b

Relates: elastic/beats#25124
andrewkroh added a commit to elastic/integrations that referenced this issue Mar 31, 2022
According to https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk144192, Check Point module field checkpoint.source_object should be mapped as a string type instead of integer.

Syncs change from: elastic/beats@a5e6e5b

Relates: elastic/beats#25124

Other changes:

- use ECS `log.file.path`
- add `event.original` mapping
- sort fields.yml by field name

This was observed while preparing elastic/beats#31076.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants