-
Notifications
You must be signed in to change notification settings - Fork 58
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
Tasks contain property that tells the boefjerunner what network it is supposed to run on. #3299
base: main
Are you sure you want to change the base?
Conversation
mula/scheduler/schedulers/boefje.py
Outdated
|
||
# TODO: see what types have a network attribute. How? | ||
network_scope = "internet" | ||
if ooi.object_type in ["IPAddressV4", "IPAddressV6"]: |
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.
We could check if ooi
has an attribute network
, but this would rely on every OOI needing to name their network network
. Is there a better solution to this?
The filtering logic in the Boefje runner in this PR looks like what I expect. Furthermore, for now Scopes are 'networks', but scopes might in the future also become Hosts or even containers in which a dedicated runner can scan. |
Yes, boefje runners containing more than 1 network-scope are also able to query for both the types of networks.
Could you elaborate what you mean with this? Another field could be introduced that explains other limitations of the machine (such as not being able to handle IPv6 requests). |
I'd recommend expanding on the |
I think @underdarknl was talking about this piece of code: #3299 (comment) Currently only tasks created from IPAddressV4s and IPAddressV6s since they have an attribute |
related: #273 |
specifying `task_capabilities`
requirements/capabilities with tasks
8e1b6f0
to
571036c
Compare
I have ran into an issue. I am not able to make the query I want to make using the mula API without restructuring the existing models inside of the scheduler's database. What I want to happen:schedulerWhen tasks get created, depending on the OOI this task is created from. Set a new field on the task called
This information gets saved inside the tasks together with the OOI inside the boefje runnerThere is a new environment variable called ExampleDatabase:[
{
"id":"abc42",
"status":"queued",
"data":{
"requirements":[
"ipv4",
"network/internet"
]
}
},
{
"id":"zyh24",
"status":"queued",
"data":{
"requirements":[
"ipv6",
"network/dentist",
"network/internet"
]
}
}
] If a boefje with the capabilities If a boefje with the capabilities If a boefje with the capabilities If a boefje with the capabilities If a boefje with the capabilities I would love to hear/discuss feedback on how this could be improved. |
I think it would be wise to keep 'scopes' (where does this OOI live), and capabilities (what capabilies does the boefje runner need to have) seperated. A boefje could 'add/specify' certain capabilities, like needing ipv6 support, whereas an OOI 'lives' somewhere which will change depending on the OOI itself. There's a bunch of caveats there, obviously.
|
Do you think this is necessary? Since both the capabilities and the network requirements are now both based on the OOI of the task, they would always be created together. And querying for tasks only happens in one place now. From how I see it, splitting those two up would only cause the Tasks to be more bloated.
Good realisation! Inside Rocky (since we have access to octopoes already there) we can specifically check if the OOI type is of A question I have had is that if it is okay for the task to be created by Rocky. Should rocky be allowed to decide the requirements of the task? This would make it easier because rocky has full access about the OOI. (a month ago the scheduler also did, but this was removed recently)
Hmm interesting situation, do you think the boefjes that work like Shodan should contain a property that notifies the KAT-alogus that it should always be ran on the internet network? Or can we hardcode this at the task creation?
This is planned to be done already. The task created will be off a Ipv4 or Ipv6 type by using the OOI. And the Nmap boefje already checks whether the given IPAddress is of type ipv4 or 6.
Currently websites do not have a network attribute. So it would be hard to find out on what network they lie on. This is however something that can be looked at after the base functionality of this PR has been reached. |
Also removed a newline that shouldn't have been there 😉
since they dont care about the network they are in
Current version works satisfactory in my opinion. Tasks that get created from OOIs that contain a I think it is fine to hardcode tasks based from Findingtypes to the internet since they are a special kind of OOI. This has yet to be implemented. Instead of adding a new attribute to boefje's resources that tell the scheduler that they should only be ran on OOIs. We could also make the boefjes check their OOI before to see if they should run. (so for example, a shodan boefje will not push any raw data if the OOI they received is from a network outside the internet. Websites/URLs are a bit odd since they don't already have a I am currently implementing:
|
This is a big one, lets hope it still works
Started removing dependency on WorkerManager.Queue as well
Changes
Made it so that newly created tasks (made from an IPAddress OOI) contain an attribute that explains what network the task should be run on.
Issue link
Closes #3222
Demo
Task not being ran because only boefje runners which check for the network: "internal-cynalytics" (which is currently not being active) has not picked it up.
remote-boefje-demonstration-compressed.mp4
A video showing off a task with a specific not being picked up until another boefje-runner has been started.
QA notes
(Note that a new environment variable has been made called "network_scopes")
Try creating a new IPAddress with network "internet" and observe that it runs successfully. And after that create another IPAddress with a new self-made network and observe that wont be ran.
When you run the boefje container with your new network name included in the environment variable then the task should be ran.
Code Checklist
.env
changes files if required and changed the.env-dist
accordingly.Checklist for code reviewers:
Checklist for QA:
make reset
.feature
orhotfix
works as intended.What works:
What doesn't work:
Bug or feature?: