-
Notifications
You must be signed in to change notification settings - Fork 474
Opencanary #13970
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
Opencanary #13970
Conversation
rebuild test event set, fix handling for certain error type events, add GeoIP enrichment for source.ip and destination.ip, rebuild/retest/regen sample events etc, retest dashboard
@navnit-elastic - new PR opened. |
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
This is a copy of PR #13026, which was reviewed but eventually closed due to inactivity. |
/test |
The failure reported by CI I have tried running on v8.15.0 and v8.18.0. Both of these succeed, so either the Event Summary dashboard needs to be made to conform to v8.13's expectation, or the kibana version needs to be bumped in the manifest. |
Thanks @efd6 for reporting, @colin-stubbs since there are major changes into the integration, I think it would be better to bump Kibana version to |
8.17.0 makes more sense. @efd6 - out of curiosity what's the situation that has you running tests on an 8.13.x stack? Did you explicitly look at the constraint and fire up an 8.13.x version to test with because it had 8.13.0? UPDATE: I realised you mentioned the CI pipeline... so I suppose it's smart enough to look at the constraint and fire up tests on the version/s listed there? I'm typically testing with the latest It strikes me that perhaps I've updated constraints now to 8.17.0 after explicitly re-testing using an 8.17.0 stack.
|
CI runs the tests on the lowest claimed stack version specified in the Since it works for 8.15, I'd be happy for it to be marked at that version. This drops the least number of users. |
/test |
Hello @colin-stubbs, Recently, there have been changes to the opencanary integration (here). can you please sync this branch with main to resolve the conflicts? |
Add VNC auth events including password fields, improve password redaction using gsub
Sorted. |
/test |
@navnit-elastic apologies, I just did another commit to reduce the new kibana constraint to 8.15.0 as efd6 suggested. fully re-tested using elastic-package on an 8.15.0 stack. |
No problem and thank you for the changes! |
🚀 Benchmarks reportTo see the full report comment with |
/test |
packages/opencanary/data_stream/events/_dev/test/pipeline/test-events.log
Outdated
Show resolved
Hide resolved
packages/opencanary/data_stream/events/elasticsearch/ingest_pipeline/default.yml
Outdated
Show resolved
Hide resolved
packages/opencanary/data_stream/events/elasticsearch/ingest_pipeline/default.yml
Outdated
Show resolved
Hide resolved
packages/opencanary/data_stream/events/elasticsearch/ingest_pipeline/default.yml
Outdated
Show resolved
Hide resolved
packages/opencanary/data_stream/events/elasticsearch/ingest_pipeline/default.yml
Outdated
Show resolved
Hide resolved
packages/opencanary/data_stream/events/elasticsearch/ingest_pipeline/default.yml
Outdated
Show resolved
Hide resolved
packages/opencanary/data_stream/events/elasticsearch/ingest_pipeline/default.yml
Show resolved
Hide resolved
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also address #13970 (comment) and #13970 (comment).
@efd6 I've reverted as above. re: your second comment reference, that one's still in your court from my perspective given you have the issue with respect to having test events that apparently need to be reviewed line by line by a human. From my perspective a selection of event types should be as complete as possible, as it is valuable in both system testing and pipeline testing to detect undefined fields, field type conflicts, and any beat level ingest or pipeline processing errors. The set of events that is in there is one that I have already trimmed of duplicates that were generated during testing. There are many similar events, but they all have different content. At the moment, and in response to your comment, I've already cut the test events for the pipeline tests down to one single event for filestream, and one single event for http_endpoint/webhooks. The system tests still have the larger selection of 161 events, and the system tests validate that 161 events wind up in the appropriate index via It's my understanding that both pipeline test and system test results are checked for common errors/problems by What do you want to do? |
@colin-stubbs, I share Dan's point here. A few events in the system tests could serve the purpose of checking for any data collection errors through the --- 1.json 2025-06-17 15:27:32.413184250 +0530
+++ 2.json 2025-06-17 15:27:41.579156442 +0530
@@ -1,16 +1,16 @@
{
"dst_host": "",
"dst_port": -1,
- "local_time": "2024-04-03 20:58:39.605621",
- "local_time_adjusted": "2024-04-03 14:58:39.605642",
+ "local_time": "2024-04-03 20:58:39.605904",
+ "local_time_adjusted": "2024-04-03 14:58:39.605919",
"logdata": {
"msg": {
- "logdata": "Added service from class CanaryFTP in opencanary.modules.ftp to fake"
+ "logdata": "Added service from class CanaryGit in opencanary.modules.git to fake"
}
},
"logtype": 1001,
"node_id": "opencanary-1",
"src_host": "",
"src_port": -1,
- "utc_time": "2024-04-03 20:58:39.605638"
+ "utc_time": "2024-04-03 20:58:39.605916"
} These events only contain changes in field values and does not necessarily pass through the pipeline differently. |
OK, fair points, it looks like it could actually go down to 34 events. |
@colin-stubbs, Thanks for the commit, but we would like the pipeline tests to cover those events and only a few in the system tests. |
Righteyohthen. |
@navnit-elastic @efd6 the world turns and the PR is becoming problematic, I've merged from main again as someone else has modified opencanary with version 0.6.0 so now bumped this one to 0.6.1. What is the problem with releasing this? |
{"dst_host": "1.128.0.1", "dst_port": 8001, "local_time": "2025-05-21 02:39:50.857806", "local_time_adjusted": "2025-05-21 02:39:50.857820", "logdata": {"BANNER_ID": "1", "DATA": "HELP", "FUNCTION": "DATA_RECEIVED"}, "logtype": 18004, "node_id": "opencanary-1", "src_host": "1.128.0.10", "src_port": 41072, "utc_time": "2025-05-21 02:39:50.857816"} | ||
{"dst_host": "1.128.0.1", "dst_port": 8001, "local_time": "2025-05-21 02:42:42.866533", "local_time_adjusted": "2025-05-21 02:42:42.866540", "logdata": {"BANNER_ID": "1", "DATA": "\u0080\u0000\u0000(\u001d\u00f2\u00cb\\\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0001\u0086\u00a0\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000", "FUNCTION": "DATA_RECEIVED"}, "logtype": 18004, "node_id": "opencanary-1", "src_host": "1.128.0.10", "src_port": 348, "utc_time": "2025-05-21 02:42:42.866538"} | ||
{"dst_host": "1.128.0.1", "dst_port": 5000, "local_time": "2025-06-03 10:56:41.899284", "local_time_adjusted": "2025-06-03 20:56:41.899304", "logdata": {"VNC Client Response": "ef39a47fc14af31260d11bc13da7612c", "VNC Password": "<Password was not in the common list>", "VNC Server Challenge": "1ef1f96bd2d7cc5bd1e85593d17401b7"}, "logtype": 12001, "node_id": "opencanary-1", "src_host": "1.128.0.10", "src_port": 52668, "utc_time": "2025-06-03 10:56:41.899300"} | ||
{"dst_host": "1.128.0.1", "dst_port": 5000, "local_time": "2025-06-03 10:58:03.263583", "local_time_adjusted": "2025-06-03 20:58:03.263633", "logdata": {"VNC Client Response": "406f0aee0ca9cf1fd61916950610fb59", "VNC Password": "password", "VNC Server Challenge": "f99f85ee50d99d748c10e3217f2a4e57"}, "logtype": 12001, "node_id": "opencanary-1", "src_host": "1.128.0.10", "src_port": 53326, "utc_time": "2025-06-03 10:58:03.263628"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know what I'm going to say here. I'd fix it, but maintainers have not been given edit right on this PR. I will ignore it for the sake of sanity.
/test |
💚 Build Succeeded
History
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Package opencanary - 0.6.1 containing this change is available at https://epr.elastic.co/package/opencanary/0.6.1/ |
* Utilise filestream take_over option to ease migration from log to filestream inputs * Improve `event.kind` field mapping. * Add OpenCanary webhook support. * Migrate logfile input to filestream. * Make password redaction configurable. * Make retention of custom fields mapped to ECS fields configurable. * Improve OpenCanary field mapping. * Add dashboard. * Fix confused tftp/vnc field names.
Proposed commit message
Resolves issues #12911, #13024, #13025. Relevant to resolution of #2518.
Checklist
changelog.yml
file.Author's Checklist
Resolves multiple issues:
Testing:
elastic-package lint && check && build
elastic-package test system --generate
elastic-package test pipeline --generate
elastic-package test
How to test this PR locally
Install and operate OpenCanary, ideally via docker.
Use Elastic Agent to ingest OpenCanary log file OR webhooks.
Scan OpenCanary with nmap with scripting to trigger events, e.g.
nmap -sC 127.0.0.1
Review
Related issues
Screenshots
New basic summary dashboard added,