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

BED-4599 configurable collection values #81

Merged
merged 5 commits into from
Aug 29, 2024

Conversation

juggernot325
Copy link
Contributor

@juggernot325 juggernot325 commented Aug 12, 2024

This PR adds the ability to configure various values related to collecting data from Azure. These configuration options are not required to be set in the config file and will use a reasonable default if not set. Allowing these values to be easily configured can help to improve collection times or troubleshoot issues with collection.

The newly added options are:

  • batchSize
  • maxConnsPerHost
  • maxIdleConnsPerHost
  • streamCount

To configure them, simply add a new attribute to the config.json file with one of the names above. Here's an example:

{
  "access-types": [],
  "app": "12345",
  "auth": "", 
  "cert": "", 
  "config": "/Users/jbarnett/.config/azurehound/config.json",
  "graph": "",
  "instance": "http://bhe.localhost:80",
  "json": false,
  "jwt": "",
  "key": "",
  "keypass": "",
  "log-file": "",
  "mgmt": "",
  "mgmtgroupid": [],
  "output": "",
  "password": "",
  "pprof": "",
  "proxy": "",
  "refresh-token": "",
  "region": "cloud",
  "secret": "<REDACTED>",
  "subscriptionid": [],
  "tenant": "<REDACTED>",
  "token": "<REDACTED>",
  "tokenid": "<REDACTED>",
  "username": "",
  "batchSize": 5,
  "maxConnsPerHost": 50,
  "maxIdleConnsPerHost": 50,
  "streamCount": 10,
}

Also, the default values for each of these values have been adjusted to hopefully give better performance. Testing has shown that these new defaults provide better collection times, less timeouts, and better memory management in large environments.

Lastly, the new configuration options have built-in sanity checks to prevent setting to harmful values. If the option is found to be set outside of the defined bounds it will revert to the default value.

New options are configured with a minimum and maximum value which is checked
against the configured value. If these values are exceeded, the default value
will be used.
@irshadaj irshadaj marked this pull request as draft August 28, 2024 17:53
@juggernot325 juggernot325 marked this pull request as ready for review August 29, 2024 15:08
@juggernot325 juggernot325 merged commit bc5b828 into main Aug 29, 2024
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants