Package: kenna
kennakennais anAPIclient forKenna Securitythat allows you to work with applications, assets, connectors, dashboard groups, users, roles, vulnerabilities, and fixes.FAQWhat's included?An API client that allows you to lookup and count applications, assets, asset groups, connectors, connector runs, dashboard groups, users, roles, fixes, and vulnerabilities;A robust command-line interface to go along with itInstallationTo installkennausingpip:$pipinstallkennaTo installkennafrom source (requirespoetry):$gitclonegit@github.com:whitfieldsdad/python-kenna.git
$cdpython-kenna
$makeinstallTo installkennafrom source usingsetup.py(i.e. if you're not usingpoetry):$gitclonegit@github.com:whitfieldsdad/python-kenna.git
$cdpython-kenna
$python3setup.pyinstallFinally, export an environment variable namedKENNA_API_KEYto your shell (i.e. add it to your~/.bashrcor user profile).Important environment variablesKENNA_API_KEY: your API key for accessing Kenna (required)ENABLE_INTEGRATION_TESTS:trueorfalse(optional)TestingYou can run the unit tests and integration tests for this package as follows:$maketestIf the value of the$ENABLE_INTEGRATION_TESTSenvironment variable is set totrue, both the unit tests and integration tests will be executed:$ENABLE_INTEGRATION_TESTS=truemaketestIf you have separate tenants for development and production, you can select which tenant you'd like to work with as follows:$ENABLE_INTEGRATION_TESTS=true$KENNA_API_KEY=${KENNA_DEVELOPMENT_API_KEY}maketest$KENNA_API_KEY=${KENNA_PRODUCTION_API_KEY}maketestTutorialsCommand-line interfaceThe command-line interface forkennaallows you to search for, list, and countapplications,assets,asset groups,connectors,connector runs,dashboard groups,fixes,roles,users, andvulnerabilities.After installingkennayou can access the command-line interface as follows:$poetryrunkennaIf you're not usingpoetry(you should use it), you can access the command line as follows:$python3-mkenna.cliGeneralThe following general options are available within the command-line interface:$poetryrunkenna
Usage:kenna[OPTIONS]COMMAND[ARGS]...

Options:--api-keyTEXT--regionTEXT--helpShowthismessageandexit.

Commands:applicationsasset-groupsassetsconnector-runsconnectorsdashboard-groupsfixesrolesusersvulnerabilitiesApplicationsThe following options are available when working with applications:$poetryrunkennaapplications--help
Usage:kennaapplications[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:get-applicationscount-applicationsList applicationsThe following options are available when listing applications:$poetryrunkennaapplicationsget-applications--help
Usage:kennaapplicationsget-applications[OPTIONS]Options:--application-idsTEXT--application-namesTEXT--application-ownersTEXT--application-teamsTEXT--application-business-unitsTEXT--min-application-risk-meter-scoreINTEGER--max-application-risk-meter-scoreINTEGER--min-asset-countINTEGER--max-asset-countINTEGER--min-vulnerability-countINTEGER--max-vulnerability-countINTEGER--limitINTEGER--helpShowthismessageandexit.AssetsThe following options are available when working with assets:$poetryrunkennaassets--help
Usage:kennaassets[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:get-assetscount-assetsList assetsThe following options are available when listing assets:$poetryrunkennaassetsget-assets--help
Usage:kennaassetsget-assets[OPTIONS]Options:--asset-idsTEXT--asset-group-idsTEXT--asset-group-namesTEXT--asset-tagsTEXT--asset-hostnamesTEXT--asset-ip-addressesTEXT--asset-mac-addressesTEXT--min-asset-risk-meter-scoreINTEGER--max-asset-risk-meter-scoreINTEGER--min-asset-first-seen-timeTEXT--max-asset-first-seen-timeTEXT--min-asset-last-seen-timeTEXT--max-asset-last-seen-timeTEXT--min-asset-last-boot-timeTEXT--max-asset-last-boot-timeTEXT--limitINTEGER--helpShowthismessageandexit.Asset groupsThe following options are available when working with asset groups:$poetryrunkennaasset-groups--help
Usage:kennaasset-groups[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:get-asset-groupscount-asset-groupsList asset groupsThe following options are available when listing asset groups:$poetryrunkennaasset-groupsget-asset-groups--help
Usage:kennaasset-groupsget-asset-groups[OPTIONS]Options:--asset-group-idsTEXT--asset-group-namesTEXT--asset-idsTEXT--asset-tagsTEXT--asset-hostnamesTEXT--asset-ip-addressesTEXT--asset-mac-addressesTEXT--min-asset-group-create-timeTEXT--max-asset-group-create-timeTEXT--min-asset-group-last-update-timeTEXT--max-asset-group-last-update-timeTEXT--limitINTEGER--helpShowthismessageandexit.For example, let's list the ID, name, asset count, vulnerability count, and fix count associated with each asset group that has a name containing the string "Europe":$poetryrunkennaasset-groupsget-asset-groups--asset-group-names"*Europe*"|jq'{"id": .id, "name": .name, "asset_count": .asset_count, "vulnerability_count": .vulnerability_count, "fix_count": .fix_count}'|jq--slurp[{"id":123456,"name":"All European assets","asset_count":12345,"vulnerability_count":1234567,"fix_count":12345}]ConnectorsThe following options are available when working with connectors:$poetryrunkennaconnectors--help
Usage:kennaconnectors[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:get-connectorscount-connectorsList connectorsThe following options are available when listing connectors:$poetryrunkennaconnectorsget-connectors--help
Usage:kennaconnectorsget-connectors[OPTIONS]Options:--connector-idsTEXT--connector-namesTEXT--min-connector-run-start-timeTEXT--max-connector-run-start-timeTEXT--min-connector-run-end-timeTEXT--max-connector-run-end-timeTEXT--limitINTEGER--helpShowthismessageandexit.Connector runsThe following options are available when working with connector runs:$poetryrunkennaconnector-runs--help

Usage:kennaconnector-runs[OPTIONS]COMMAND[ARGS]...

Options:--connector-idsTEXT--connector-namesTEXT--connector-run-idsTEXT--min-connector-run-start-timeTEXT--max-connector-run-start-timeTEXT--min-connector-run-end-timeTEXT--max-connector-run-end-timeTEXT--helpShowthismessageandexit.

Commands:get-connector-runscount-connector-runsList connector runsThe following options are available when listing connector runs:$poetryrunkennaconnector-runsget-connector-runs--help
Usage:kennaconnector-runsget-connector-runs[OPTIONS]Options:--connector-idsTEXT--connector-namesTEXT--connector-run-idsTEXT--min-connector-run-start-timeTEXT--max-connector-run-start-timeTEXT--min-connector-run-end-timeTEXT--max-connector-run-end-timeTEXT--limitINTEGER--helpShowthismessageandexit.Dashboard groupsThe following options are available when working with dashboard groups:$poetryrunkennadashboard-groups--help
Usage:kennadashboard-groups[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:get-dashboard-groupscount-dashboard-groupsList dashboard groupsThe following options are available when listing dashboard groups:$poetryrunkennadashboard-groupsget-dashboard-groups--help
Usage:kennadashboard-groupsget-dashboard-groups[OPTIONS]Options:--dashboard-group-idsTEXT--dashboard-group-namesTEXT--role-idsTEXT--role-namesTEXT--min-dashboard-group-create-timeTEXT--max-dashboard-group-create-timeTEXT--min-dashboard-group-last-update-timeTEXT--max-dashboard-group-last-update-timeTEXT--limitINTEGER--helpShowthismessageandexit.UsersThe following options are available when working with users:$poetryrunkennausers--help
Usage:kennausers[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:get-userscount-usersList usersThe following options are available when listing users:$poetryrunkennausersget-users--help
poetryrunkennausersget-users--help
Usage:kennausersget-users[OPTIONS]Options:--user-idsTEXT--user-namesTEXT--user-email-addressesTEXT--min-user-create-timeTEXT--max-user-create-timeTEXT--min-user-last-sign-in-timeTEXT--max-user-last-sign-in-timeTEXT--min-user-last-update-timeTEXT--max-user-last-update-timeTEXT--limitINTEGER--helpShowthismessageandexit.RolesThe following options are available when working with roles:$poetryrunkennaroles--help
Usage:kennaroles[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:get-rolescount-rolesList rolesThe following options are available when listing roles:$poetryrunkennarolesget-roles--help
Usage:kennarolesget-roles[OPTIONS]Options:--role-idsTEXT--role-namesTEXT--role-typesTEXT--role-access-levelsTEXT--role-custom-permissionsTEXT--user-idsTEXT--user-email-addressesTEXT--user-namesTEXT--min-role-create-timeTEXT--max-role-create-timeTEXT--min-role-last-update-timeTEXT--max-role-last-update-timeTEXT--limitINTEGER--helpShowthismessageandexit.VulnerabilitiesThe following options are available when working with vulnerabilities:$poetryrunkennavulnerabilities--help
Usage:kennavulnerabilities[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:get-vulnerabilitiescount-vulnerabilitiesList vulnerabilitiesThe following options are available when listing vulnerabilities:$poetryrunkennavulnerabilitiesget-vulnerabilities--help
Usage:kennavulnerabilitiesget-vulnerabilities[OPTIONS]Options:--vulnerability-idsTEXT--cve-idsTEXT--fix-idsTEXT--fix-namesTEXT--fix-vendorsTEXT--asset-idsTEXT--asset-hostnamesTEXT--asset-ip-addressesTEXT--asset-mac-addressesTEXT--asset-group-idsTEXT--asset-group-namesTEXT--asset-tagsTEXT--min-vulnerability-risk-meter-scoreINTEGER--max-vulnerability-risk-meter-scoreINTEGER--min-vulnerability-first-seen-timeTEXT--max-vulnerability-first-seen-timeTEXT--min-vulnerability-last-seen-timeTEXT--max-vulnerability-last-seen-timeTEXT--min-cve-publish-timeTEXT--max-cve-publish-timeTEXT--min-patch-publish-timeTEXT--max-patch-publish-timeTEXT--min-patch-due-dateTEXT--max-patch-due-dateTEXT--limitINTEGER--helpShowthismessageandexit.FixesThe following options are available when working with fixes:$poetryrunkennafixes--help
Usage:kennafixes[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:get-fixescount-fixesList fixesThe following options are available when listing fixes:$poetryrunkennafixesget-fixes--help
Usage:kennafixesget-fixes[OPTIONS]Options:--fix-idsTEXT--fix-namesTEXT--fix-vendorsTEXT--cve-idsTEXT--asset-idsTEXT--asset-hostnamesTEXT--asset-ip-addressesTEXT--asset-mac-addressesTEXT--asset-ip-addressesTEXT--asset-mac-addressesTEXT--asset-group-idsTEXT--asset-group-namesTEXT--asset-tagsTEXT--min-fix-create-timeTEXT--max-fix-create-timeTEXT--min-fix-last-update-timeTEXT--max-fix-last-update-timeTEXT--limitINTEGER--helpShowthismessageandexit.