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

Backport:v0.8 Handle multiple URL and DNS selectors correctly #726

Merged

Conversation

kevsecurity
Copy link
Contributor

@kevsecurity kevsecurity commented Feb 23, 2023

Currently we have experimental support for URL and DNS actions, which could be used to trigger Thinkst canaries. This experimental support incorrectly handles multiple selectors – it simply collects all the URLs in the kprobe and all the FQDNs in the kprobe into lists, and when a URL or FQDN action fires on it, it triggers everything in the corresponding list. This is obviously wrong.

This commit fixes this as follows. Each kprobe stores a table of URLs and FQDNs that it references, each entry with its own index. These indices are provided in the config to the match actions in the selectors, and the BPF program reports the matching index. In user space, the URL or FQDN is retrieved from the table using this index.

Note that only one URL and/or FQDN action is permitted per selector. It will be possible to enable multiple if necessary, but it is deemed that a single trigger should be sufficient to trigger any further triggers.

[Upstream commit: 15d2eaa]

Currently we have experimental support for URL and DNS actions, which
could be used to trigger Thinkst canaries. This experimental support
incorrectly handles multiple selectors – it simply collects all the URLs
in the kprobe and all the FQDNs in the kprobe into lists, and when a URL
or FQDN action fires on it, it triggers everything in the corresponding
list. This is obviously wrong.

This commit fixes this as follows. Each kprobe stores a table of URLs
and FQDNs that it references, each entry with its own index. These
indices are provided in the config to the match actions in the
selectors, and the BPF program reports the matching index. In user
space, the URL or FQDN is retrieved from the table using this index.

Note that only one URL and/or FQDN action is permitted per selector. It
will be possible to enable multiple if necessary, but it is deemed that
a single trigger should be sufficient to trigger any further triggers.

Signed-off-by: Kevin Sheldrake <[email protected]>
@kevsecurity kevsecurity requested a review from a team as a code owner February 23, 2023 16:17
@kevsecurity kevsecurity requested review from olsajiri and removed request for a team February 23, 2023 16:17
@kevsecurity kevsecurity changed the title Backports:v0.8 Handle multiple URL and DNS selectors correctly Backport:v0.8 Handle multiple URL and DNS selectors correctly Feb 23, 2023
@kevsecurity kevsecurity merged commit 7d7c5aa into v0.8 Feb 24, 2023
@kevsecurity kevsecurity deleted the backports/v0.8/kevsecurity/geturl-dns-multiple-sels branch February 24, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants