Axonius-api-client

Latest version: v5.0.17

Safety actively analyzes 683322 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 15

4.60.4

<!-- MarkdownTOC -->

- [Bugfix: Errors on Windows with multiple axonshell instances](bugfix-errors-on-windows-with-multiple-axonshell-instances)
- [Feature: Remove logging output for certificate handling](feature-remove-logging-output-for-certificate-handling)

<!-- /MarkdownTOC -->

Bugfix: Errors on Windows with multiple axonshell instances

Errors that happen when running a second instance of axonshell at the same
time when rolling over the logs are now caught and logged.

Feature: Remove logging output for certificate handling

Removed the logging output for certificate handling, all errors are stored
internally now.


**Full Changelog**: https://github.com/Axonius/axonius_api_client/compare/4.60.3...4.60.4

4.60.3

<!-- MarkdownTOC -->

- [Bugfix: Error while getting dashboard spaces](bugfix-error-while-getting-dashboard-spaces)
- [Bugfix: Warning while getting adapter fetch history events](bugfix-warning-while-getting-adapter-fetch-history-events)
- [Feature: Add option to disable log secret hiding](feature-add-option-to-disable-log-secret-hiding)

<!-- /MarkdownTOC -->

Bugfix: Error while getting dashboard spaces

The schema for Chart objects within Dashboard Spaces was raising errors due to newly added attributes 'shared' and 'private'.

Bugfix: Warning while getting adapter fetch history events

The schema for Adapter Fetch History Events was raising warnings due to newly added attributes 'axonius_version'.

Feature: Add option to disable log secret hiding

New command line argument for axonshell:

text
-lhs, --log-hide-secrets / -nlhs, --no-log-hide-secrets
Enable hiding of secrets in log output [env
var: AX_LOG_HIDE_SECRETS; default: log-hide-
secrets]


New parameter for `axonius_api_client.connect.Connect`:

text
log_hide_secrets: bool = True
log_hide_secrets: enable or disable hiding of secrets in logging system


What's Changed
* 4.60.3 by lifehackjim in https://github.com/Axonius/axonius_api_client/pull/233
* 4.60.3 by lifehackjim in https://github.com/Axonius/axonius_api_client/pull/234


**Full Changelog**: https://github.com/Axonius/axonius_api_client/compare/4.60.2...4.60.3

4.60.2

<!-- MarkdownTOC -->

- [Feature: Reduce logging levels in certificate land](feature-reduce-logging-levels-in-certificate-land)

<!-- /MarkdownTOC -->

Feature: Reduce logging levels in certificate land

All logging from cert_human is now done at debug level.

4.60.1

<!-- MarkdownTOC -->

- [Bugfix: Python 3.8.x errors](bugfix-python-38x-errors)
- [Feature: Add include history dates when getting assets](feature-add-include-history-dates-when-getting-assets)

<!-- /MarkdownTOC -->


Bugfix: Python 3.8.x errors

Trying to use the API client on Python 3.8.x would cause exception like:


