All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
The intended audience of this file is for py42 consumers -- as such, changes that don't affect how a consumer would use the library (e.g. adding unit tests, updating documentation, etc) are not captured here.
- All Incydr functionality is deprecated in Code42CLI. Use the Incydr SDK instead: https://developer.code42.com/
- Updated the user-agent prefix for compatibility with Incydr conventions.
- Removed support for end-of-life python versions 3.6, 3.7, 3.8.
- Support for Python 3.12, includes various dependency version requirement updates.
- Removed the following command groups following deprecation:
detection-listsdeparting-employeehigh-risk-employee
- APIs were replaced by the
watchlistscommands
- Vulnerability in
ipythondependency for installs on Python 3.8+
- Bug in
security-data search|send-towhere using--format jsonand a checkpoint raised an error when configured for V2 file events. - Bug in
devices listcommand when using--include-legal-hold-membershipoption with an API client auth profile.
- Updated setup requirements to allow for install with any
clickversion>=7.1.1
- Support for
clickversion>=8.0.0.
- Support for Code42 API clients.
- You can create a new profile with API client authentication using
code42 profile create-api-client - Or, update your existing profile to use API clients with
code42 update --api-client-id <id> --secret <secret>
- You can create a new profile with API client authentication using
- New commands to view details for user risk profiles:
code42 users list-risk-profilescode42 users show-risk-profile
- Proxy support via
HTTPS_PROXYenvironment variable.
- When using API client authentication, changes to the following
legal-holdcommands:code42 legal-hold list- Change in response shape.code42 legal-hold show- Change in response shape.code42 legal-hold search-events- Not available.
- Support for the V2 file event data model.
- V1 file event APIs were marked deprecated in May 2022 and will be no longer be supported after May 2023.
- Use the
--use-v2-file-events Trueoption with thecode42 profile createorcode42 profile updatecommands to enable your code42 CLI profile to use the latest V2 file event data model. - See the V2 File Events User Guide for more information.
- The
--disable-ssl-errorsoptions for thecode42 profile createandcode42 profile updatecommands is no longer a flag and now takes a booleanTrue/Falsearg.
code42 devices listandcode42 devices list-backup-setsnow accept a--page-size <int>option to enable manually configuring optimal page size.
- Reduced the
page_sizein Device API calls from 500 to 100 to reduce possibility of timeouts when including backup usage incode42 devices list.
- Bug where the
code42 security-data searchcommand using a checkpoint and only the--include-non-exposurefilter resulted in invalid page tokens. - Bug where
code42 security-data searchwould only return 10,000 events on the first search when using a new checkpoint.
- Bug where the
code42 security-data searchcommand using a checkpoint and only the--include-non-exposurefilter constructed an invalid search query.
watchlists bulkcommands now accept CSVs with extra headers
-
watchlistscommand group for interacting with watchlists.watchlists addfor adding users to a watchlistwatchlists removefor removing users from a watchlistwatchlists listfor listing existing watchlistswatchlists list-membersfor listing users who are members of a given watchlistwatchlist bulk add|removefor adding/removing multiple users via CSV file
-
users update-start-datecommand to add/modify the "start date" property of a User's risk profile. -
users update-departure-datecommand to add/modify the "end date" property of a User's risk profile. -
users update-risk-profile-notescommand to add/modify the "notes" property of a User's risk profile.
departing-employeeandhigh-risk-employeecommand groups. These actions have been replaced by thewatchlistscommand group.
departing-employee bulk removeandhigh-risk-employee bulk removecommands now accept CSVs with an optional header, as well as extraneous columns if a header is provided.- Added
devices renameanddevices bulk renamecommands to rename devices.- Note: Incydr devices cannot be renamed.
- Added the following commands for managing users' cloud aliases:
users add-aliasusers remove-aliasusers list-aliasesusers bulk add-aliasusers bulk remove-alias
- Vulnerability in
ipythondependency. See CVE-2022-21699.
- Bug where device settings were unable to be serialized to json.
--columnsoption tosecurity-data searchandsecurity-data send-tocommands which reduces output to only the specified colums/json keys. Accepts a comma-separated list of column names (case-insensitive).
- Improved accuracy of checkpointing for
security-data search(checkpoints every row as it is printed to stdout instead of just the last event of the search response).
- Updated minimum version of py42 to
1.19.3to provide access to updated URI paths for new standardized versioning scheme.
- Incorrect column title on
code42 trusted-activities bulk createcommand help text. code42 devices listwill now process--exclude-most-recently-connectedprior to--last-connected-beforeinstead of after.- The minimum required version of Python for code42cli is now correctly set as 3.6.2.
-
New bulk commands to manage user roles
code42 users bulk add-rolescode42 users bulk remove-roles
-
New option
--include-rolesoncode42 users listthat includes the roles for all users. -
New command
code42 users show <username>that prints all the details of that user. -
New commands to view orgs
code42 users orgs listcode42 users orgs show <org-uid>
-
New option
--include-legal-hold-membershipon commandcode42 users listthat includes the legal hold matter name and ID for any user on legal hold. -
New commands for deactivating/reactivating Code42 user accounts:
code42 users deactivatecode42 users reactivatecode42 users bulk deactivatecode42 users bulk reactivate
-
code42 profile usenow prompts you to select a profile when not given a profile name argument. -
New
trusted-activitiescommands for managing trusted activities and resources:code42 trusted-activities createto create a trusted activity.code42 trusted-activities updateto update a trusted activity.code42 trusted-activities removeto remove a trusted activity.code42 trusted-activities listto print the details of all trusted activities.code42 trusted-activities bulk createto bulk create trusted activities from a CSV file.code42 trusted-activities bulk updateto bulk update trusted activities from a CSV file.code42 trusted-activities bulk removeto bulk remove trusted activities from a CSV file.
- Bug where
audit-logs searchwith--use-checkpointoption was causing output formatting problems. - Improve error message for
code42 users list,code42 devices list,code42 devices list-backup-sets
-
code42 profilecommands that validate passwords (create,update,reset-pw) now have the--debugoption available, andcreateandupdatecan now also pass in--totpas an option. -
New command options for
code42 security-data search--risk-indicatorto filter events by risk indicators.--risk-severityto filter events by risk severity.
-
A TOTP token is now required on
code42 profilecommands that check for password validity when a user has MFA enabled. -
Updated minimum version of py42 to
1.18.0to provide access toFIRST_DESTINATION_USEandRARE_DESTINATION_USEsearch filters.
code42 profile deletecommand now prints a clear error message when deletion target doesn't exist.
- The
chardetlibrary is now an explicit dependency, resolving dependency issues for fresh installations using latestrequestsv.2.26.0
-
Issue where
code42 devices bulk deactivateandcode42 devices bulk reactivatewould output incorrect Successes and Failures at the end of the process. -
Bug where
code42 audit-logs searchwould fail to store checkpoints when timestamps included nanoseconds. -
Issue where if an error occurred during
code42 audit-logs searchorcode42 audit-logs send-to, the user would get a stored checkpoint without having handled events.
-
New command
code42 users updateto update a single user. -
New command
code42 users bulk updateto update users in bulk. -
New command
code42 users moveto move a single user to a different organization. -
New command
code42 users bulk moveto move users in bulk.
- Now when a user is not found, the error message suggests that it might be because you don't have the necessary permissions.
-
New command
code42 users add-roleto add a user role to a single user. -
New command
code42 users remove-roleto remove a user role from a single user. -
New command
code42 shellthat opens an IPython console with a pre-initialized py42 sdk.
- Issue where
profilecommands that required connecting to an authority failed to respect the--disable-ssl-errorsflag when set.
- Support for users that require multi-factor authentication.
-
Issue where some error messages stopped displaying in the same way that they did in prior versions.
-
Issue where the
--role-nameoption on the commandcode42 users listcaused the CLI to call a deprecated method.
-
New command
code42 alerts showthat displays information about a single alert. -
New command
code42 alerts updatethat can update an alert's state or note. -
New command
code42 alerts bulk generate-templatefor generating CSV templates for bulk commands. -
New command
code42 alerts bulk updatefor bulk updating alerts. -
New command
code42 cases file-events bulk generate-templatecreates the template CSV file for the given command arg. -
New command
code42 cases file-events bulk addthat takes a CSV file with case number and event ID. -
New command
code42 cases file-events bulk removethat takes a CSV file with case number and event ID.
-
code42 alerts searchnow includes the alert ID in its table output. -
code42 alerts searchtable output now refers to the alert state asstateinstead ofstatus.
- New command
code42 users listwith options:--org-uidfilters on org membership.--role-namefilters on users having a particular role.--activeand--inactivefilter on user status.
-
Bug where some CSV outputs on Windows would have an extra newline between the rows.
-
Issue where outputting or sending an alert or file-event with a timestamp without decimals would error.
-
A performance issue with the
code42 departing-employee bulk addcommand.
-
code42 alert-rules listnow outputs via a pager when results contain more than 10 rules. -
code42 cases listnow outputs via a pager when results contain more than 10 cases.
code42 legal-hold search-eventscommand:--matter-idfilters based on a legal hold uid.--beginfilters based on a beginning timestamp.--endfilters based on an end timestamp.--event-typefilters based on a list of event types.
- Arguments/options that read data from files now attempt to autodetect file encodings. Resolving a bug where CSVs written on Windows with Powershell would fail to be read properly.
-
code42cli.extensionsmodule exposessdk_optionsdecorator andscriptgroup for writing custom extension scripts using the Code42 CLI. -
code42 devices listoptions:--include-legal-hold-membershipprints the legal hold matter name and ID for any active device on legal hold--include-total-storageprints the backup archive count and total storage
- Command options for
profile update:-n--nameis not required, and if omitted will use the default profile.-s--serverand-u--usernameare not required and can be updated independently now.- Example:
code42 profile update -s 1.2.3.4:1234
- Issue where
code42 alert-rules bulk addwould show as successful when adding users to a non-existent alert rule.
- New choice
TLS-TCPfor--protocoloption used bysend-tocommands:code42 security-data send-tocode42 alerts send-tocode42 audit-logs send-tofor more securely transporting data. Included are new flags:--certs--ignore-cert-validation
- The error text in cases command when:
cases createsets a name that already exists in the system.cases createsets a description that has more than 250 characters.cases updatesets a description that has more than 250 characters.cases file-events addis performed on an already closed case.cases file-events addsets an event id that is already added to the case.cases file-events removeis performed on an already closed case.
-
The
devicescommand is added. Included are:devices deactivateto deactivate a single device.devices reactivateto reactivate a single device.devices showto retrieve detailed information about a device.devices listto retrieve info about many devices, including device settings.devices list-backup-setsto retrieve detailed info about device backup sets.devices bulk deactivateto deactivate a list of devices.devices bulk reactivateto reactivate a list of devices.devices bulk generate-templateto create a blank CSV file for bulk commands.
-
code42 departing-employee listcommand. -
code42 high-risk-employee listcommand. -
code42 casescommands:createto create a new case.updateto update case details.exportto download a case summary as a PDF file.listto view all cases.showto view the details of a particular case.
-
code42 cases file-eventscommands:addto add an event to a case.removeto remove an event from a case.listto view all events associated with a case.
-
The error text when removing an employee from a detection list now references the employee by ID rather than the username.
-
Improved help text for date option arguments.
- Issue where
code42 profile deletewas allowed without giving aprofile_nameeven though deleting the default profile is not allowed.
code42 audit-logscommands:searchto search for audit-logs.send-toto send audit-logs to server.
-
profile_nameargument is now required forcode42 profile delete, as it was meant to be. -
The
--advanced-queryoption onalerts searchandsecurity-data (search|send-to)commands has been updated:- It can now accept the query as a JSON string or as the path to a file containing the JSON query.
- It can be used with the
--use-checkpoint/-coption.
-
Now, when adding a cloud alias to a detection list user, such as during
departing-employee add, it will remove the existing cloud alias if one exists.- Before, it would error and the cloud alias would not get added.
-
Bug where
code42 legal-hold showwould error when terminal was too small. -
Fixed bug in
departing_employee bulk addcommand that allowed invalid dates to be passed without validation.
-
The follow commands now print a nicer error message when trying to remove a user who is not on the list:
code42 departing-employee removecode42 high-risk-employee removecode42 alert-rules remove-user
-
-i(--incremental) has been removed, use-c(--use-checkpoint) with a string name for the checkpoint instead. -
The code42cli has been migrated to the click framework. This brings:
- BREAKING CHANGE: Commands that accept multiple values for the same option now must have the option flag provided before each value:
use
--option value1 --option value2instead of--option value1 value2(which was previously possible). - Cosmetic changes to error messages, progress bars, and help message formatting.
- BREAKING CHANGE: Commands that accept multiple values for the same option now must have the option flag provided before each value:
use
-
The
printcommand on thesecurity-dataandalertscommand groups has been replaced with thesearchcommand. This was a name change only, all other functionality remains the same. -
A profile created with the
--disable-ssl-errorsflag will now correctly not verify SSL certs when making requests. A warning message is printed each time the CLI is run with a profile configured this way, as it is not recommended. -
The
pathpositional argument for bulkgenerate-templatecommands is now an option (--p/-p). -
Below
searchsubcommands accept argument--format/-fto display result in formatscsv,table,json,raw-json:- Default output format is changed to
tableformat fromraw-json, returns a paginated response. All properties would be displayed by default except when using-f table. Pass--include-allwhen usingtableto view all non-nested top-level properties. code42 alerts searchcode42 security-data searchcode42 security-data saved-search listcode42 legal-hold listcode42 alert-rules list
- Default output format is changed to
-
--or-queryoption added tosecurity-data searchandalerts searchcommands which combines the provided filter arguments into an 'OR' query instead of the default 'AND' query. -
--passwordoption added toprofile createandprofile updatecommands, enabling creating profiles while bypassing the interactive password prompt. -
Profiles can now save multiple alert and file event checkpoints. The name of the checkpoint to be used for a given query should be passed to
-c(--use-checkpoint). -
-y/--assume-yesoption added toprofile deleteandprofile delete-allcommands to not require interactive prompt. -
Below subcommands accept argument
--format/-fto display result in formatscsv,table,json,formatted-json:code42 alert-rules listcode42 legal-hold listcode42 legal-hold showcode42 security-data saved-search list
- The
write-tocommand forsecurity-dataandalertscommand groups.
- Fixed bug that caused the last few entries in csv files to sometimes not be processed when performing bulk processing actions.
- Fixed bug that caused
alert-rules listto error due to page size restrictions on backing service.
- Issue that prevented alerts from being retrieved successfully via
code42 alertscommands due to a change in its backing API.
-
code42clino longer supports python 2.7. -
code42 profile createnow uses required--name,--serverand--usernameflags instead of positional arguments. -
code42 high-risk-employee add-risk-tagsnow uses required--usernameand--tagflags instead of positional arguments. -
code42 high-risk-employee remove-risk-tagsnow uses required--usernameand--tagflags instead of positional arguments.
-
Extraction subcommands of
code42 security-data,print/write-to/send-toaccepts argument--saved-searchto return saved search results. -
code42 security-data saved-searchcommands:listprints out existing saved searches' id and nameshowtakes a search id
-
code42 high-risk-employee bulksupportsadd-risk-tagsandremove-risk-tags.code42 high-risk-employee bulk generate-template <cmd>optionsadd-risk-tagsandremove-risk-tags.add-risk-tagsthat takes a csv file with username and space separated risk tags.remove-risk-tagsthat takes a csv file with username and space separated risk tags.
-
Display,
Fuzzy suggestions, valid keywords matching mistyped commands or arguments. -
code42 alerts:- Ability to search/poll for alerts with checkpointing using one of the following commands:
printto output to stdout.write-toto output to a file.send-toto output to server via UDP or TCP.
- Ability to search/poll for alerts with checkpointing using one of the following commands:
-
code42 alert-rulescommands:add-userwith parameters--rule-idand--username.remove-userthat takes a rule ID and optionally--username.list.showtakes a rule ID.bulkwith subcommands:add: that takes a csv file with rule IDs and usernames.generate-template: that creates the file template. And parameters:cmd: with optionsaddandremove.path
remove: that takes a csv file with rule IDs and usernames.
-
code42 legal-holdcommands:add-userwith parameters--matter-id/-mand--username/-u.remove-userwith parameters--matter-id/-mand--username/-u.listprints out existing active legal hold matters.showtakes amatter_idand prints details of the matter.- optional argument
--include-inactiveadditionally prints matter memberships that are no longer active. - optional argument
--include-policyadditionally prints out the matter's backup preservation policy in json form.
- optional argument
bulkwith subcommands:add-user: that takes a csv file with matter IDs and usernames.remove-user: that takes a csv file with matter IDs and usernames.generate-template: that creates the file templates.cmd: with optionsaddandremove.path
-
Success messages for
profile deleteandprofile update. -
Additional information in the error log file:
- The full command path for the command that errored.
- User-facing error messages you see during adhoc sessions.
-
A custom error in the error log when you try adding unknown risk tags to user.
-
A custom error in the error log when you try adding a user to a detection list who is already added.
-
Graceful handling of keyboard interrupts (ctrl-c) so stack traces aren't printed to console.
-
Warning message printed when ctrl-c is encountered in the middle of an operation that could cause incorrect checkpoint state, a second ctrl-c is required to quit while that operation is ongoing.
-
A progress bar that displays during bulk commands.
-
Short option
-uadded forcode42 high-risk-employee add-risk-tagsandremove-risk-tags. -
Tab completion for bash and zsh for Unix based machines.
- Fixed bug in bulk commands where value-less fields in csv files were treated as empty strings instead of None.
- Fixed anomaly where the path to the error log on Windows contained mixed slashes.
- Issue introduced in py42 v1.1.0 that prevented
high-risk-employeeanddeparting-employeecommands from working properly.
- Issue that prevented bulk csv loading.
-
Issue that prevented version 0.5.0 from updating its dependencies properly.
-
Issue that prevented the
addandbulk addfunctionality ofdeparting-employeeandhigh-risk-employeefrom successfully adding users to lists when specifying optional fields.
securitydatarenamed tosecurity-data.- From
security-datarelated subcommands (such asprint):--c42usernameflag renamed to--c42-username.--filenameflag renamed to--file-name.--filepathflag renamed to--file-path.--processOwnerflag renamed to--process-owner.
-b|--beginand-e|--endarguments now accept shorthand date-range strings for days, hours, and minute intervals going back from the current time (e.g.30d,24h,15m).- Default profile validation logic added to prevent confusing error states.
code42 profile updatecommand.code42 profile createcommand.code42 profile deletecommand.code42 profile delete-allcommand.code42 high-risk-employeecommands:bulkwith subcommands:add: that takes a csv file of users.generate-template: that creates the file template. And parameters:cmd: with optionsaddandremove.path
remove: that takes a list of users in a file.
addthat takes parameters:--username,--cloud-alias,--risk-factor, and--notes.removethat takes a username.add-risk-tagsthat takes a username and risk tags.remove-risk-tagsthat takes a username and risk tags.
code42 departing-employeecommands:bulkwith subcommands:add: that takes a csv file of users.generate-template: that creates the file template. And parameters:cmd: with optionsaddandremove.path
remove: that takes a list of users in a file.
addthat takes parameters:--username,--cloud-alias,--departure-date, and--notes.removethat takes a username.
code42 profile setcommand. Usecode42 profile createinstead.
- Added message to STDERR when no results are found
- Add milliseconds to end timestamp, to represent end of day with milliseconds precision.
- Support for storing passwords when keying is not available.
- Bug where keyring caused errors on certain operating systems when not supported.
- Updated help texts to be more descriptive.
- Bug where encoding would cause an error when opening files on python2.
- Bug where
profile reset-pwdid not work with the default profile. - Bug where
profile showindicated a password was set for a different profile. - We now validate credentials when setting a password.
- Date inputs are now required to be in quotes when they include a time.
- Support for multiple profiles:
- Optional
--profileflag for:securitydata write-to,print, andsend-to,profile show,set, andreset-pw.
code42 profile usecommand for changing the default profile.code42 profile listcommand for listing all the available profiles.
- Optional
- The following search args can now take multiple values:
--c42username,--actor,--md5,--sha256,--filename,--filepath,--processOwner,--tabURL
- Fixed bug where port attached to
securitydata send-tocommand was not properly applied.
- Begin dates are no longer required for subsequent interactive
securitydatacommands. - When provided, begin dates are now ignored on subsequent interactive
securitydatacommands. --profilearg is now required the first time setting up a profile.
- Begin and end date now support specifying time:
code42 securitydata print -b 2020-02-02 12:00:00. - If running interactively and errors occur, you will be told them at the end of
code42 securitydatacommands. - New search arguments for
print,write-to, andsend-to:--c42username--actor--md5--sha256--source--filename--filepath--processOwner--tabURL--include-non-exposure
- It is no longer required to store your password in your profile, and you will be prompted to enter your password at runtime if you don't.
- You will be asked if you would like to set a password after using
code42cli profile set. - Begin date is now required for
securitydataprint,write-to, andsend-tocommands.
- Removed
--showflag fromcode42 profile setcommand. Just usecode42 profile show.
- Removed config file settings and
-cCLI arg. Usecode42 profile set. - Removed
--clear-passwordCLI argument. Usecode42 profile set -p. You will be prompted. - Removed top-level destination args. Use subcommands
write-to.send-to,printoff ofcode42 security data.
- Added ability to view your profile:
code42 profile show. - Added
securitydatasubcommands:- Use
code42 securitydata write-toto output to a file. - Use
code42 securitydata send-toto output to a server. - Use
code42 securitydata printto outputs to stdout. - Use
code42 securitydata clear-cursorto remove the stored cursor for 'incremental' mode.
- Use
- Added support for raw JSON queries via
code42 securitydata [subcommand] --advanced-query [JSON].
- Renamed base command
c42aedtocode42. - Moved CLI arguments
-s,-u, and--ignore-ssl-errorstocode42 profile setcommand. - Renamed and moved top-level
-rflag.- Use
-ion one of thesesecuritydatasubcommandswrite-to.send-to,print.
- Use
- Moved search arguments to individual
securitydatasubcommandswrite-to.send-to,print.
- Issue where IOError message was inaccurate when using the wrong port for server destinations.
- Error handling for all socket errors.
- Error handling for IOError 'connection refused'.