Py42

Latest version: v1.27.3

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

Scan your dependencies

Page 7 of 14

1.8.1

Not secure
Fixed

- Corrected error logic for trying to add or remove users from a system rule.

1.8.0

Not secure
Removed

- Removed `tenant_id` parameter from methods:
- `sdk.alerts.get_details()`
- `sdk.alerts.resolve()`
- `sdk.alerts.reopen()`

Fixed

- Issue that in rare circumstance could cause py42 to exhaust network sockets. This could sometimes occur if you were running a multi-threaded program that communicated with many Code42 storage nodes.

Added

- Methods for obtaining archive information:
- `sdk.archive.get_by_archive_guid`
- `sdk.archive.get_all_by_device_guid`

- Debug logs for restore progress during the method call `py42.archive.stream_from_backup()`.
- [.netrc](https://ec.haxx.se/usingcurl/usingcurl-netrc) support. Calling `py42.sdk.from_local_account()` with no username and password will now result in py42 attempting to authenticate via an entry in your `.netrc` file, if you have one.

- `py42.constants.SortDirection` constants `DESC` and `ASC`.

- `sdk.detectionlists.departing_employee.DepartingEmployeeFilters` constants `OPEN`,
`EXFILTRATION_30_DAYS`, `EXFILTRATION_24_HOURS`, and `LEAVING_TODAY`.

- `sdk.detectionlists.high_risk_employee.HighRiskEmployeeFilters` constants `OPEN`,
`EXFILTRATION_30_DAYS`, and `EXFILTRATION_24_HOURS`.

- Methods for calling the agent-state APIs:
- `sdk.devices.get_agent_state()`
- `sdk.devices.get_agent_full_disk_access_state()`
- `sdk.orgs.get_agent_state()`
- `sdk.orgs.get_agent_full_disk_access_states()`

- Exception classes (`py42.exceptions`)
- `Py42ResponseError`
- `Py42UserAlreadyAddedError`
- `Py42LegalHoldNotFoundOrPermissionDeniedError`
- `Py42InvalidRuleOperationError`

- Methods for getting individual response pages:
- `sdk.detectionlists.departing_employee.get_page()`
- `sdk.detectionlists.high_risk.get_page()`
- `sdk.users.get_page()`
- `sdk.devices.get_page()`
- `sdk.orgs.get_page()`
- `sdk.legalhold.get_matters_page()`
- `sdk.legalhold.get_custodians_page()`
- `sdk.alerts.get_rules_page()`

- Added enum object `py42.modules.detectionlists.RiskTags` with constants:
- `FLIGHT_RISK`
- `HIGH_IMPACT_EMPLOYEE`
- `ELEVATED_ACCESS_PRIVILEGES`
- `PERFORMANCE_CONCERNS`
- `SUSPICIOUS_SYSTEM_ACTIVITY`
- `POOR_SECURITY_PRACTICES`
- `CONTRACT_EMPLOYEE`

- Added below event filter support
- TrustedActivity
- RemoteActivity
- PrintJobName
- Printer
- DeviceSignedInUserName

- Added attributes to below event filters and added `choices` method to return list of all available attributes
- FileCategory
- SyncDestination
- ExposureType
- Source
- EventTimestamp
- EventType
- SharingTypeAdded
- RuleSource
- RuleType
- AlertState
- Severity

Changed

- `sdk.archive.stream_from_backup()` now calculates file sizes and accepts a `file_size_calc_timeout` parameter.
- Parameter `file_path` on `sdk.archive.stream_from_backup()` renamed to `file_paths` and can now take a list of file paths to restore.
- `sdk.detectionlists.departing_employee.add()` now raises `Py42UserAlreadyAddedError` when the user is already on the list.
- `sdk.detectionlists.high_risk_employee.add()` now raises `Py42UserAlreadyAddedError` when the user already on the list.
- `sdk.legalhold.add_to_matter()` now raises `Py42UserAlreadyAddedError` when the user is already on the matter.
- `sdk.legalhold.get_matter_by_uid()` now raises `Py42LegalHoldNotFoundOrPermissionDeniedError` when the user does not have
access or the ID does not exist.
- `sdk.alerts.rules.add_user()` now raises `Py42InvalidRuleOperationError` on 404s.
- `sdk.alerts.rules.remove_user()` now raises `Py42InvalidRuleOperationError` on 404s.
- `sdk.alerts.rules.remove_all_users()` now raises `Py42InvalidRuleOperationError` on 404s.
- `Py42ArchiveFileNotFoundError` now includes the response.
- `Py42ChecksumNotFoundError` now includes the response.
- `Py42FeatureUnavailableError` now includes the response.
- `Py42StorageSessionInitializationError` now includes the response.

1.7.1

Not secure
Changed

- `sdk.securitydata.stream_file_by_md5()` now raises `Py42ChecksumNotFoundError` when no matching md5 is found (previously was `Py42ArchiveFileNotFoundError`).
- `sdk.securitydata.stream_file_by_sha256()` now raises `Py42ChecksumNotFoundError` when no matching md5 is found (previously was `Py42Error`).

Fixed

- functions now return `Py42Response` objects as expected:
- `sdk.detectionlists.update_user_notes()`
- `sdk.detectionlists.add_user_risk_tags()`
- `sdk.detectionlists.remove_user_risk_tags()`
- `sdk.detectionlists.add_user_cloud_alias()`
- `sdk.detectionlists.remove_user_cloud_alias()`
- `sdk.archive.get_all_org_cold_storage_archives()` now actually uses parameters `include_child_orgs`, `sort_key` and `sort_dir`.

1.7.0

Not secure
Added

- Functions for managing role assignment:
- `sdk.users.get_available_roles()`
- `sdk.users.get_roles()`
- `sdk.users.add_role()`
- `sdk.users.remove_role()`

- `__eq__` and `__hash__` methods to the `py42.sdk.queries.query_filter.QueryFilter` class to enable easier comparison of filters
- `__eq__` and `__contains__` methods to the `py42.sdk.queries.query_filter.FilterGroup` class to enable easier comparison of and membership tests of filter groups

Changed

- When calling `__str__` or `__iter__` on a `FilterGroup` instance, the filter results have `set()` called on them to remove duplicate filters (if they exist) as well
as sorts the results. This enables comparing two `FilterGroup`s that might have been constructed differently but ultimately return the exact same results in a query.
- `FilterGroup.filter_clause` property now has a setter, making it easy to change the clause on an existing filter group.

Removed

- `filter_clause` arg on `FilterGroup.from_dict` method. The clause will automatically be derived from the dict itself.

1.6.2

Not secure
Added

- `data` to `Py42Response`. This allows a developer to retrieve the full dict of the response under the `data` json node, if present, enabling the use of typical dict functions such as `get()`.

- `content` to `Py42Response`. This exposes the underlying `requests.Response.content`, which contains the fully body of the response as a byte array.

1.6.1

Not secure
Fixed

- An issue where `sdk.securitydata.stream_file_by_md5()` and `sdk.securitydata.stream_file_by_sha256()` would return streams containing an error message instead of properly failing.

- An issue where streaming methods would load the stream completely into memory instead of retrieving it one chunk at a time.

Page 7 of 14

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.