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

4.40.4 #202

Merged
merged 13 commits into from
Sep 15, 2022
Merged

4.40.4 #202

merged 13 commits into from
Sep 15, 2022

Conversation

lifehackjim
Copy link
Contributor

4.40.4

Feature: Add support for supplying cookies

  • New OS environment variable AX_COOKIES

    • Treated as a CSV by default
      • example: AX_COOKIES="key1=value1,key2=value2"
    • Can be treated as JSON
      • example: AX_COOKIES='json:{"key1": "value1", "key2": "value2"}'
  • Added new argument to axonshell root command --cookie, examples:

    • axonshell --cookie key1=value1 --cookies key2=value2 devices count
    • AX_COOKIES="key1=value1,key2=value2" axonshell devices count
    • export AX_COOKIES="key1=value1,key2=value2"; axonshell devices count
-cook, --cookie DICT_PARAM      Additional cookies to supply with every
                                request  (Example: 'key1=value1')  (env var
                                parsed as CSV unless starts with 'json:')
                                (multiples)  [env var: AX_COOKIES]
  • Added more info to axonshell root command:
Using existing .env file: '/Users/jimbo/gh/Axonius/axonapi/.env'
AX_ENV=

Tips:
- All of the options listed above must be supplied BEFORE any commands or groups.
  - CORRECT: axonshell --log-console devices count
  - INCORRECT: axonshell devices count --log-console
- All values stored in a .env file will be treated as OS environment variables.
- Almost all options throughout axonshell have an associated OS environment variable.
- Use AX_ENV to point to a custom .env file:
  - bash: export AX_ENV=/path/to/.env  # for all commands in current shell
  - bash: AX_ENV=/path/to/.env axonshell tools shell  # for single commands
  - cmd.exe: SET AX_ENV="c:\path\to\.env"
  - powershell: $AX_ENV = "c:\path\to\.env"
- Use AX_COOKIES and AX_HEADERS as comma seperated values or json:
  - AX_COOKIES="key1=value1,key2=value2,key3=value4"
  - AX_HEADERS='json:{"key1": "value1", "key2": "value2"}'
- Use AX_URL, AX_KEY, AX_SECRET to specify credentials

  • Internals: added new argument cookies:dict=None
    • axonius_api_client.http.Http.__init__
    • axonius_api_client.http.Http.__call__
    • axonius_api_client.connect.Connect.__init__

Feature: Specify request options when getting assets

  • Want to be able to set response timeout on specific calls
    to get assets
  • example
http_args = {"connect_timeout": 5, "response_timeout": 9999}
client.devices.get(http_args=http_args)  # noqa
  • Internals: added new argument http_args:dict=None
    • client.devices.get
    • client.users.get
    • client.vulnerabilities.get

Bugfix: OS Env AX_HEADERS not parsing properly

  • Now works like the newly added AX_COOKIES

Bugfix: silence urllib3 deprecation warning

  • Now only import pyopenssl on python<3.10.1

Schema Updates

SavedQuery

  • new properties: access
  • map access property to wonky private property replacement
  • disable schema validation for "used_in" due to validation errors

Enforcements

  • new properties: settings, description

@lifehackjim lifehackjim changed the base branch from master to develop September 15, 2022 05:41
@lifehackjim lifehackjim merged commit 27fe11d into develop Sep 15, 2022
@lifehackjim lifehackjim deleted the feature/cookies branch September 15, 2022 05:41
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.

None yet

1 participant