mitre / caldera

Automated Adversary Emulation Platform
https://caldera.mitre.org
Apache License 2.0
5.66k stars 1.08k forks source link

Feature - Manage schedules with cron (1/3) #3025

Closed sasirven closed 1 month ago

sasirven commented 3 months ago

This is the part of the schedule management that replaces cron.

Linked Merge Requests: https://github.com/mitre/caldera/pull/3026 https://github.com/mitre/magma/pull/61

elegantmoose commented 2 months ago

@sasirven picking this up now. Sorry for delay.

uruwhy commented 2 months ago

Tested using both the proposed and latest version (3.0.3) of croniter and confirmed scheduled operations are still kicking off as expected:

curl -H "KEY: ADMIN123" -H "Content-Type: application/json" -X POST http://192.168.56.7:8888/api/v2/schedules --data '{
    "schedule": "13:17:00.000000",
    "id": "123456",
    "task": {
        "id": "234567",
        "name": "testop",
        "adversary": {
            "adversary_id": "01d77744-2515-401a-a497-d9f7241aac3c"
        },
        "planner": {
            "id": "aaa7c857-37a0-4c4a-85f7-4e9f7f30e31a"
        },
        "autonomous": 1,
        "use_learning_parsers": true,
        "group": "red",
        "source": {
            "id": "ed32b9c3-9593-4c33-b0db-e2007315096b"
        }
    }
}' | jq
elegantmoose commented 1 month ago

Thank you @guillaume-duong-bib and @sasirven !