appknox api的命令行接口和python包装器
appknox的Python项目详细描述
appknox python
Appknox API的命令行接口&Python包装器
Python API documentation is available here.
安装
appknox python在python 3.5&3.6上得到了正式支持。pip是安装appknox python的推荐方法
pip install appknox
用法
$ appknox
Usage: appknox [OPTIONS] COMMAND [ARGS]...
Command line wrapper for the Appknox API
Options:
-v, --verbose Specify log verbosity.
--help Show this message and exit.
Commands:
analyses List analyses for file
files List files for project
login Log in and save session credentials
logout Delete session credentials
organizations List organizations
projects List projects
report Download report for file
upload Upload and scan package
switch_organization Switch organization in CLI instance
vulnerability Get vulnerability
whoami Show session info
认证
使用secure.appknox.com凭据登录appknox CLI
$ appknox login
Username: viren
Password:
Logged in to https://api.appknox.com
使用环境变量
我们可以使用环境变量进行身份验证,而不是login
。这对于CI/CD安装等场景非常有用
$ export APPKNOX_ACCESS_TOKEN=aaaabbbbbcccddeeeffgghhh
$ export APPKNOX_ORGANIZATION_ID=2
支持的变量有:
Environment variable | Value |
---|---|
^{ | Access token can be generated from Appknox dashboard (Settings → Developer Settings → Generate token). |
^{ | Defaults to ^{ |
^{ | Your Appknox organization id |
数据获取和操作
Available commands | Use |
---|---|
^{ | List organizations of user |
^{ | List projects user has access to |
^{ | List files for a project |
^{ | List analyses for a file |
^{ | Get vulnerability detail |
^{ | Get OWASP detail |
^{ | Upload app file from given path |
^{ | Rescan a file (this will create a new file under the same project.) |
示例:
$ appknox organizations
id name
---- -------
2 MyOrganization
$ appknox projects
id created_on file_count package_name platform updated_on
---- ------------------- ------------ ----------------------------- ---------- -------------------
3 2017-06-23 07:19:26 3 org.owasp.goatdroid.fourgoats 0 2017-06-23 07:26:55
4 2017-06-27 08:27:54 2 com.appknox.mfva 0 2017-06-27 08:30:04
$ appknox files 4
id name version version_code
---- ------ --------- --------------
6 MFVA 1 6
7 MFVA 1 6
开发
更新文档
pip install sphinx-autobuild
生成文档:
sphinx-autobuild -p 9009 -b html sphinx-docs docs
许可证:麻省理工学院