Skip to content

Conversation

@ShourieG
Copy link
Contributor

@ShourieG ShourieG commented Mar 24, 2025

Type of change

  • Enhancement

Proposed commit message

Added support for optional "Auth Key" request header across all data streams

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

Screenshot 2025-03-21 at 10 43 28 PM
@ShourieG ShourieG requested a review from a team as a code owner March 24, 2025 06:59
@ShourieG ShourieG self-assigned this Mar 24, 2025
@ShourieG ShourieG added the Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] label Mar 24, 2025
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@ShourieG ShourieG added Integration:ti_abusech abuse.ch enhancement New feature or request labels Mar 24, 2025
@ShourieG ShourieG requested a review from kcreddy March 24, 2025 07:01
@ShourieG ShourieG changed the title [Ti_AbuseCH] - Added support for "Auth Key" request header across all data streams [Ti_AbuseCH] - Added support for optional "Auth Key" request header across all data streams Mar 24, 2025
@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

Comment on lines 12 to 14
As of February 2025, AbuseCH recommends using an optional `Auth Key` (API Key) in the requests to avoid rate limiting issues.
More details on this topic can be found [here](https://abuse.ch/blog/community-first/). As of version 2.7.0, we have added an optional `Auth Key`
configuration option that can be used to avoid rate limiting.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
As of February 2025, AbuseCH recommends using an optional `Auth Key` (API Key) in the requests to avoid rate limiting issues.
More details on this topic can be found [here](https://abuse.ch/blog/community-first/). As of version 2.7.0, we have added an optional `Auth Key`
configuration option that can be used to avoid rate limiting.
From February 2025, AbuseCH recommends using an optional `Auth Key` (API Key) in the requests to avoid rate limiting issues.
More details on this topic can be found [here](https://abuse.ch/blog/community-first/). In version 2.7.0, we have added an optional `Auth Key`
configuration option that can be used to avoid rate limiting.
Comment on lines +17 to +18
state:
auth_key: {{auth_key}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
state:
auth_key: {{auth_key}}
{{#if auth_key}}
state:
auth_key: {{auth_key}}
{{/if}}
Comment on lines 27 to 30
?"Auth-Key": has(state.auth_key) && !(state.auth_key == "") ?
optional.of([state.auth_key])
:
optional.none(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
?"Auth-Key": has(state.auth_key) && !(state.auth_key == "") ?
optional.of([state.auth_key])
:
optional.none(),
?"Auth-Key": has(state.auth_key) ?
optional.of([state.auth_key])
:
optional.none(),

or

Suggested change
?"Auth-Key": has(state.auth_key) && !(state.auth_key == "") ?
optional.of([state.auth_key])
:
optional.none(),
?"Auth-Key": state.auth_key.optMap(k, [k]),
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comments in the other data streams.

@ShourieG ShourieG removed the request for review from kcreddy March 24, 2025 09:01
@ShourieG
Copy link
Contributor Author

@efd6, addressed all the suggestions

@ShourieG
Copy link
Contributor Author

@efd6, if all looks good can you approve ?

@CameronVIE
Copy link

Hi everyone!
Thank you for your efforts – we really appreciate it!
Would it be possible to get the new integration files to replace the 2.6.0 ones?
Thanks a lot!
Cere

@ShourieG
Copy link
Contributor Author

ShourieG commented Mar 25, 2025

Hi everyone! Thank you for your efforts – we really appreciate it! Would it be possible to get the new integration files to replace the 2.6.0 ones? Thanks a lot! Cere

Hi @CameronVIE, once the 2.8.0 update is out, you will be able to seamlessly upgrade. Could you clarify a bit on the part where you said Would it be possible to get the new integration files to replace the 2.6.0 ones ? Do you want to manually replace the 2.6.0 integration with the updated ones or something like that ?

@CameronVIE
Copy link

CameronVIE commented Mar 25, 2025

Hi @CameronVIE, once the 2.8.0 update is out, you will be able to seamlessly upgrade. Could you clarify a bit on the part where you said Would it be possible to get the new integration files to replace the 2.6.0 ones ? Do you want to manually replace the 2.6.0 integration with the updated ones or something like that ?

Hi ShourieG!
Yes, exactly! 😊 I was just wondering if it might be possible to manually replace the 2.6.0 integration files with the updated ones ahead of the official 2.8.0 release. Just wanted to check if that's something that could work.

@ShourieG
Copy link
Contributor Author

ShourieG commented Mar 25, 2025

Hi everyone! Thank you for your efforts – we really appreciate it! Would it be possible to get the new integration files to replace the 2.6.0 ones? Thanks a lot! Cere

Hi @CameronVIE, once the 2.8.0 update is out, you will be able to seamlessly upgrade. Could you clarify a bit on the part where you said Would it be possible to get the new integration files to replace the 2.6.0 ones ? Do you want to manually replace the 2.6.0 integration with the updated ones or something like that ?

Hi ShourieG! Yes, exactly! 😊 I was just wondering if it might be possible to manually replace the 2.6.0 integration files with the updated ones ahead of the official 2.8.0 release. Just wanted to check if that's something that could work.

You could try it, but there's a high possibility it might break the natural upgrade process, at that point you would have to revert for the upgrade to work. However if you are running a local stack by having cloned the integrations repo it would be straight forward to revert and upgrade.

@CameronVIE
Copy link

CameronVIE commented Mar 25, 2025

You could try it, but there's a high possibility it might break the natural upgrade process, at that point you would have to revert for the upgrade to work. However if you are running a local stack by having cloned the integrations repo it would be straight forward to revert and upgrade.

Yes, that’s exactly what I had in mind – especially since there’s no fixed date for the 2.8.0 release yet 😅
But totally get your point – I’ll be careful not to break anything (famous last words, I know 😄).
Thanks for the heads-up!

@ShourieG
Copy link
Contributor Author

Hi everyone! Thank you for your efforts – we really appreciate it! Would it be possible to get the new integration files to replace the 2.6.0 ones? Thanks a lot! Cere

Hi @CameronVIE, once the 2.8.0 update is out, you will be able to seamlessly upgrade. Could you clarify a bit on the part where you said Would it be possible to get the new integration files to replace the 2.6.0 ones ? Do you want to manually replace the 2.6.0 integration with the updated ones or something like that ?

Hi ShourieG! Yes, exactly! 😊 I was just wondering if it might be possible to manually replace the 2.6.0 integration files with the updated ones ahead of the official 2.8.0 release. Just wanted to check if that's something that could work.

You could try it, but there's a high possibility it might break the natural upgrade process, at that point you would have to revert for the upgrade to work. However if you are running a local stack by having cloned the integrations repo it would be straight forward to revert and upgrade.

Yes, that’s exactly what I had in mind – especially since there’s no fixed date for the 2.8.0 release yet 😅 But totally get your point – I’ll be careful not to break anything (famous last words, I know 😄). Thanks for the heads-up!

So 2.8.0 will be published quite soon after the PR is merged mostly within an hour or so, which can be either tomorrow or the day after, as soon as it's approved. The bigger issue is that you have to wait for 8.18 for the upgrade to show up which is not yet released. So the manual replacement is worth a try >_< . Hope it works out :).

@CameronVIE
Copy link

CameronVIE commented Mar 25, 2025

So 2.8.0 will be published quite soon after the PR is merged mostly within an hour or so, which can be either tomorrow or the day after, as soon as it's approved. The bigger issue is that you have to wait for 8.18 for the upgrade to show up which is not yet released. So the manual replacement is worth a try >_< . Hope it works out :).

Think I’ll give it a try! I’ll share an update here once I’ve tested it – fingers crossed 🤞😊

@ShourieG ShourieG requested a review from efd6 March 26, 2025 05:17
Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

Nits only, then LGTM

"events": {
"error": {
?"id": body.?query_status,
"message": "POST:"+(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"message": "POST:"+(
"message": "POST "+state.url+": "+(
optional.none(),
}
}).do_request().as(resp, resp.StatusCode == 200 ?
bytes(resp.Body).decode_json().as(body, body.?query_status.orValue("") == "ok" ?
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bytes(resp.Body).decode_json().as(body, body.?query_status.orValue("") == "ok" ?
bytes(resp.Body).decode_json().as(body, body.?query_status == optional.of("ok") ?
}),
"url": state.url
}
: body.?query_status.orValue("") == "no_results" ?
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
: body.?query_status.orValue("") == "no_results" ?
: body.?query_status == optional.of("no_results") ?

mainly doing this because we're otherwise potentially doing orValue twice.

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @ShourieG

@ShourieG ShourieG merged commit 59c11ee into elastic:main Mar 26, 2025
7 checks passed
@elastic-vault-github-plugin-prod

Package ti_abusech - 2.8.0 containing this change is available at https://epr.elastic.co/package/ti_abusech/2.8.0/

@ShourieG
Copy link
Contributor Author

ShourieG commented Mar 28, 2025

Hey @CameronVIE, We just recently released these changes as a back-port in version 2.6.1 which is now available, merged in this PR. This means there's no need to wait for 8.18.

flexitrev pushed a commit that referenced this pull request Mar 28, 2025
…cross all data streams (#13261) * auth key param working in malwarebaazar with system tests, docs updated * added auth key support for all data streams and relevant system tests * updated changelog * addressed Dan's suggestions * addressed Dan's suggestions
flexitrev pushed a commit that referenced this pull request Mar 28, 2025
…cross all data streams (#13261) * auth key param working in malwarebaazar with system tests, docs updated * added auth key support for all data streams and relevant system tests * updated changelog * addressed Dan's suggestions * addressed Dan's suggestions
flexitrev pushed a commit that referenced this pull request Mar 28, 2025
…cross all data streams (#13261) * auth key param working in malwarebaazar with system tests, docs updated * added auth key support for all data streams and relevant system tests * updated changelog * addressed Dan's suggestions * addressed Dan's suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Integration:ti_abusech abuse.ch Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

4 participants