Skip to content

Comments

Imix eldritch events#1568

Draft
nullmonk wants to merge 8 commits intomainfrom
imix-eldritch-events
Draft

Imix eldritch events#1568
nullmonk wants to merge 8 commits intomainfrom
imix-eldritch-events

Conversation

@nullmonk
Copy link
Collaborator

Add event callbacks for Imix. This allows operators to do certain actions with eldritch on callbacks.

Example Use Cases

  • Touch a file on callback success
  • Flush firewalls on callback fail
  • Pop and drop whenever something tries to kill us

@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
534    ±0 534    ±0 0    ±0 0    ±0 0    ±0 0    ±0 1ms    ±0

Previous Results

Build 🏗️ Result 🧪 Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
#514 534 534 0 0 0 0 30.6s

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
534 0 0 1.9s

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
TestGetRandomName/NoDuplicates 1 1.9s 1.9s
TestGetRandomName 1 1.9s 1.9s
TestRedirector_ContextCancellation 1 1.1s 1.1s
TestCreateTestData 1 1.0s 1.0s
TestPreventPubSubColdStarts_ZeroInterval 1 1.0s 1.0s
TestAPI 1 840ms 840ms
TestNewShellHandler 1 530ms 530ms
TestPortalIntegration 1 520ms 520ms
TestReverseShell_E2E 1 510ms 510ms
TestAPI/mutations 1 510ms 510ms

🎉 No failed tests in this run. | 🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

🔄 This comment has been updated

Copy link
Collaborator

@hulto hulto left a comment

Choose a reason for hiding this comment

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

Does this work on windows too?

log::info!("Callback success");

#[cfg(feature = "events")]
tokio::spawn(event::on_event("on_callback_success", BTreeMap::new()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do events want to be fired async?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My thought process was that the shouldn't hold up the process too much

#[cfg(feature = "events")]
{
if event::load_event_script() {
tokio::spawn(crate::event::catch_signals());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: crate::event and event used I think this should just be event.


The system looks for a universal event script at `on_event.eldritch` within the embedded assets. If found, this script is executed for every triggered event.

The script receives a global variable `input_params` containing:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where does input_params come from?

@nullmonk
Copy link
Collaborator Author

Does this work on windows too?

The callbacks will. The signals stuff won't obviously

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