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

ti_misp: fix timestamp format sent to API #6482

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented Jun 6, 2023

What does this PR do?

This make the timestamp be sent as unix seconds, rather than time.UnixDate. Also add constraint on test server to match the API definition.

API: https://www.misp-project.org/openapi/#tag/Events/operation/restSearchEvents

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@elasticmachine
Copy link

elasticmachine commented Jun 6, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-06-06T01:52:54.255+0000

  • Duration: 15 min 7 sec

Test stats 🧪

Test Results
Failed 0
Passed 15
Skipped 0
Total 15

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Jun 6, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (2/2) 💚
Files 100.0% (2/2) 💚 6.25
Classes 100.0% (2/2) 💚 6.25
Methods 100.0% (30/30) 💚 14.079
Lines 86.344% (607/703) 👍 0.419
Conditionals 100.0% (0/0) 💚

@efd6 efd6 added bug Something isn't working and removed bugfix labels Jun 6, 2023
@efd6 efd6 marked this pull request as ready for review June 6, 2023 03:09
@efd6 efd6 requested a review from a team as a code owner June 6, 2023 03:09
@elasticmachine
Copy link

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

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

LGTM. I verified the initial requests contain unix timestamps.

  "event.original": "POST /events/restSearch HTTP/1.1\r\nHost: host.docker.internal\r\nUser-Agent: Elastic-Filebeat/8.7.1 (linux; amd64; bda40535cf0743b97017512e6af6d661eeef956e; 2023-04-23 04:33:29 +0000 UTC)\r\nContent-Length: 72\r\nAccept: application/json\r\nAuthorization: hM1it4KA56pLDW5jJmlXTKZMsFV9RBpeSj3ZCu1Z\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"limit\":\"10\",\"page\":\"1\",\"returnFormat\":\"json\",\"timestamp\":\"1685623795\"}",
  "event.original": "POST /attributes/restSearch HTTP/1.1\r\nHost: host.docker.internal\r\nUser-Agent: Elastic-Filebeat/8.7.1 (linux; amd64; bda40535cf0743b97017512e6af6d661eeef956e; 2023-04-23 04:33:29 +0000 UTC)\r\nContent-Length: 72\r\nAccept: application/json\r\nAuthorization: hM1it4KA56pLDW5jJmlXTKZMsFV9RBpeSj3ZCu1Z\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"limit\":\"10\",\"page\":\"1\",\"returnFormat\":\"json\",\"timestamp\":\"1685623788\"}",

@andrewkroh andrewkroh merged commit f38ba1a into elastic:main Jun 6, 2023
1 check passed
@elasticmachine
Copy link

Package ti_misp - 1.15.1 containing this change is available at https://epr.elastic.co/search?package=ti_misp

sodhikirti07 pushed a commit that referenced this pull request Jun 15, 2023
chrisberkhout added a commit to elastic/beats that referenced this pull request Feb 8, 2024
Update the HTTP JSON input configuration for the Threat Intel module's
misp fileset with pagination fixes that were done earlier in the
Agent-based MISP integration, in these PRs:

- Fix timestamp format sent to API
  elastic/integrations#6482

- Fix duplicate requests for page 1
  elastic/integrations#6495

- Keep the same timestamp for later pages
  elastic/integrations#6649

- Pagination fixes
  elastic/integrations#9073
mergify bot pushed a commit to elastic/beats that referenced this pull request Feb 8, 2024
Update the HTTP JSON input configuration for the Threat Intel module's
misp fileset with pagination fixes that were done earlier in the
Agent-based MISP integration, in these PRs:

- Fix timestamp format sent to API
  elastic/integrations#6482

- Fix duplicate requests for page 1
  elastic/integrations#6495

- Keep the same timestamp for later pages
  elastic/integrations#6649

- Pagination fixes
  elastic/integrations#9073

(cherry picked from commit b7fc69a)
mergify bot pushed a commit to elastic/beats that referenced this pull request Feb 8, 2024
Update the HTTP JSON input configuration for the Threat Intel module's
misp fileset with pagination fixes that were done earlier in the
Agent-based MISP integration, in these PRs:

- Fix timestamp format sent to API
  elastic/integrations#6482

- Fix duplicate requests for page 1
  elastic/integrations#6495

- Keep the same timestamp for later pages
  elastic/integrations#6649

- Pagination fixes
  elastic/integrations#9073

(cherry picked from commit b7fc69a)
chrisberkhout pushed a commit to elastic/beats that referenced this pull request Feb 9, 2024
…#37923)

[filebeat][threatintel] MISP pagination fixes (#37898)

Update the HTTP JSON input configuration for the Threat Intel module's
misp fileset with pagination fixes that were done earlier in the
Agent-based MISP integration, in these PRs:

- Fix timestamp format sent to API
  elastic/integrations#6482

- Fix duplicate requests for page 1
  elastic/integrations#6495

- Keep the same timestamp for later pages
  elastic/integrations#6649

- Pagination fixes
  elastic/integrations#9073
chrisberkhout pushed a commit to elastic/beats that referenced this pull request Feb 9, 2024
…#37924)

[filebeat][threatintel] MISP pagination fixes (#37898)

Update the HTTP JSON input configuration for the Threat Intel module's
misp fileset with pagination fixes that were done earlier in the
Agent-based MISP integration, in these PRs:

- Fix timestamp format sent to API
  elastic/integrations#6482

- Fix duplicate requests for page 1
  elastic/integrations#6495

- Keep the same timestamp for later pages
  elastic/integrations#6649

- Pagination fixes
  elastic/integrations#9073
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Integration:ti_misp MISP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ti_misp] Incorrect initial timestamp format
3 participants