TypeError: Optional[t] requires a single type. Got Field(name=None....


Cause: Global namespace confusion with class attributes named 'type' and using a type hint like t.Optional[type].
Resolution: Replaced with t.Any.


Feature: Add include history dates when getting assets

New axonshell argument:


axonshell devices get --include-dates


Will add history_date and current_date to as columns to each asset in output.
What's Changed
* [SA-3427] Add Include Dates (History and Current) by bryce-ax in https://github.com/Axonius/axonius_api_client/pull/227
* 4.60.1 by lifehackjim in https://github.com/Axonius/axonius_api_client/pull/228
* 4.60.1 by lifehackjim in https://github.com/Axonius/axonius_api_client/pull/229

New Contributors
* bryce-ax made their first contribution in https://github.com/Axonius/axonius_api_client/pull/227

**Full Changelog**: https://github.com/Axonius/axonius_api_client/compare/4.60.0...4.60.1

4.60.0

<!-- MarkdownTOC -->

- [Breaking change: You can no longer remove queries from Enforcement Set](breaking-change-you-can-no-longer-remove-querys-from-enforcement-set)
- [Feature: Folder support](feature-folder-support)
- [Axonshell changes](axonshell-changes)
- [API Changes](api-changes)
- [Feature: Add ability to use username and password for credentials](feature-add-ability-to-use-username-and-password-for-credentials)
- [Axonshell changes](axonshell-changes-1)
- [API changes](api-changes-1)
- [Feature: Get the API keys from an Axonius instance and write them to a file](feature-get-the-api-keys-from-an-axonius-instance-and-write-them-to-a-file)
- [Feature: Add log filtering to avoid potential credential storage](feature-add-log-filtering-to-avoid-potential-credential-storage)

<!-- /MarkdownTOC -->


Breaking change: You can no longer remove queries from Enforcement Set

Trying to do so will now give an error.

Feature: Folder support

This release marks the addition of support for folders for Queries and Enforcements.

Axonshell changes

Added new optional arguments --folder and --create to the following:
- axonshell devices saved-query add
- axonshell devices saved-query copy
- axonshell enforcements copy
- axonshell enforcements create
- axonshell users saved-query add
- axonshell users saved-query copy
- axonshell vulnerabilities saved-query add
- axonshell vulnerabilities saved-query copy

Added new commands:
- axonshell devices saved-query update-folder
- axonshell enforcements update-description
- axonshell enforcements update-folder
- axonshell users saved-query update-folder
- axonshell vulnerabilities saved-query update-folder

Added new command group:
- axonshell folders
- axonshell folders queries
- axonshell folders enforcements

Each command group under folders exposes the same set of commands for working with folders for their respective object types:

- create: Create a folder.
- delete: Delete a folder.
- find: Find a folder.
- get-tree: Get a tree view of all subfolders and their...
- move: Move a folder.
- rename: Rename a folder.
- search-objects: Search for objects in a folder.
- search-objects-copy: Search for objects in a folder and make copies...
- search-objects-delete: Search for objects in a folder and delete them.
- search-objects-move: Search for objects in a folder and move them.

API Changes

New API module under client:
- client.folders -> axonius_api_client.api.folders.Folders
- client.folders.queries -> axonius_api_client.api.folders.FoldersQueries
- client.folders.enforcements -> axonius_api_client.api.folders.FoldersEnforcements

Each API module exposes the same set of methods for working with folders for their respective object types:
- api_endpoint_group: Endpoint group to use for this folders object type
- get: Get the root for this folders object type
- get_cached: Get the root for this folders object type
- get_tree: Get a tree view of all subfolders and their objects
- find: Get a folder by path, id, or folder model for this folders object type
- find_cached: Get a folder by path, id, or folder model for this folders object type
- search_objects: Search for objects in a folder
- search_objects_copy: Search for objects in a folder and copy them, optionally to a different folder
- search_objects_move: Search for objects in a folder and move themto a different folder.
- search_objects_delete: Search for objects in a folder and move themto a different folder.
- create: Create a folder
- rename: Rename a folder
- move: Move a folder
- delete: Delete a folder
- `_get`: direct api method to get root folders
- `_rename`: direct api method to rename a folder
- `_move`: direct api method to move a folder
- `_create`: direct api method to create a folder
- `_delete`: direct api method to delete a folder


Feature: Add ability to use username and password for credentials

Axonshell changes

A new option is available to be used at the beginning of the command line:

text
-creds, --credentials / -keys, --keys
Treat key as Username and secret as password
[env var: AX_CREDENTIALS; default: keys]
`

This option, when used like:

axonshell -creds devices count


Will treat the value stored in --key or AX_KEY as username, and the value stored in --secret or AX_SECRET as the password.

API changes

Connect has a new argument:

python
credentials: bool = False


If this is True, key is treated as username and secret is treated as password and instead of using the Auth module ApiKey, it will use the new Auth module Credentials.

Credentials logs in with username and password, then fetches the api key and secret and uses that for the duration of the session.

Feature: Get the API keys from an Axonius instance and write them to a file

A new command group has been added to Axonshell:

text
Usage: axonshell account [OPTIONS] COMMAND [ARGS]...

Group: Account commands.

Options:
--help Show this message and exit.

Commands:
get-api-keys Get the API keys for the current user.
signup Perform the initial signup to an instance.
use-password-reset-token Use a password reset token.
write-config Create/Update a '.env' file with url, key,...



The signup, use-password-reset-token, and write-config commands are just copied over from axonshell tools.

The get-api-key command is a new command altogether:

text
Usage: axonshell account get-api-keys [OPTIONS]

Get the API keys for the current user.

Options:
-u, --url URL URL of an Axonius instance [env var:
AX_URL; required]
-k, --key KEY API Key of user in an Axonius instance [env
var: AX_KEY; required]
-s, --secret SECRET API Secret of user in an Axonius instance
[env var: AX_SECRET; required]
-xf, --export-format [json|str|env]
Format of to export data in [env var:
AX_EXPORT_FORMAT; default: str]
-e, --env TEXT Path to .env file when --export-format==env
[env var: AX_ENV; default: .env]
--help Show this message and exit.


You can use this with the new --credentials option and have it prompt you for key (provide username), prompt you for secret (provide password) then create your .env file for you:


axonshell -creds account get-api-keys --url 1.1.1.1 --export-format env


Feature: Add log filtering to avoid potential credential storage

Created a logging formatter in axonius_api_client.logs:
python

class HideFormatter(logging.Formatter):
"""Hide the rest of the line for any lines against :attr:`HIDE_REGEX`."""

HIDE_ENABLED: bool = True
"""Enable hiding of matches to HIDE_REGEX."""
HIDE_REGEX: t.Pattern = re.compile(r"(password|secret).*", re.I)
"""Pattern of sensitive info to hide."""
HIDE_REPLACE: str = r"\1 ...REST OF LINE HIDDEN..."
"""Value to replace matches to HIDE_REGEX with."""


If any line in the logging output contains the word password or secret, the rest of the line after those words will be hidden from the logging system.

What's Changed
* backmerge 4.50.3 by lifehackjim in https://github.com/Axonius/axonius_api_client/pull/222
* 4.60.0 by lifehackjim in https://github.com/Axonius/axonius_api_client/pull/223
* 4.60.0 SA-3545 SA-3419 by lifehackjim in https://github.com/Axonius/axonius_api_client/pull/224
* More features for 4.60.0 by lifehackjim in https://github.com/Axonius/axonius_api_client/pull/226
* Bugfixes for QA gold release SA-3419 by lifehackjim in https://github.com/Axonius/axonius_api_client/pull/225


**Full Changelog**: https://github.com/Axonius/axonius_api_client/compare/4.50.3...4.60.0

4.50.3

<!-- MarkdownTOC -->

- [BugFix: SavedQuery predefined returning None](bugfix-savedquery-predefined-returning-none)

<!-- /MarkdownTOC -->


BugFix: SavedQuery predefined returning None

When getting Saved Queries, an error can sometimes occur where predefined is None instead of a boolean. Schema modified to allow none.

What's Changed
* Allow predefined to be null in saved queries. by nate-axonius in https://github.com/Axonius/axonius_api_client/pull/216
* Bump werkzeug from 2.0.3 to 2.2.3 by dependabot in https://github.com/Axonius/axonius_api_client/pull/217
* back-merge patch by lifehackjim in https://github.com/Axonius/axonius_api_client/pull/219
* 4.50.3 by lifehackjim in https://github.com/Axonius/axonius_api_client/pull/221

**Full Changelog**: https://github.com/Axonius/axonius_api_client/compare/4.50.2...4.50.3

Page 4 of 15

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.