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

[OSCD Initiative] Develop Responder for Azure Active Directory #858

Closed
yugoslavskiy opened this issue Sep 14, 2020 · 17 comments · Fixed by #991
Closed

[OSCD Initiative] Develop Responder for Azure Active Directory #858

yugoslavskiy opened this issue Sep 14, 2020 · 17 comments · Fixed by #991
Labels
category:feature-request Issue is related to a feature request category:new-responder
Milestone

Comments

@yugoslavskiy
Copy link
Contributor

Feature description

Responder for Azure Active Directory (AAD) that would be able to execute the following Response Actions:

  • RA4601: Revoke authentication credentials (API tokens)

Describe the solution you'd like

This could be done via Revoke-AzureADUserAllRefreshToken cmdlet.

@yugoslavskiy yugoslavskiy added the category:feature-request Issue is related to a feature request label Sep 14, 2020
@districtofpaige
Copy link
Contributor

I am going to attempt to tackle this using the Graph API: POST /users/{id | userPrincipalName}/revokeSignInSessions.

@districtofpaige
Copy link
Contributor

So I've written the responder python script, json config file, and requirements.txt. I'm trying to import the responder into my cortex VM and I am able to get the responder to show up in the web gui, but the config never shows up. Is there something I'm missing?

@nadouani
Copy link
Contributor

Hello @Dmweiner what do you mean by but the config never shows up? It is it the responder enable modal that doesn't show the configuration form? or the Responder Configuration tab doesn't list your responder?

Can you share the .json file?

@districtofpaige
Copy link
Contributor

Hi @nadouani , appreciate the help.

After adding the path of the responder python code, json service file, and requirements.txt to the cortex config, the json configuration settings for the responder don't show up in the configuration form or in the responder configuration page.

image
image
image

AzureTokenRevoker.zip

@nadouani
Copy link
Contributor

How did you configure that in Cortex config file? How do you tell Cortex about your responder?

Your responder's config file looks correct. I'll try it and let you know.

@nadouani
Copy link
Contributor

Yeah, after some checking, there is a parsing error on the last configuration items. type list is not valid. The users configuration items needs to have a string type instead of list.

Screenshot 2020-10-10 at 22 27 08

@districtofpaige
Copy link
Contributor

That is extremely helpful! Thanks!

@districtofpaige
Copy link
Contributor

@nadouani Sorry to eat up your time, but what is the easiest way to test a responder? I have something written that I'm sure has some issues I need to iron out but I have not had luck running it.

Using a configured training VM, I'm having issues with getting the hive to see enabled responders in a linked cortex instance.

I'm also having trouble using the utility script analyzer-runlocal to test the responder because I don't know what the format of a job file should look like.

Any pointers on my approaches to debugging the responder?
AzureTokenRevoker Complete.zip

@nadouani
Copy link
Contributor

@Dmweiner can you put your responder on a github repository so I can help you review it? You seem to have a typo in your dataListType: ("thehive:case_artifact:" has an extra : and is not valid, so TheHive cannot see it)

@nadouani
Copy link
Contributor

The operations function is also invalid, since it has to return an array of operations. You can double check other responders to see how it works

@districtofpaige
Copy link
Contributor

Sure thing, it will take a minute since I am new to github. I'll make sure to upload the most recent json file as you found that data type problem earlier this weekend :).

@districtofpaige
Copy link
Contributor

@nadouani
Copy link
Contributor

Hello @Dmweiner here are my comments:

  • the responder should be used on thehive:case_artifact only (update the dataTypeList in the json definition file)
  • you need to check the observable's dataType using data.dataType (the responder will receive the user email as the data of the observable data). I would check for data.dataType == "mail"
  • I'm not sure that adding a tag including a timestamp is a good idea, because it will generate a significant number of distinct tags

@districtofpaige
Copy link
Contributor

Thank you, I was unsure of what dataType it should be.

I will update the python script accordingly.

What would be an acceptable output for the script? Can I just return a success message as discussed in the building your own responder guide?

@yugoslavskiy
Copy link
Contributor Author

Hello @Dmweiner! Sorry for the delayed response, we still finalizing OSCD-related PRs in the other projects.
I think you can return a simple success message (:
Could you please create PR so we could proceed with discussion there, reviewing the code?
Thank you!

@districtofpaige
Copy link
Contributor

districtofpaige commented Nov 21, 2020 via email

@2Wanderer
Copy link

Hi, i realy like to leverage this responder but it looks like i'm also missing the users field:

image

the error it throws after running:
image

I'm using the docker neurons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:feature-request Issue is related to a feature request category:new-responder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants