Compare commits

...

851 Commits

Author SHA1 Message Date
fit2bot
1b157a107e feat: Update v3.5.6 2023-09-21 13:42:25 +08:00
Aaron3S
fe37913ed9 perf: 优化 Playbook 文件创建逻辑 2023-09-19 18:48:43 +08:00
ibuler
4009457000 fix: 修复 random error 2023-09-19 18:19:13 +08:00
ibuler
6c9c64a55f fix: 修复 private storage permission 2023-09-11 11:19:49 +08:00
Bai
24949c6013 perf: 优化飞书信息通知文案 2023-08-15 08:17:00 +05:00
Bai
d02e56da78 fix: 修复忘记密码不包含左侧 + 字符 2023-08-14 15:42:56 +05:00
“huailei000”
9b6c1806af perf: 优化任务日志页面时间显示兼容问题 2023-08-14 07:11:42 +05:00
Bai
ed640e094f fix: 修复 MAX_LIMIT_PER_PAGE, 默认值以及数据类型转换 2023-08-03 18:38:23 +08:00
吴小白
f21272af7d perf: 升级 PyYAML==6.0.1 2023-08-03 10:22:46 +08:00
feng
93cd00702d fix: k8s 支持网关 2023-08-03 10:19:13 +08:00
吴小白
115550793e fix: 修正 python-oracledb 构建错误 2023-08-01 19:52:59 +08:00
Bai
db28e98a02 perf: 升级 oracledb==1.3.2 2023-08-01 18:56:13 +08:00
Bai
1851783dbd perf: 升级 pymssql==2.2.8 2023-08-01 18:32:31 +08:00
Eric_Lee
8648b131f2 Merge pull request #11153 from jumpserver/revert-11152-pr@v3.5@fix_dockerfile_v3.5
Revert "perf: 锁定 Cython==0.29.35 增加 pip 选项 --use-deprecated=legacy-resolver"
2023-08-01 18:24:00 +08:00
Bryan
43112eaa8f Revert "perf: 锁定 Cython==0.29.35 增加 pip 选项 --use-deprecated=legacy-resolver"
This reverts commit 9dbbc57454.
2023-08-01 18:23:09 +08:00
Bai
9dbbc57454 perf: 锁定 Cython==0.29.35 增加 pip 选项 --use-deprecated=legacy-resolver 2023-08-01 18:18:24 +08:00
feng
a0d8c297b0 fix: ansible task 500 2023-08-01 15:43:53 +08:00
ibuler
e15c5b853e perf: 修改 ansible version 2023-08-01 10:51:19 +08:00
ibuler
e015dd7bcb perf: 修改 inventory 2023-08-01 10:50:01 +08:00
feng
8f59e49099 perf: 根据用户是否存在配置 改密参数 2023-07-31 19:54:02 +08:00
Aaron3S
316df6f9d9 fix: 禁止一些 ansible 变量 2023-07-31 19:48:06 +08:00
feng
fcfd7bb469 perf: 翻译 2023-07-26 19:34:35 +08:00
fit2bot
ed0932deea perf: 改密去掉sudo (#11094)
Co-authored-by: feng <1304903146@qq.com>
2023-07-26 19:18:06 +08:00
老广
c4f76c5512 Merge pull request #11092 from jumpserver/pr@v3.5@fix_user_account
fix: 修复同名账号用户名代填问题
2023-07-26 19:17:07 +08:00
fit2bot
7f3426fecf fix: 资产批量更新500 (#11098)
Co-authored-by: feng <1304903146@qq.com>
2023-07-26 19:16:43 +08:00
Eric
8e08e291a0 fix: 修复同名账号用户名代填问题 2023-07-26 09:15:06 +00:00
Bryan
e90e61e8dd Merge pull request #11035 from jumpserver/dev
v3.5.0
2023-07-20 19:03:31 +08:00
fit2bot
4c48204e16 perf: translate (#11036)
Co-authored-by: feng <1304903146@qq.com>
2023-07-20 18:46:34 +08:00
老广
bddcd8475d Merge pull request #11034 from jumpserver/pr@dev@chore_change_readme
perf: 修改 README, 添加 GPT
2023-07-20 18:11:10 +08:00
ibuler
5f8d84df66 perf: 修改图标 2023-07-20 18:10:28 +08:00
ibuler
cee87ae4d7 perf: 修改 README, 添加 GPT 2023-07-20 17:59:58 +08:00
老广
79a2d4e039 Merge pull request #11033 from jumpserver/pr@dev@fix_create_serializer_default
perf: 优化动态创建 serializer
2023-07-20 15:48:11 +08:00
ibuler
4f5e360991 perf: 优化动态创建 serializer 2023-07-20 15:44:52 +08:00
Eric
8e86173cb8 perf: 修复手动输入的同名账号问题 2023-07-20 15:38:51 +08:00
ibuler
08bc3d14aa fix: 修复 json m2m field 中正则有问题匹配不正确 2023-07-20 15:38:04 +08:00
fit2bot
19b91a6c1f perf: 修复资产导入账号模版失败问题 导入文件不区分大小写 (#11031)
Co-authored-by: feng <1304903146@qq.com>
2023-07-20 14:57:51 +08:00
Bai
c50330e055 fix: 修复删除Oracle数据库时报错提示问题 2023-07-20 11:56:49 +08:00
Bai
f5d9dedae1 fix: 修复 Endpoint 获取 Oracle port 的逻辑 2023-07-20 11:51:02 +08:00
Bai
ffb400d70d fix: 修复创建 Oracle 数据库端口超过范围后报错 500 并且不回滚的问题; 2023-07-20 11:23:57 +08:00
Bai
2291cfeaae fix: 修复 ConnectionToken 默认值类型没有转化的问题 2023-07-20 10:42:23 +08:00
老广
400d37ffca Merge pull request #11024 from jumpserver/pr@dev@fix_perm_accounts_only_one
fix: 修复授权的账号,用户名相同的,只有一个的情况
2023-07-19 21:24:45 +08:00
ibuler
14efd9afc1 perf: 修复可能导致的问题 2023-07-19 20:27:06 +08:00
ibuler
cfca519158 fix: 修复授权的账号,用户名相同的,只有一个的情况 2023-07-19 20:16:40 +08:00
Bai
23361fdba9 fix: 修复资产平台导入失败的问题(ID没有返回) 2023-07-19 19:56:18 +08:00
fit2bot
1b0d23fbf4 fix: playbook 批量删除 500 (#11022)
Co-authored-by: feng <1304903146@qq.com>
2023-07-19 19:37:55 +08:00
fit2bot
de4ef7d1b5 perf: GPT资产修改节点导致资产协议变多 (#11021)
Co-authored-by: feng <1304903146@qq.com>
2023-07-19 19:00:15 +08:00
ibuler
046342ceee perf: 平台创建自动化设置默认值 2023-07-19 18:23:18 +08:00
Bai
47195e2c44 fix: 修复客户端方式访问资产 Endpoint 标签匹配策略不生效的问题 2023-07-19 18:14:30 +08:00
老广
947c9e6216 Merge pull request #11018 from jumpserver/pr@dev@perf_coreworker
perf: 优化 Core Worker 数量
2023-07-19 17:17:07 +08:00
Bai
e1af380ad5 perf: 优化 Core Worker 数量 2023-07-19 17:12:44 +08:00
fit2bot
9e8579d5b4 perf: proxy 添加校验 修改翻译 (#11017)
Co-authored-by: feng <1304903146@qq.com>
2023-07-19 17:05:42 +08:00
老广
b8397e7db9 Merge pull request #11012 from jumpserver/pr@dev@perf_change_ui_route
perf: 优化 url
2023-07-19 11:37:51 +08:00
ibuler
8ed8d6f01c perf: 优化 url 2023-07-19 11:36:42 +08:00
Bai
ea607c6177 fix: 优化命令告警,不增加跳转链接 2023-07-19 08:27:34 +05:00
Bai
fa52e2bf5e perf: 优化批量命令告警问题 2023-07-19 08:09:45 +05:00
fangfang.dong
02fc9a730b feat: 快速命令新增告警级别: Warning 2023-07-19 08:09:45 +05:00
Bai
aa744c0fec fix: 修复账号模版切换时报错的问题 2023-07-19 07:34:55 +05:00
fit2bot
02d0c7e4e7 perf: ansible 错误信息优化 (#11005)
Co-authored-by: feng <1304903146@qq.com>
2023-07-18 18:55:18 +08:00
老广
0c34a41381 Merge pull request #11003 from jumpserver/pr@dev@fix_ansiblejobrunerror
fix: 修复批量执行命令时资产名称包含 [ 特殊字符执行报错的问题(issue: 10986)
2023-07-18 18:14:32 +08:00
Bai
8ed3da85f2 fix: 修复批量执行命令时资产名称包含 [ 特殊字符执行报错的问题(issue: 10986) 2023-07-18 10:06:40 +00:00
feng
de5b501ebf fix: 工单时区错乱问题 2023-07-18 16:56:22 +08:00
Bai
ea5a54f9c7 fix: 修复命令告警的问题 2023-07-18 15:21:40 +08:00
halo
6338ecc6fe perf: 优化邮件参数 2023-07-18 15:21:18 +08:00
Bai
be17fe6c31 perf: 邮件同步发送 2023-07-18 15:21:18 +08:00
halo
a18c97aec0 perf: 异步发送 2023-07-18 15:21:18 +08:00
halo
27c10fcae1 fix: 邮件主题前缀设置不生效的问题 2023-07-18 15:21:18 +08:00
fangfang.dong
539babcc97 fix: 修复参数取值错误 2023-07-18 15:17:34 +08:00
fit2bot
0436487bdb fix: 替换ssh key 生成密钥方法 (#10995)
Co-authored-by: feng <1304903146@qq.com>
2023-07-18 15:01:47 +08:00
Bai
f466904a1c perf: 优化 LDAP 用户导入/同步时支持 is_active 为 -1 的情况 2023-07-18 11:03:32 +08:00
老广
1d6bdc9b6b Merge pull request #10990 from jumpserver/pr@dev@perf_gunicorn_max_request
perf: gunicon添加重启参数
2023-07-18 11:02:58 +08:00
ibuler
d965ac0781 perf: 修改参数值 2023-07-18 11:00:43 +08:00
ibuler
6035241efb perf: gunicon添加重启参数 2023-07-18 10:44:12 +08:00
fit2bot
0771b804d1 refactor: 重构危险命令告警类型: Warning (#10970)
* refactor: 重构危险命令告警类型: Warning

* Update _msg_command_warning.html

* Update _msg_command_warning.html

* Update command.py

* Update django.po

* perf: 优化 command acl warning 的代码逻辑

* perf: 优化 command acl warning 的代码逻辑

* perf: 优化 CommandWarningMessage 逻辑

---------

Co-authored-by: fangfang.dong <fangfang.dong@fit2cloud.com>
Co-authored-by: Bai <baijiangjie@gmail.com>
2023-07-17 20:52:54 +08:00
老广
a2c6e5f3fb Merge pull request #10985 from jumpserver/pr@dev@feat_db_mariadb_web_db_support
feat: mariadb 支持 webdb
2023-07-17 18:02:42 +08:00
Aaron3S
c39041fe7b feat: mariadb 支持 webdb 2023-07-17 17:55:05 +08:00
ibuler
22588c52a9 fix: 修复 json field value 可能为 None 导致的问题 2023-07-17 17:25:44 +08:00
ibuler
daef154622 perf: 优化 host api 和 gunicorn 参数 2023-07-17 17:16:18 +08:00
Bai
7b9c4b300d perf: 优化控制 ACL Action Choices 的选项 2023-07-17 16:02:27 +08:00
Bai
819853eae4 feat: 增加 DEBUG_ANSIBLE 配置项支持打印 Ansible 详细日志 2023-07-17 14:11:09 +08:00
老广
f686f9f107 Merge pull request #10978 from jumpserver/pr@dev@fix_platform_setting
perf: 优化平台创建时,协议 setting 必填
2023-07-17 14:02:24 +08:00
ibuler
8a89ee7ac0 perf: 优化平台创建时,协议 setting 必填 2023-07-17 13:53:27 +08:00
老广
696295cf0d Merge pull request #10973 from jumpserver/pr@dev@fix_reset_password_bug
fix: 忘记密码token失效发送验证码报错的问题
2023-07-17 10:54:21 +08:00
老广
d99a3455cd Merge pull request #10966 from jumpserver/pr@dev@perf_chrome_plugins
perf: 优化 chrome 插件
2023-07-17 10:48:22 +08:00
老广
7f5b0618c6 Merge pull request #10969 from jumpserver/pr@dev@fix_ansibletesterror
fix: 修复 Ansible 测试资产可连接性报错的问题(Connection to UNKNOWN port 65535 timed out)
2023-07-17 10:27:48 +08:00
halo
0f1d9bc3eb fix: 忘记密码token失效发送验证码报错的问题 2023-07-15 16:30:45 +08:00
fit2bot
8f6b8b5a11 perf: settings logo (#10971)
Co-authored-by: feng <1304903146@qq.com>
2023-07-14 23:01:48 +08:00
Bai
4da0fadcc4 fix: 修复 Ansible 测试资产可连接性报错的问题(Connection to UNKNOWN port 65535 timed out) 2023-07-14 11:19:31 +00:00
fit2bot
f504413d7f feat: 添加logo api (#10965)
Co-authored-by: feng <1304903146@qq.com>
2023-07-14 16:54:42 +08:00
ibuler
9b5803f2a2 perf: 修改版本号 2023-07-13 20:02:28 +08:00
ibuler
d95e7c2e24 perf: 优化 chrome 插件 2023-07-13 20:01:06 +08:00
ibuler
a1ded0c737 perf: 优化一些 rbac 权限位,着重 connection token 的 2023-07-13 19:57:26 +08:00
老广
bedc83bd3a Merge pull request #10961 from jumpserver/pr@dev@perf_readme
perf: 修改 readme
2023-07-13 14:34:15 +08:00
ibuler
c9f3e4b28d perf: 修改 readme 2023-07-13 14:29:47 +08:00
老广
05bbd22c44 Merge pull request #10959 from jumpserver/pr@dev@perf_add_url
perf: 修改 log 的位置
2023-07-13 14:13:24 +08:00
老广
d00ef2b051 Merge pull request #10960 from maninhill/patch-10
chore: 更新 README
2023-07-13 12:51:19 +08:00
maninhill
efc538a569 chore: 更新 README 2023-07-13 11:55:12 +08:00
ibuler
c1de9151b8 perf: 修改地址 2023-07-13 11:46:47 +08:00
ibuler
2898d25bf8 perf: 修改 log 的位置 2023-07-13 11:45:15 +08:00
jiangweidong
68e2de81d8 perf: windows winrm使用ntlm认证 2023-07-12 20:22:44 +08:00
fit2bot
dd5802316d perf: 修改 connect methods 支持 (#10945)
Co-authored-by: ibuler <ibuler@qq.com>
2023-07-11 19:29:56 +08:00
老广
6f1ab1e09a Merge pull request #10944 from jumpserver/pr@dev@perf_add_protocol_support
perf: 修改 protocols 默认值
2023-07-11 18:00:23 +08:00
ibuler
6096ccc30a perf: 修改 protocols 默认值 2023-07-11 17:59:18 +08:00
老广
ddbd142ea3 Merge pull request #10943 from jumpserver/pr@dev@perf_connect_method
perf: 修改组件支持
2023-07-11 17:29:05 +08:00
ibuler
61d8328337 perf: 修改 protocol 定义 2023-07-11 17:27:47 +08:00
ibuler
4caa704abe perf: 修改组件支持 2023-07-11 17:04:43 +08:00
fit2bot
b75d69de5d feat: 新增危险命令告警类型: Warning (#10929)
* feat: 新增危险命令告警类型: Warning

* feat: 新增危险命令告警类型: Warning

* feat: 新增危险命令告警类型: Warning

* feat: 新增危险命令告警类型: Warning

* feat: 新增危险命令告警类型: Warning

* perf: 优化命令告警 View 处理逻辑

---------

Co-authored-by: fangfang.dong <fangfang.dong@fit2cloud.com>
Co-authored-by: Bai <baijiangjie@gmail.com>
2023-07-11 12:06:11 +08:00
fangfang.dong
10fa122e2f perf: 清理无用代码 2023-07-11 11:59:02 +08:00
老广
00ff1644cb Merge pull request #10941 from jumpserver/pr@dev@add_help_text
perf: 修改 api mode 和 i18n
2023-07-11 11:47:06 +08:00
ibuler
2b51a7590e perf: 修改 api mode 和 i18n 2023-07-11 11:28:09 +08:00
老广
30d07820c7 Merge pull request #10914 from jumpserver/dependabot/pip/requirements/django-3.2.20
build(deps): bump django from 3.2.19 to 3.2.20 in /requirements
2023-07-11 10:55:54 +08:00
老广
c51ebd62df Merge pull request #10936 from jumpserver/pr@dev@fix_beat-task-repeated
fix: 修复 beat 定时任务重复执行的问题
2023-07-11 10:47:41 +08:00
老广
593e28d7fa Merge pull request #10938 from jumpserver/pr@dev@perf_add_kael
perf: 添加 kael terminal 类型
2023-07-11 10:38:32 +08:00
ibuler
89f1a1653d perf: 添加 kael terminal 类型 2023-07-11 10:31:36 +08:00
Bai
ad311c15ca fix: 增加 TypeError 捕获 2023-07-11 10:19:31 +08:00
老广
b10623c970 Merge pull request #10879 from jumpserver/pr@dev@feat_chatgpt_support
feat: 支持 chatgpt 资产
2023-07-11 09:59:04 +08:00
Bai
7d17c1a450 fix: 修复 beat 定时任务重复执行的问题 2023-07-10 19:28:19 +08:00
老广
100b1553b6 Merge pull request #10931 from jumpserver/pr@dev@perf_change_platform
perf: 修改 Platform 约束
2023-07-07 19:48:15 +08:00
ibuler
76af71bbbe perf: 修改 Platform 约束 2023-07-07 19:47:12 +08:00
fit2bot
9607ab5164 perf: 修改支持 AD (#10926)
* stash

* perf: 修改支持 AD

* perf: 优化 default

---------

Co-authored-by: ibuler <ibuler@qq.com>
2023-07-07 16:15:32 +08:00
Eric
61078ee2ed perf: 更新 Chrome 的 ChangeLog 路径 2023-07-06 19:41:11 +08:00
Eric
6a720cde0a perf: 更新 chrome 支持匿名账号 2023-07-06 19:41:11 +08:00
老广
a2a5d5e08b Merge pull request #10925 from jumpserver/pr@dev@wechat
perf: 去除readme 中的微信
2023-07-06 18:27:03 +08:00
feng
9c2cc65ce8 perf: 去除readme 中的微信 2023-07-06 18:26:05 +08:00
feng
ee3cdcd9e4 fix: 有默认值 required 为false 2023-07-06 10:33:36 +08:00
feng
89492410aa fix: 推送账号 不填写home 推送失败 2023-07-06 10:33:36 +08:00
dependabot[bot]
b324c6cc8a build(deps): bump django from 3.2.19 to 3.2.20 in /requirements
Bumps [django](https://github.com/django/django) from 3.2.19 to 3.2.20.
- [Commits](https://github.com/django/django/compare/3.2.19...3.2.20)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-05 23:26:55 +00:00
Bai
6b189e6162 fix: 修复导入LDAP数据库超时导致 Lock wait timeout 的问题 2023-07-05 18:49:01 +08:00
吴小白
a07cab9ae7 Merge pull request #10910 from jumpserver/pr@dev@perf_chrome
perf: 修正 Chrome driver 路径
2023-07-05 18:38:18 +08:00
Eric
751bd35349 perf: 修正 Chrome driver 路径 2023-07-05 18:28:31 +08:00
Bai
d6aaf23abb fix: 修复用户导入时手机号为dict类型报错的问题 2023-07-05 16:49:52 +08:00
Eric
f096014d03 perf: 移除针对端点 host 的校验 2023-07-05 15:39:54 +08:00
Eric
7f03639c34 perf: 更新翻译 2023-07-04 19:14:53 +08:00
Eric
3963881226 perf: 日文翻译更正 2023-07-04 19:14:53 +08:00
Eric
fb279dbc39 perf: 新增 SFTP 会话类型 2023-07-04 19:14:53 +08:00
fangfang.dong
785e4cc3e4 perf: 接口sql优化 /api/v1/perms/asset-permissions/<uuid:pk>/assets/all/ 2023-07-04 19:14:21 +08:00
jiangweidong
dd846d4183 feat: 云同步支持公有云 2023-07-04 18:48:07 +08:00
Eric_Lee
9169f3546a Revert "perf: rdp7 可使用 web gui方式连接" 2023-07-04 18:09:33 +08:00
Eric_Lee
7e2c0d0a2d Merge pull request #10896 from jumpserver/revert-10880-pr@dev@perf_xrdp_rdp7
Revert "perf: add xrdp rdp7 port 3390"
2023-07-04 17:57:33 +08:00
老广
66c60ef5be Revert "perf: add xrdp rdp7 port 3390" 2023-07-04 17:35:58 +08:00
fit2bot
f095998096 perf: 改密与推送保持一致 (#10812)
* perf: 改密与推送保持一致

* perf: 增加 i18n

---------

Co-authored-by: feng <1304903146@qq.com>
Co-authored-by: Bai <baijiangjie@gmail.com>
2023-07-04 17:34:31 +08:00
老广
d06e5d0001 Merge pull request #10826 from jumpserver/pr@dev@perf_account_template
perf: 接口sql优化 /api/v1/accounts/account-templates/su-from-account-templates/
2023-07-04 13:42:04 +08:00
老广
c8f420f62d Merge pull request #10893 from jumpserver/pr@dev@perf_rdp7_web
perf: rdp7 可使用 web gui方式连接
2023-07-04 13:39:28 +08:00
Eric
02550b38f8 perf: rdp7 可使用 web gui方式连接 2023-07-04 12:52:36 +08:00
老广
50531d3b97 Merge pull request #10829 from jumpserver/pr@dev@perf_support_anonymous_account
perf: web 和 自定义类型资产支持匿名账号
2023-07-04 11:46:24 +08:00
ibuler
db7ad81103 merge: 合并 dev 2023-07-04 11:45:20 +08:00
ibuler
d72ec653f4 merge: 合并 dev 2023-07-04 11:43:33 +08:00
老广
7950718582 Merge pull request #10825 from jumpserver/pr@dev@perf_asset_node
perf: 接口sql优化 /api/v1/assets/nodes/children/tree/
2023-07-04 11:28:45 +08:00
老广
998321f090 Merge pull request #10882 from jumpserver/pr@dev@perf_dockerfile
feat: 合并 Dockerfile
2023-07-04 11:26:23 +08:00
老广
1fa258da3e Merge pull request #10889 from jumpserver/pr@dev@perf_connectiontoken
perf: 修复 ConnectionToken 中 account id 的问题
2023-07-04 11:18:25 +08:00
ibuler
8dbe61100b perf: 优化协议,支持 port from addr 2023-07-04 10:29:27 +08:00
Eric
d7f9f3b670 perf: 修复 ConnectionToken 中 account id 的问题 2023-07-03 19:19:25 +08:00
老广
8b18f46613 Merge pull request #10880 from jumpserver/pr@dev@perf_xrdp_rdp7
perf: add xrdp rdp7 port 3390
2023-07-03 16:29:06 +08:00
吴小白
eb49beaf46 fix: 修正 oracle 路径 2023-07-03 10:37:42 +08:00
吴小白
3971fce561 feat: 合并 Dockerfile 2023-07-03 10:28:25 +08:00
Eric
2f81196874 perf: 更新 rdp7 protocol 设置 2023-07-03 10:22:49 +08:00
Eric
411102ed85 perf: 完善 protocol 匹配 2023-07-03 10:14:39 +08:00
Eric
125dc2adf5 perf: 针对 rdp7 端口特殊处理 2023-07-03 10:14:39 +08:00
Eric
6001175629 perf: add xrdp rdp7 port 3390 2023-07-03 10:14:39 +08:00
ibuler
41e39c9614 perf: 修改 chatgpt 协议 2023-06-30 18:33:18 +08:00
ibuler
19de79fadf feat: 支持 chatgpt 资产 2023-06-30 17:35:49 +08:00
老广
6b7df10d50 Merge pull request #10877 from jumpserver/pr@dev@perf_applet_chrome
perf: 更新 Python
2023-06-30 16:01:18 +08:00
吴小白
ce269e315a perf: 更新 Python 2023-06-30 15:58:20 +08:00
老广
dfc8654d96 Merge pull request #10876 from jumpserver/pr@dev@perf_applet_chrome
perf: 更新 Chrome
2023-06-30 15:58:18 +08:00
吴小白
ea07f9e56a perf: 更新 Chrome 2023-06-30 15:55:32 +08:00
fit2bot
bbbd011cc2 perf: 修改 protocol setting (#10875)
* feat: 新增账号配置

* perf: 修改 platform protocol define

* perf: 修改 account config

* perf: 修改协议设置

---------

Co-authored-by: ibuler <ibuler@qq.com>
2023-06-30 15:54:06 +08:00
老广
6962430e6a Merge pull request #10874 from jumpserver/pr@dev@perf_accountsearch
perf: 账号搜索支持通过 secret_type 过滤
2023-06-30 15:22:14 +08:00
Bai
ca1b82330e perf: 账号搜索支持通过 secret_type 过滤 2023-06-30 11:12:23 +08:00
fit2bot
f4bd06b970 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(12) (#10870)
Co-authored-by: Bai <baijiangjie@gmail.com>
Co-authored-by: Bryan <jiangjie.bai@fit2cloud.com>
2023-06-29 17:15:19 +08:00
Bai
d0bf5b46f6 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(11) 2023-06-29 17:12:21 +08:00
Bai
3c707996e0 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(10) 2023-06-29 17:05:38 +08:00
Bai
ac0a673818 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(9) 2023-06-29 17:00:36 +08:00
Bai
1ed6c7e01d feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(8) 2023-06-29 16:54:28 +08:00
Bai
adcabf69ed feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(7) 2023-06-29 16:43:00 +08:00
Bai
0b92e43e20 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(6) 2023-06-29 16:43:00 +08:00
Bai
9c1a6b8565 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(5) 2023-06-29 16:07:04 +08:00
Bai
fc8d226005 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(4) 2023-06-29 15:42:14 +08:00
Bai
f3955a47f6 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(3) 2023-06-29 15:25:08 +08:00
Bai
0020fe7be0 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(2) 2023-06-29 15:18:54 +08:00
Bai
cea56a2f7e feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签(1) 2023-06-29 14:50:27 +08:00
Bai
e3cf6cc476 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签 2023-06-29 14:28:38 +08:00
Bai
57fccc9baf feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签 2023-06-29 14:18:23 +08:00
Aaron3S
fbcb0da349 feat: 支持sqlserver 通过chen 链接 2023-06-29 11:41:06 +08:00
Bai
877a053717 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签 2023-06-29 11:40:43 +08:00
Bai
d293a03649 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签 2023-06-29 11:30:04 +08:00
Bai
08e0c5fdf5 feat: 优化 Issue GitHub Actions,当研发团队成员评论后再移除 待处理 标签 2023-06-29 11:17:37 +08:00
nut
ac906a5d52 Update api.py 2023-06-28 17:52:23 +08:00
fangfang.dong
9ad8e53743 perf: 接口sql优化 /api/v1/index/ 2023-06-28 17:52:23 +08:00
ibuler
a67ee976b4 perf: 修改翻译 2023-06-27 16:03:19 +08:00
ibuler
dfa12239d6 perf: 修改翻译 2023-06-27 16:00:45 +08:00
ibuler
4737e2cf4a perf: 优化 匿名账号 2023-06-27 15:22:18 +08:00
ibuler
d3d8fcbbb3 perf: 修改经常遇到的登录超时 2023-06-27 14:50:04 +08:00
Eric
a64aa89b3f fix: 修复自定义远程应用的连接问题 2023-06-27 14:43:00 +08:00
ibuler
a22f36a06a perf: 去掉 debug 2023-06-27 14:31:20 +08:00
Bryan
17fa139bc9 feat: Update ----.md 2023-06-27 14:24:27 +08:00
ibuler
77bcb05d80 perf: web 和 自定义类型资产支持匿名账号 2023-06-27 11:23:56 +08:00
fangfang.dong
4e9012cc07 perf: 接口sql优化 /api/v1/accounts/account-templates/su-from-account-templates/ 2023-06-27 10:45:50 +08:00
fangfang.dong
b3dce27309 perf: 接口sql优化 /api/v1/assets/nodes/children/tree/ 2023-06-27 10:24:47 +08:00
老广
bccf3a0340 Merge pull request #10819 from jumpserver/pr@dev@perf_asset_asset
perf: 接口sql优化 /api/v1/assets/assets/
2023-06-27 09:55:11 +08:00
nut
358b3a1891 Update asset.py 2023-06-26 23:51:59 +08:00
feng
5a2f6bdfc9 perf: ldap sync任务开始时 先检查可连接性 2023-06-25 18:25:15 +08:00
feng
768eb033eb fix: 修复自动化任务原子性error 导致整个任务失败问题 2023-06-25 18:20:49 +08:00
fangfang.dong
d7d554daf5 perf: 接口sql优化 /api/v1/assets/assets/ 2023-06-25 18:08:59 +08:00
jiangweidong
780b1104de perf: 优化飞书接收到的工单审批的连接无法点击的问题 2023-06-25 11:08:14 +08:00
老广
eeba0a4bfc Merge pull request #10806 from jumpserver/pr@dev@feat_terminal_endpointrule
feat: 系统设置 - 终端设置 - 端点规则: 新增字段is_active控制是否启用
2023-06-21 18:36:37 +08:00
fangfang.dong
b2ee8c8216 feat: 系统设置 - 终端设置 - 端点规则: 新增字段is_active控制是否启用 2023-06-21 18:33:58 +08:00
ibuler
26edd2f040 perf: 修改去掉一些 debug 2023-06-21 17:49:16 +08:00
ibuler
270ed5e2f8 perf: 修改 logging 避免冲突 2023-06-21 17:49:16 +08:00
Eric
b2bff22387 fix: 修复远程应用会话无法监控的问题 2023-06-21 14:48:18 +08:00
ibuler
1ca71f78ed perf: 优化一下,去掉 rbac 引起的 sql查询 2023-06-21 14:46:59 +08:00
ibuler
fa24a8e2f3 perf: 添加 sql debug 2023-06-21 12:02:56 +08:00
Bai
b9c1a89f51 fix: 修复迁移文件时触发信号记录操作日志导致迁移失败的问题 2023-06-21 11:02:42 +08:00
ibuler
a2bbf11f9d perf: 添加 migrate debug msg 2023-06-21 11:01:21 +08:00
ibuler
1d084311c5 perf: 统一 connect token 配置名称 2023-06-20 16:40:21 +08:00
ibuler
cb0fd937c8 perf: 资产连接可以指定 AppletHost 2023-06-20 16:37:54 +08:00
ibuler
13fc2aa73c perf: 优化rbac 迁移 2023-06-20 16:35:01 +08:00
Eric
5d9979ec03 perf: 修复 terminal 显示问题 2023-06-20 16:34:03 +08:00
Eric
e4f21b8a5f perf: 移除 omnidb 2023-06-19 18:31:59 +08:00
feng
9403b76333 fix: 修改 push_account_params 数据迁移逻辑,不在导入公共方法生成数据 2023-06-19 18:23:57 +08:00
fit2bot
666df6ffef perf: 接口 /api/v1/tickets/tickets/ sql优化 (#10762)
* perf: 接口 /api/v1/tickets/tickets/ sql优化

* Update general.py

* Update general.py

* Update general.py

---------

Co-authored-by: fangfang.dong <fangfang.dong@fit2cloud.com>
Co-authored-by: nut <evicwork@gmail.com>
2023-06-19 18:19:52 +08:00
Chenyang Shen
9cc3942b3d Merge pull request #10779 from jumpserver/pr@dev@perf_terminal_chen
perf: 新增 chen 终端类型
2023-06-19 18:18:12 +08:00
Eric
42852c368c perf: 新增 chen 终端类型 2023-06-19 18:06:23 +08:00
ibuler
4d4644dddd fix: 修改原来 platform 为 device 时,导致的 asset 类型不对 2023-06-19 17:54:42 +08:00
cui fliter
471411a1aa fix some typos
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-06-19 15:19:41 +08:00
老广
db12bc07e8 Merge pull request #10760 from jumpserver/pr@dev@perf_assets_domain
perf: 接口 /api/v1/assets/domains/ sql优化
2023-06-19 10:25:20 +08:00
老广
618ee0b2f9 Merge pull request #10761 from jumpserver/pr@dev@perf_assets_label
perf: 接口 /api/v1/assets/label/ sql优化
2023-06-19 10:24:52 +08:00
fangfang.dong
39ba52e4de perf: 接口 /api/v1/assets/label/ sql优化 2023-06-18 20:26:19 +08:00
fangfang.dong
a8ef405939 perf: 接口 /api/v1/assets/domains/ sql优化 2023-06-18 20:24:14 +08:00
老广
09f7ddd28a Merge pull request #10756 from jumpserver/pr@dev@fix_custom_asset_detail_error
perf: 修复自定义资产详情没有 auto_config 的问题
2023-06-16 18:48:24 +08:00
ibuler
da4337168f perf: 修复自定义资产详情没有 auto_config 的问题 2023-06-16 18:44:13 +08:00
老广
f13966e061 Merge pull request #10754 from jumpserver/pr@dev@fix_permed_asset_duplicate
fix: 修复授权资产根据协议搜索重复的问题
2023-06-16 16:53:43 +08:00
ibuler
f4b5a302a1 fix: 修复授权资产根据协议搜索重复的问题 2023-06-16 16:44:05 +08:00
老广
dd955530f1 Merge pull request #10746 from jumpserver/pr@dev@perf_category_api_sql
perf: 修改 category 引起的 sql 查询过多
2023-06-16 15:55:27 +08:00
ibuler
50b64f6cf5 perf: 修改 category 引起的 sql 查询过多
pref: stash

perf: 添加装饰器

perf: 优化 category api
2023-06-16 15:53:48 +08:00
老广
a5b21f94c2 Merge pull request #10752 from jumpserver/pr@dev@perf_custom_field_required
perf: 优化自定义 platform field
2023-06-16 15:16:58 +08:00
ibuler
9e3e183f95 perf: 优化自定义 platform field 2023-06-16 15:07:17 +08:00
ibuler
9ec3147b5f perf: 修改 login acls 迁移冲突问题
perf: 修改 login acls 迁移,避免冲突
2023-06-16 13:59:15 +08:00
老广
79fa134621 Merge pull request #10742 from jumpserver/pr@dev@windows_rdp_ping
feat: 添加自动化任务rdp ping
2023-06-15 18:34:45 +08:00
feng
ef4132d2c5 feat: 添加自动化任务rdp ping 2023-06-15 18:33:05 +08:00
老广
b31a08ed8d Merge pull request #10741 from jumpserver/pr@dev@fix_acl_migrate_not_work
perf: 修复 acl 迁移后无法使用
2023-06-15 18:32:34 +08:00
ibuler
cdd47f4bc6 perf: 修复 acl 迁移后无法使用 2023-06-15 18:13:51 +08:00
ibuler
269a5e9d52 perf: 龙芯使用 buster 镜像 2023-06-15 17:39:21 +08:00
老广
dd0d1d3592 Merge pull request #10735 from jumpserver/pr@dev@change_docker_base_image
perf: 修改基础镜像
2023-06-15 16:59:58 +08:00
ibuler
c06368d812 perf: 修改基础镜像 2023-06-15 16:53:28 +08:00
fit2bot
96ef56da67 perf: 修改翻译 (#10733)
Co-authored-by: feng <1304903146@qq.com>
2023-06-15 15:41:07 +08:00
Jiangjie.Bai
0a1b379dcd Merge pull request #10731 from jumpserver/dev
v3.4.0
2023-06-15 14:16:39 +08:00
老广
54926f7c70 Merge pull request #10729 from jumpserver/pr@dev@perf_custom_asset_support_required_field
perf: 自定义 field 支持 required
2023-06-15 13:18:06 +08:00
ibuler
a48d0046a9 perf: 自定义 field 支持 required 2023-06-15 13:14:02 +08:00
fit2bot
852435c7d5 perf: user 序列化添加is_org_admin 字段 (#10728)
Co-authored-by: feng <1304903146@qq.com>
2023-06-15 12:15:04 +08:00
老广
b19d9c8754 Merge pull request #10727 from jumpserver/pr@dev@perf_acl_ordering
perf: 优化 acl 默认排序
2023-06-15 10:49:07 +08:00
ibuler
e92c82568d perf: 优化 acl 默认排序 2023-06-15 10:45:07 +08:00
老广
c6e19a2989 Merge pull request #10726 from jumpserver/pr@dev@perf_json_field_re_error
perf: 优化 json field re 报错问题
2023-06-15 10:32:12 +08:00
ibuler
58edf02179 perf: 优化 json field re 报错问题 2023-06-15 10:27:52 +08:00
老广
3e9bafadec Merge pull request #10725 from jumpserver/pr@dev@perf_json_attr_m2m_filter
perf: 优化修改 rule vlaue
2023-06-15 10:17:36 +08:00
ibuler
70af478f66 perf: 优化修改 rule vlaue 2023-06-15 10:16:18 +08:00
ibuler
d7121296f2 perf: 优化使用 bool 2023-06-15 10:14:59 +08:00
老广
a76b243226 Merge pull request #10724 from jumpserver/pr@dev@fix_image
fix: 修正基础镜像名称
2023-06-15 10:14:03 +08:00
吴小白
5bd276b9ce fix: 修正基础镜像名称 2023-06-15 10:02:08 +08:00
老广
abd4e87bc2 Merge pull request #10723 from jumpserver/pr@dev@perf_json_attr_m2m_filter
perf: 优化 json m2m filter
2023-06-15 09:40:39 +08:00
ibuler
40d8a71bf8 perf: 优化 json m2m filter 2023-06-15 09:37:00 +08:00
老广
aad804f1af Merge pull request #10722 from jumpserver/pr@dev@perf_json_filter_m2m
perf: 优化 json m2m filter
2023-06-14 21:11:41 +08:00
ibuler
ee15f2d3d7 perf: 优化 json m2m filter 2023-06-14 21:10:35 +08:00
fit2bot
7c31b4ee30 perf: 修改翻译 (#10721)
Co-authored-by: feng <1304903146@qq.com>
2023-06-14 20:42:29 +08:00
ibuler
25e7249957 perf: 优化正则匹配 2023-06-14 20:41:14 +08:00
Aaron3S
d10db0aa62 fix: 修复任务被黑名单拦截后没有更新状态的问题 2023-06-14 20:40:40 +08:00
老广
d87ece00bd Merge pull request #10718 from jumpserver/pr@dev@perf_phone
perf: 优化 phone
2023-06-14 20:23:59 +08:00
ibuler
fca3936a79 perf: 优化 phone 2023-06-14 20:22:41 +08:00
Aaron3S
2c2334b618 perf: 优化报错内容 2023-06-14 20:16:42 +08:00
Aaron3S
9e31a5064b perf: 优化黑名单命令提示 2023-06-14 20:16:42 +08:00
Bai
954f86f8a9 fix: 修复执行任务中心报错的问题 2023-06-14 19:57:55 +08:00
老广
a3d32c901d Merge pull request #10715 from jumpserver/pr@dev@perf_filter_q_name
perf: 优化 filter name
2023-06-14 19:12:54 +08:00
ibuler
ce5ddf7873 perf: 优化 filter name 2023-06-14 19:10:34 +08:00
老广
29ebdb03e7 Merge pull request #10711 from jumpserver/pr@dev@perf_json_field_select
perf: 优化查询 acls
2023-06-14 18:19:42 +08:00
ibuler
53c3c90e2d perf: 优化查询 acls 2023-06-14 18:17:20 +08:00
nut
4bcd47df64 Update mixins.py 2023-06-14 17:10:38 +08:00
nut
d51323faef Update mixins.py 2023-06-14 17:10:38 +08:00
fangfang.dong
e8163167c5 修复: 控制台 - 账号 - 账号列表 - 查看账号详情时的500错误 2023-06-14 17:10:38 +08:00
Eric
e762a5d8ae perf: 更新发布机的单用户单会话策略 2023-06-14 16:49:37 +08:00
老广
dd85e2d74f Merge pull request #10707 from jumpserver/pr@dev@perf_connect_methods
perf: 优化连接方式
2023-06-14 15:14:45 +08:00
ibuler
96a66e555f perf: 优化连接方式 2023-06-14 14:48:50 +08:00
fit2bot
120f0dd3ad perf: asset web autofill 添加LabeledChoiceField (#10706)
Co-authored-by: feng <1304903146@qq.com>
2023-06-14 14:42:53 +08:00
Bai
de43df8370 perf: 修改 LDAP 用户导入任务名称 2023-06-14 11:07:38 +08:00
ibuler
459176550d perf: 修改 applet 是否支持并发,也依赖于 host 2023-06-13 19:44:59 +08:00
Eric
4112ad21c3 perf: 增加 terminal 显示字段 2023-06-13 19:44:39 +08:00
Eric
df8baede43 perf: 修复部分录像播放问题 2023-06-13 19:44:39 +08:00
fit2bot
5bd4a882cc fix: 平台导入无协议port (#10702)
Co-authored-by: feng <1304903146@qq.com>
2023-06-13 17:57:48 +08:00
老广
370d944396 Merge pull request #10698 from jumpserver/pr@dev@perf_applethost_options
perf: 修正发布机部署单用户单会话选项
2023-06-13 15:56:01 +08:00
fit2bot
c056cde2b7 perf: 修改翻译 (#10697)
Co-authored-by: feng <1304903146@qq.com>
2023-06-13 15:51:52 +08:00
Eric
93c0f11a5f perf: 修正发布机部署单用户单会话选项 2023-06-13 15:50:21 +08:00
老广
91ea738dcd Merge pull request #10695 from jumpserver/pr@dev@perf_acl_account_migrate
perf: 优化 acl 迁移中的 accounts
2023-06-13 14:41:02 +08:00
ibuler
0d3478c728 perf: 优化 acl 迁移中的 accounts 2023-06-13 14:38:52 +08:00
老广
c271d3276a Merge pull request #10693 from O-Jiangweidong/pr@dev@perf_ftp_log_field_same_as_session
perf: 字段含义和Session model保持一致
2023-06-13 13:59:59 +08:00
jiangweidong
dfd1ececdb perf: 删除翻译信息 2023-06-13 13:58:27 +08:00
jiangweidong
4683ae8c09 perf: 修改迁移文件中的字段信息 2023-06-13 13:54:59 +08:00
老广
db3fca0409 Merge pull request #10694 from jumpserver/pr@dev@perf_acls_filter
perf: 优化 json m2m field 正向查询
2023-06-13 13:50:31 +08:00
老广
9f4cb2e790 Merge pull request #10691 from O-Jiangweidong/pr@dev@fix_upgrade_34_error
fix: 解决migrate文件中迁移数据会触发信号导致字段不对应错误引发迁移失败问题
2023-06-13 13:49:31 +08:00
ibuler
7e9d1fc945 perf: 优化 json m2m field 正向查询 2023-06-13 13:48:32 +08:00
jiangweidong
af018ea262 perf: 字段含义和Session model保持一致 2023-06-13 13:18:50 +08:00
jiangweidong
71ccfe66ec fix: 解决migrate文件中迁移数据会触发信号导致字段不对应错误引发迁移失败问题 2023-06-13 13:14:38 +08:00
jiangweidong
a991a6c56c perf: 优化变量名 2023-06-13 11:36:32 +08:00
jiangweidong
9a29cda210 fix: 提供给luna的录像地址不能为本地local地址,应该为url 2023-06-13 11:36:32 +08:00
老广
aee20a6c05 Merge pull request #10686 from jumpserver/pr@dev@perf_applet_import
perf: 优化 applet 导入
2023-06-13 10:04:02 +08:00
老广
499c52800e Merge pull request #10689 from jumpserver/pr@dev@perf_ticket_request_login
perf: 优化登录 ticket 创建
2023-06-13 10:03:36 +08:00
ibuler
4a2f7d21f6 perf: 优化登录 ticket 创建 2023-06-13 09:54:03 +08:00
ibuler
44d92b9dec perf: 修改 acl user review 2023-06-12 19:12:11 +08:00
ibuler
1e9310bf0c perf: 优化 applet 导入 2023-06-12 19:00:59 +08:00
老广
1b750cf51d Merge pull request #10682 from jumpserver/pr@dev@allow_chrome_some_shortcut
perf: 放行快捷键 ctrl-c-v
2023-06-12 18:36:16 +08:00
ibuler
e9125d1228 perf: 修改 chrome error 2023-06-12 18:35:27 +08:00
老广
c85df4cf42 Merge pull request #10685 from jumpserver/pr@dev@fix_command_filter_acls_error
perf: 优化命令过滤 acl 获取
2023-06-12 18:28:52 +08:00
ibuler
09a5b63240 perf: 修改 acl filter 2023-06-12 18:28:04 +08:00
ibuler
f9bc7ec4aa perf: 优化命令过滤 acl 获取 2023-06-12 18:20:30 +08:00
fit2bot
d59a293bb9 perf: 修改用户组添加全部用户api的权限位 (#10683)
Co-authored-by: feng <1304903146@qq.com>
2023-06-12 18:16:09 +08:00
ibuler
cb2b8bb70b perf: 放行快捷键 ctrl-c-v 2023-06-12 16:37:12 +08:00
老广
86c81c42de Merge pull request #10681 from jumpserver/pr@dev@perf_global_acl
perf: 优化 manager 和 acl 的 组织
2023-06-12 16:02:45 +08:00
ibuler
5c2b54ad3b perf: 优化 manager 和 acl 的 组织 2023-06-12 16:00:14 +08:00
Eric
b79aaff4a0 perf: 资产根据 ssh 协议过滤是否启用 sftp 2023-06-12 15:42:24 +08:00
jiangweidong
3fd8e5755d fix: 修改变量 2023-06-12 15:41:25 +08:00
jiangweidong
3604ef4228 fix: 解决录像无法在线观看的问题 2023-06-12 15:41:25 +08:00
Bai
24272d3162 fix: 修复 Token API 获取命令过滤器失败的问题 2023-06-12 14:11:44 +08:00
ibuler
a99d22708c perf: 修改 migrations 2023-06-12 14:10:37 +08:00
ibuler
dc35a8c52b perf: 优化 acl 默认排序和manager 2023-06-12 14:10:37 +08:00
老广
fc90ced2b0 Merge pull request #10675 from jumpserver/pr@dev@json_field_add_requirement
perf: m2m json field 字段必填
2023-06-12 13:41:34 +08:00
老广
7bfe8816a3 Merge pull request #10674 from jumpserver/pr@dev@perf_config
perf: 优化配置
2023-06-12 13:36:49 +08:00
Bai
b4008338c6 perf: 优化配置 2023-06-12 11:24:12 +08:00
ibuler
6058f1bdc0 perf: m2m json field 字段必填 2023-06-12 11:03:04 +08:00
ibuler
5708e57631 perf: m2m json field 字段必填 2023-06-12 10:25:14 +08:00
老广
ba353271ad Merge pull request #10667 from jumpserver/pr@dev@fix_login_regex_error
perf: 修复 正则匹配的 bug
2023-06-09 18:35:23 +08:00
ibuler
adfc22ae85 perf: 修复 正则匹配的 bug 2023-06-09 18:32:56 +08:00
jiangweidong
ef2ecb225a fix: 资产登录规则操作日志显示优化 2023-06-09 18:25:00 +08:00
ibuler
9574d03c12 fix: 修复连接方式选择 2023-06-09 18:22:35 +08:00
Bai
00d3caf80c perf: 删除不用代码 2023-06-09 18:22:04 +08:00
fit2bot
2333a29a56 perf: 优化数据库改密原子性 (#10663)
Co-authored-by: feng <1304903146@qq.com>
2023-06-09 16:52:54 +08:00
fit2bot
b3c5674213 fix: 资产用模版创建账号无切换至 (#10662)
Co-authored-by: feng <1304903146@qq.com>
2023-06-09 16:23:44 +08:00
老广
f372f1e417 Merge pull request #10659 from jumpserver/pr@dev@perf_applet
perf: 添加 edition 字段
2023-06-09 16:05:10 +08:00
ibuler
a86378601a perf: 修改插件 2023-06-09 15:58:30 +08:00
ibuler
6a73cd6b77 perf: 添加 edition 字段 2023-06-09 15:40:41 +08:00
Eric
3022ca983c perf: Dockerfile 增加依赖 2023-06-08 22:09:37 +08:00
老广
8f8e781376 Merge pull request #10655 from jumpserver/pr@dev@fix_login_acl_uniq
perf: 优化 LoginACL 迁移,避免 uniq error
2023-06-08 18:35:23 +08:00
ibuler
998505e999 perf: 修改 acl 登录 2023-06-08 18:33:43 +08:00
ibuler
1c95b67154 perf: 优化 LoginACL 迁移,避免 uniq error 2023-06-08 18:19:32 +08:00
jiangweidong
2837dcf40e feat: 支持文件上传下载备份 (#10438)
* feat: 支持文件上传下载备份

* perf: 抽离replay和ftpfile存储代码

* perf: FTPLog增加session字段

* fix: 修改变量名
2023-06-08 18:04:07 +08:00
ibuler
271ec1bfe0 perf: 优化刚才修改导致的 acls 过滤没有过滤组织 2023-06-08 18:03:49 +08:00
老广
41e147d4b2 Revert "chore(deps): bump cryptography from 38.0.4 to 41.0.0 in /requirements"
This reverts commit 0025b2483e.
2023-06-08 14:57:34 +08:00
老广
d2f1309900 Merge pull request #10644 from jumpserver/pr@dev@perf_acls_connect_methods
perf: 优化 connect method acls 和登录 acls
2023-06-08 14:52:10 +08:00
dependabot[bot]
0025b2483e chore(deps): bump cryptography from 38.0.4 to 41.0.0 in /requirements
Bumps [cryptography](https://github.com/pyca/cryptography) from 38.0.4 to 41.0.0.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/38.0.4...41.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-08 14:19:06 +08:00
fangfang.dong
a6d586efb4 feat: 系统设置 - 短信服务 - 多平台配置测试手机号: 增加区号显示与修改功能 2023-06-08 11:01:55 +08:00
jiangweidong
f0c0ba3653 fix: 解决lina不显示json格式参数,优化DictSerializer改为JSONSerialzer, 2023-06-08 10:26:33 +08:00
ibuler
d6eb4bcbd2 perf: 优化 connect method acls 和登录 acls 2023-06-07 17:39:56 +08:00
fit2bot
bfd77aa1b0 feat: automation windows pyrdp ping (#10602)
* feat: automation windows pyrdp ping

* perf: add pyfreerdp deps

---------

Co-authored-by: feng <1304903146@qq.com>
Co-authored-by: Eric <xplzv@126.com>
2023-06-07 17:28:35 +08:00
老广
cc57fcacce Merge pull request #10621 from jumpserver/pr@dev@fix_static_js
fix: 修复 jumpserver.js 文件中 rules_id_map_label 变量缺失引起的用户初次登录修改密码表单无法校验提示的错误
2023-06-07 10:36:25 +08:00
Eric
7d3b60232c perf: 优化翻译 2023-06-06 19:13:22 +08:00
Eric
10996f573a perf: 翻译 i18n 信息 2023-06-06 19:13:22 +08:00
老广
a7ca9ccfe9 Merge pull request #10629 from jumpserver/pr@dev@feat_connect_support_options
perf: 连接时支持连接参数
2023-06-05 18:00:44 +08:00
ibuler
c6f92a462f perf: 连接时支持连接参数 2023-06-05 17:27:44 +08:00
fit2bot
a341b55f43 perf: 一些资产没有默认节点+ (#10622)
Co-authored-by: feng <1304903146@qq.com>
2023-06-05 15:10:33 +08:00
fangfangdong
3c68b880a7 fix: 修复 jumpserver.js 文件中 rules_id_map_label 变量缺失引起的用户初次登录修改密码表单无法校验提示的错误 2023-06-05 15:00:25 +08:00
Eric
42c35b0271 perf: chrome 脚本增加 sleep 等待指令,单位秒 2023-06-02 16:14:49 +08:00
Eric
8d8f479da6 perf: dbeaver 支持使用网关连接数据库 2023-06-02 16:13:10 +08:00
fit2bot
9d8c1bb317 perf: 账号模版更新时, 优化同步更新账号逻辑 (#10611)
Co-authored-by: feng <1304903146@qq.com>
2023-06-02 10:56:00 +08:00
Bai
ed117ceac3 perf: 优化创建节点时校验同级节点名称不允许重复(API方式) 2023-06-01 16:39:44 +08:00
fit2bot
1ac9d727ef perf: 修改翻译 (#10604)
Co-authored-by: feng <1304903146@qq.com>
2023-05-31 18:19:11 +08:00
fangfangdong
a0bb25e558 feat: 系统设置-安全设置 支持配置 作业中心命令黑名单 2023-05-31 17:43:05 +08:00
Bai
51d6090fdc perf: 优化支持账号列表搜索资产名称 2023-05-31 16:50:37 +08:00
ibuler
d402de012b perf: 优化写法,避免重复 2023-05-31 16:48:50 +08:00
ibuler
2a183e34ac perf: 修改去掉 debug 2023-05-31 16:48:50 +08:00
ibuler
7d111b6efb perf: 优化自定义平台和 applet 导入 2023-05-31 16:48:50 +08:00
Bai
0ba7ca6373 perf: 升级依赖 certifi==2022.12.7 2023-05-31 14:20:59 +08:00
jiangweidong
51e5733f1c fix: 具有超级工单权限的用户申请工单可以指定给某人 (#10596) 2023-05-31 10:20:37 +08:00
fit2bot
3626bf8df6 feat: 命令及录像存储可连接性定时检查 (#10594)
Co-authored-by: feng <1304903146@qq.com>
2023-05-30 18:45:51 +08:00
ibuler
312213f1c5 perf: 允许 web 同时打开 2023-05-30 18:43:04 +08:00
ibuler
d285daa1c1 perf: 资产支持根据协议搜索 2023-05-30 17:55:34 +08:00
ibuler
f4c29a262a perf: 优化自动化任务在平台中的名称显示 2023-05-30 17:17:47 +08:00
fangfangdong
b98ccf8b3d style: 调整国际化文件中时间单位显示方式 2023-05-30 17:04:50 +08:00
Bai
ef7886b25b perf: 升级依赖 jms-storage==0.0.46 2023-05-30 15:08:04 +08:00
火星小刘
89b42ce51b 企业微信扫描登录修改为新版接口,在PC登录企业微信客户端的情况下,不再需要手机扫码。
企业微信官方api
https://developer.work.weixin.qq.com/document/path/98151
2023-05-30 14:58:58 +08:00
老广
e5c93dc50f Merge pull request #10585 from jumpserver/pr@dev@perf_chrome_extensions
perf: 优化 chrome 插件
2023-05-30 11:01:25 +08:00
ibuler
50d8389fff perf: 优化 chrome 插件 2023-05-30 10:59:16 +08:00
老广
5edacf369b Merge pull request #10583 from jumpserver/pr@dev@perf_perm_action_helptext
perf: 优化授权中动作的说明
2023-05-30 09:52:38 +08:00
ibuler
7a39552bb2 merge: with dev 2023-05-30 09:47:59 +08:00
fit2bot
e61227d694 perf: 登录资产的 ACL 支持 ip 控制 (#10581)
Co-authored-by: ibuler <ibuler@qq.com>
2023-05-29 19:45:55 +08:00
ibuler
0901b95ce0 perf: 优化授权中动作的说明 2023-05-29 18:23:26 +08:00
feng
fd7e821f11 feat: 用户组绑定所有用户 2023-05-29 16:27:51 +08:00
Eric
ac3415d95c perf: 完善远程应用 chrome 启动方式 2023-05-29 15:25:32 +08:00
Eric
b0b174bb2a perf: connection token 的 account 增加 asset 属性 2023-05-29 15:14:31 +08:00
dependabot[bot]
3c568510cf chore(deps): bump requests from 2.28.0 to 2.31.0 in /requirements
Bumps [requests](https://github.com/psf/requests) from 2.28.0 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.28.0...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 11:17:18 +08:00
halo
a1ed59d116 perf: yaml文件读取使用utf-8编码 2023-05-29 11:16:29 +08:00
Bai
7708812556 perf: 优化终端端点 Host 字段帮助 2023-05-26 17:20:50 +08:00
Bai
24a98eb747 perf: 优化短信设置的字段名称显示 2023-05-26 15:19:11 +08:00
老广
60fd5a2e91 Merge pull request #10556 from jumpserver/pr@dev@fix_chrome_path
fix: 修正 Chrome 环境变量
2023-05-25 19:19:45 +08:00
ibuler
9932e7eadd perf: 资产授权支持 delete 控制 2023-05-25 19:15:48 +08:00
fit2bot
73102fceb0 fix: 修复禁用平台的账号切换功能,历史创建的切换账号依然可以正常切换 (#10560)
Co-authored-by: feng <1304903146@qq.com>
2023-05-25 18:38:14 +08:00
Bai
5e177b6ce5 fix: 修复用户登录认证 MFA 输入错误时没有记录具体错误信息的问题 2023-05-25 18:26:04 +08:00
吴小白
38b121421f fix: 修正 Chrome 环境变量 2023-05-25 17:42:19 +08:00
fit2bot
a6366a2dd4 perf: ldap 能多组织同步用户 (#10543)
Co-authored-by: feng <1304903146@qq.com>
Co-authored-by: feng626 <57284900+feng626@users.noreply.github.com>
2023-05-25 17:35:36 +08:00
ibuler
fa21c83db3 perf: LDAP 测试 api 改为异步的 2023-05-25 16:54:22 +08:00
feng
f20a4beef3 fix: 自定义平台无自动化任务 2023-05-25 16:53:56 +08:00
ibuler
cc2e42c77a perf: chrome 添加插件 2023-05-25 14:20:05 +08:00
jiangweidong
bcb4e04200 perf: 忽略自定义短信认证请求证书校验 2023-05-25 14:13:48 +08:00
jiangweidong
848ea0cf3c perf: 修改翻译 2023-05-25 14:13:48 +08:00
jiangweidong
20cc4ea320 perf: 支持自定义短信认证 2023-05-25 14:13:48 +08:00
fit2bot
5e7d474bb7 perf: RemoteAppHost 平台支持 winrm (#10542)
Co-authored-by: ibuler <ibuler@qq.com>
2023-05-25 13:57:02 +08:00
halo
b72f8a7241 perf: 优化账号收集,使用正则处理结果 2023-05-25 13:40:25 +08:00
老广
35e9c21ec5 Merge pull request #10547 from jumpserver/pr@dev@perf_json_filter
perf: 修改 filter_q
2023-05-25 12:30:13 +08:00
ibuler
dcd35310cd perf: 修改 filter_q 2023-05-25 11:42:39 +08:00
fit2bot
32a8e150da perf: 删除全部用户错误提示 (#10546)
Co-authored-by: feng <1304903146@qq.com>
2023-05-25 11:38:20 +08:00
Bai
cabdc3ad42 fix: 修复终端端点使用资产标签匹配机制时 500 的问题 2023-05-24 17:36:51 +08:00
fit2bot
653b996d84 perf: 账号推送支持设置推送账号的 home 目录 (#10541)
Co-authored-by: feng <1304903146@qq.com>
2023-05-24 17:35:14 +08:00
老广
2262b0ecb5 Merge pull request #10327 from jumpserver/pr@dev@json_m2m_field
pref: 自定义 ORM Field,使用 JSONField 完成
2023-05-24 15:27:47 +08:00
ibuler
eccbf46300 merge: with dev 2023-05-24 15:26:59 +08:00
Eric
440cd13fcc perf: 同一个协作会话链接,限制同一用户仅可使用一次 2023-05-24 14:40:01 +08:00
feng
20c1f4a293 perf: 改密过程原子性优化 2023-05-24 14:31:27 +08:00
Bai
feb42961ef feat: 资产列表搜索支持 comment 模糊搜索 2023-05-22 18:27:07 +08:00
jiangweidong
3eaed62186 验证账号可连接性(自定义ssh)使用的key值错误 (#10523) 2023-05-22 17:29:17 +08:00
jiangweidong
a3f472137f perf: 优化命令过滤规则操作日志显示问题 2023-05-22 15:07:55 +08:00
feng
d4bb501ef9 fix: 账号导入500 2023-05-22 14:13:55 +08:00
ibuler
c4b25fbdbd fix: 修复 applet 账号选择问题 2023-05-19 17:01:29 +08:00
ibuler
197364d42d perf: 暂存一下 2023-05-19 11:30:50 +08:00
ibuler
6eb9986c75 perf: 修改过期默认值 2023-05-19 10:58:04 +08:00
老广
e40d65871b Merge pull request #10501 from jingzhaoyang/dev
fix: when request access_token is post method, http body has no json …
2023-05-19 10:43:32 +08:00
老广
a236de1eff Merge pull request #10489 from O-Jiangweidong/pr@dev@fix_mfa_bypass
fix: 修复某待审核用户返回时,登录其他用户可绕开mfa的问题
2023-05-19 10:41:19 +08:00
ibuler
a261d69cd2 perf: 修改 m2m json field 2023-05-18 21:34:19 +08:00
景朝阳
efb31d6f37 fix: when request access_token is post method, http body has no json data 2023-05-18 20:40:41 +08:00
Jiangjie.Bai
4a56875bda Merge pull request #10500 from jumpserver/dev
v3.3.0
2023-05-18 19:37:10 +08:00
Eric
48fca8f0f3 perf: 修复 rdp option 参数设置 2023-05-18 19:36:30 +08:00
Jiangjie.Bai
2f5d094abb Merge pull request #10498 from jumpserver/dev
v3.3.0
2023-05-18 19:17:08 +08:00
Eric
31600ba66c perf: rdp 设置分辨率不生效问题 2023-05-18 19:13:57 +08:00
Eric
a17fa5a518 perf: remoteapp rdp文件参数禁用复用连接 2023-05-18 19:09:12 +08:00
Bai
59d964d57a perf: 优化组织管理员不能更新系统管理员 2023-05-18 19:03:51 +08:00
fit2bot
2981bfffb1 fix: 给 view 增加 export 属性 (#10495)
Co-authored-by: feng <1304903146@qq.com>
2023-05-18 18:33:22 +08:00
fit2bot
0596b74fa1 fix: 账号创建ssh key 校验 (#10494)
Co-authored-by: feng <1304903146@qq.com>
2023-05-18 18:00:58 +08:00
ibuler
ebaa8d2637 perf: 优化 json error 2023-05-18 17:31:40 +08:00
吴小白
b368b6aef4 perf: 优化发布机部署脚本 2023-05-18 16:31:55 +08:00
fit2bot
44967b1af1 fix: 平台局部更新会自动关闭其他属性 (#10484)
Co-authored-by: feng <1304903146@qq.com>
2023-05-18 15:43:23 +08:00
fit2bot
6c19fd4192 fix: 修复 luna 类型树数量计算不准确bug (#10492)
Co-authored-by: feng <1304903146@qq.com>
2023-05-18 15:42:30 +08:00
jiangweidong
bb27be0924 fix: 修复某待审核用户返回时,登录其他用户可绕开mfa的问题 2023-05-18 14:45:17 +08:00
ibuler
4e5ab5a605 perf: 修改过滤的 q 2023-05-18 13:14:32 +08:00
fit2bot
b0b14fe2e1 fix: openid 三方登录限制bug (#10480)
Co-authored-by: feng <1304903146@qq.com>
2023-05-17 19:05:28 +08:00
Aaron3S
36aa0d301b perf: 优化 ops 用户提示 2023-05-17 18:37:54 +08:00
Aaron3S
3fa80351e0 fix: 修复作业中心提示用户名排序每次不一样的问题 2023-05-17 18:37:54 +08:00
fit2bot
1fef273669 fix: 修复工单日期不能为null settings 文件没有权限bug (#10479)
Co-authored-by: feng <1304903146@qq.com>
2023-05-17 17:29:34 +08:00
Bai
04e95d378c perf: 优化账号列表-添加账号切换自用户字段必填的问题 2023-05-17 14:11:21 +08:00
fit2bot
9058a79c5c fix: 修复三方用户登录登录限制提示错误问题 (#10475)
Co-authored-by: feng <1304903146@qq.com>
2023-05-17 11:11:39 +08:00
fit2bot
a7fed21819 perf: 翻译 (#10472)
Co-authored-by: feng <1304903146@qq.com>
2023-05-16 18:35:48 +08:00
jiangweidong
cfc91047fd perf: 自动化任务执行错误日志在DEBUG_DEV下打印 2023-05-16 18:15:55 +08:00
fit2bot
4ce2d991dd perf: 收集mysql账号username 优化 (#10470)
Co-authored-by: feng <1304903146@qq.com>
2023-05-16 18:15:42 +08:00
Bai
449e7ce454 fix: 修复删除组织时组织根节点未被删除的问题 2023-05-16 16:37:47 +08:00
fit2bot
9cc9600a4c fix: 批量添加账号su_from 错乱 (#10463)
Co-authored-by: feng <1304903146@qq.com>
2023-05-16 15:44:02 +08:00
Bai
f7e0f533e0 perf: 优化安全设置登录限制帮助文案信息 2023-05-16 15:25:57 +08:00
fit2bot
c7c3f711bf perf: 优化发布机不显示task信息问题 (#10450)
* perf: 优化发布机不显示task信息问题

* perf: 添加celery task execution api的task_name字段

---------

Co-authored-by: “huailei000” <2280131253@qq.com>
Co-authored-by: feng <1304903146@qq.com>
2023-05-16 14:48:00 +08:00
fit2bot
ec10ee3298 fix: 模版批量添加提示异常(core 代码bug) (#10455)
Co-authored-by: feng <1304903146@qq.com>
2023-05-15 18:58:06 +08:00
fit2bot
155c241ef7 fix: 修复账号模版更新时 添加密码密钥500 (#10454)
Co-authored-by: feng <1304903146@qq.com>
2023-05-15 18:47:39 +08:00
Bai
341dd6adfb perf: 修改 ansible-core 源 gitee -> github 2023-05-15 15:16:37 +08:00
吴小白
89b75835a6 perf: 优化一些问题 2023-05-15 13:43:44 +08:00
吴小白
ee2172ca82 Merge pull request #10449 from jumpserver/pr@dev@perf_grpcio
perf: 升级依赖 grpcio==1.54.2
2023-05-15 11:30:38 +08:00
Bai
98802e21a0 perf: 升级依赖 grpcio==1.54.2 2023-05-15 11:23:36 +08:00
ibuler
7c850a8a1e perf: 修改 json field query 2023-05-12 19:16:55 +08:00
feng
5b4979bdb1 perf: 修改仅允许已存在用户登录 判断的函数名 2023-05-12 18:13:11 +08:00
fit2bot
6afcf7bf42 perf: 第三方用户认证错误信息提示(尤其是第三方认证跳转的情况) (#10446)
Co-authored-by: feng <1304903146@qq.com>
2023-05-12 17:22:18 +08:00
jiangweidong
afb49f4040 fix: oracle Ping 失败 2023-05-12 15:41:03 +08:00
老广
4e20cf6036 Merge pull request #10443 from maninhill/patch-9
Update README.md
2023-05-12 14:43:23 +08:00
maninhill
9ecde3024a Update README.md 2023-05-12 14:42:07 +08:00
老广
daf6dbaf73 Merge pull request #10442 from maninhill/patch-8
chore: 更新 README
2023-05-12 14:36:57 +08:00
maninhill
7edb024abe chore: 更新 README 2023-05-12 14:35:45 +08:00
huailei
1c7634b394 Merge pull request #10432 from jumpserver/pr@dev@perf_task_log
perf: 优化task执行数据显示
2023-05-11 17:22:52 +08:00
“huailei000”
ff4f01fb56 perf: 优化task执行数据显示 2023-05-11 17:19:21 +08:00
老广
fd5f57d9b7 Merge pull request #10425 from jumpserver/pr@dev@perf_dbasset
perf: 平台协议支持更改 public 字段
2023-05-11 10:50:33 +08:00
fit2bot
f06059837d perf: 授权类型树 (#10390)
Co-authored-by: feng <1304903146@qq.com>
2023-05-11 10:15:40 +08:00
Bai
b98aa377b6 perf: 数据库资产 默认数据库 是必填项 2023-05-10 16:47:03 +08:00
Bai
42abad75d9 perf: 平台协议支持更改 public 字段 2023-05-10 16:46:10 +08:00
Aaron3S
ebb0e796ce feat: 作业中心根据当前选择的资产提示用户名 2023-05-10 15:41:17 +08:00
Bai
24fd87f7bc perf: 平台协议API返回public字段 2023-05-10 15:36:18 +08:00
“huailei000”
90cc2a2519 perf: 展示执行详情数据 2023-05-10 15:24:40 +08:00
feng
9802aec881 perf: 自动化执行详情数据 2023-05-10 15:24:40 +08:00
ibuler
737032418a perf: 优化写法 2023-05-10 11:10:21 +08:00
ibuler
2aa03d5b79 perf: connect token 允许复用 2023-05-10 11:10:21 +08:00
老广
926550bf26 Merge pull request #10416 from jumpserver/pr@dev@fix_categorytree1
fix: 修复资产类型树循环显示的问题
2023-05-10 11:07:39 +08:00
ibuler
240f700b92 perf: 修改账号生成 2023-05-10 11:04:33 +08:00
ibuler
4000986d1d perf: 优化选择账号 2023-05-10 11:04:33 +08:00
ibuler
0e98990e17 perf: 远程应用调度优先调度的上个主机,使用上个账号,并支持同名账号 2023-05-10 11:04:33 +08:00
Bai
8309f00e5e fix: 修复资产类型树循环显示的问题 2023-05-10 02:53:19 +00:00
老广
ad96fd2a96 Merge pull request #10412 from jumpserver/dependabot/pip/requirements/django-3.2.19
chore(deps): bump django from 3.2.17 to 3.2.19 in /requirements
2023-05-10 09:55:16 +08:00
dependabot[bot]
e6bbaac7de chore(deps): bump django from 3.2.17 to 3.2.19 in /requirements
Bumps [django](https://github.com/django/django) from 3.2.17 to 3.2.19.
- [Commits](https://github.com/django/django/compare/3.2.17...3.2.19)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-09 22:15:13 +00:00
Bai
f0cc64c74e perf: 优化账号用户名字段提示信息(null 的情况) 2023-05-09 18:41:28 +08:00
Chenyang Shen
65ca953f5b Merge pull request #10409 from jumpserver/pr@dev@perf_job_permission
perf: 优化 job permission
2023-05-09 17:25:36 +08:00
ibuler
873c019b58 perf: 修改 job list 2023-05-09 17:23:21 +08:00
ibuler
b5599fd3a6 perf: 优化 job permission 2023-05-09 17:18:52 +08:00
fit2bot
1933e82587 feat: 账号模版切换至 (#10396)
Co-authored-by: feng <1304903146@qq.com>
2023-05-09 15:29:02 +08:00
fit2bot
6b6900cfd4 perf: 导出account 列表需对文件进行加密 (#10366)
Co-authored-by: feng <1304903146@qq.com>
2023-05-08 17:02:55 +08:00
jiangweidong
185f33c3e0 perf: 企业微信、钉钉、飞书本地没有用户即创建 2023-05-08 16:58:39 +08:00
jiangweidong
3f1858a105 将配置改到类属性中 2023-05-08 16:58:39 +08:00
jiangweidong
1fef9a2cf0 perf: 去掉不用的导包 2023-05-08 16:58:39 +08:00
jiangweidong
38a9b90a8b fix: flash_message 带上返回值 2023-05-08 16:58:39 +08:00
jiangweidong
b376491020 perf: 优化user_type默认值 2023-05-08 16:58:39 +08:00
jiangweidong
3367f65b02 perf: 优化逻辑,抽离callback_base类 2023-05-08 16:58:39 +08:00
jiangweidong
7a97496f70 perf: 变量名还原 2023-05-08 16:58:39 +08:00
jiangweidong
bda748d547 feat: 支持钉钉、飞书、企业微信扫码登录无用户时自动创建用户 2023-05-08 16:58:39 +08:00
feng
7ff22cbc34 fix: /prometheus/metrics/ api 500 2023-05-08 14:47:56 +08:00
ibuler
1ec4cbdf38 perf: 优化 m2m json field 2023-05-08 14:09:44 +08:00
Eric_Lee
ccd6b8c48a Merge pull request #10394 from jumpserver/pr@dev@perf_replay_mp4
perf: 支持 mp4 录像文件上传和新增 video worker 类型
2023-05-07 09:06:18 +08:00
ibuler
a112d3c99d perf: 修改 accounts 字段 2023-05-06 19:52:03 +08:00
Eric
ee7f1f8f5e perf: 支持 mp4 录像文件上传和新增 video worker 类型 2023-05-06 14:01:25 +08:00
Bai
127f6730f6 perf: 优化迁移后的 Redis 数据库平台从 Redis6+ 修改为 Redis6 2023-05-04 17:31:45 +08:00
Bai
22b56d73b6 fix: 修复迁移应用时(组织下只有根节点,同步后的应用资产没有设置节点的问题) 2023-05-04 16:39:24 +08:00
Bai
9934456af4 fix: 修复迁移redis资产账号丢失的问题(系统用户用户名为空字符串) 2023-05-04 15:44:31 +08:00
Bai
3585ca2d49 perf: 优化文案: 清除离线会话 2023-05-04 10:33:16 +08:00
fit2bot
f842546042 perf: 平台导出过滤掉automation (#10367)
Co-authored-by: feng <1304903146@qq.com>
2023-04-28 17:13:43 +08:00
ibuler
5a6e13721d perf: 优化 json m2m field 2023-04-27 18:05:16 +08:00
Eric
a0151b8d44 fix: 修复旧 ssh 私钥,解析失败的问题 2023-04-27 17:50:16 +08:00
老广
62e5389f80 Update README.md 2023-04-27 17:49:07 +08:00
老广
a1d24f030e Merge pull request #10360 from maninhill/patch-7
chore(docs):更新 README
2023-04-27 17:42:59 +08:00
maninhill
78ddb75b7a chore(docs):更新 README 2023-04-27 17:38:26 +08:00
ibuler
90090a7fc7 perf: 添加 JSONManyToManyFieldSerializer 2023-04-27 14:13:40 +08:00
fit2bot
ea1c94c6db perf: 用户组织按照name 进行排序 (#10354)
Co-authored-by: feng <1304903146@qq.com>
2023-04-27 11:38:33 +08:00
ibuler
338ab5c634 perf: 优化 acl 2023-04-26 19:11:53 +08:00
fit2bot
58d055f114 perf: 改密 推送 可以对自己操作 同时设置su_enabled 可提权 (#10349)
Co-authored-by: feng <1304903146@qq.com>
2023-04-26 18:50:30 +08:00
Bai
9eec2909ed fix: 修改'账号备份列表-执行次数'未翻译为英文的问题 2023-04-26 17:11:28 +08:00
ibuler
632627db11 perf: 去掉 debug model 2023-04-25 16:25:00 +08:00
fit2bot
a19586f8b8 perf: perm user asset add labels (#10339)
Co-authored-by: feng <1304903146@qq.com>
2023-04-25 14:48:09 +08:00
fit2bot
8fe5ab42e8 perf: 用户工作台资产显示更多字段 (#10338)
Co-authored-by: feng <1304903146@qq.com>
2023-04-25 14:36:01 +08:00
ibuler
f51af9736b perf: rdp 支持 console 模式 2023-04-25 14:35:07 +08:00
ibuler
20b7b794d8 perf: 修改 m2m field 2023-04-25 14:00:19 +08:00
fit2bot
2a196743f5 perf: 组织更新刷新缓存 (#10333)
Co-authored-by: feng <1304903146@qq.com>
2023-04-25 11:27:58 +08:00
fit2bot
917620736b feat: 修改模版账号密码 同步更新关联的账号 (#10328)
* feat: 修改模版账号密码 同步更新关联的账号

* feat: 同步多个账号

---------

Co-authored-by: feng <1304903146@qq.com>
2023-04-25 10:28:19 +08:00
ibuler
19d29d6637 perf: remove debug msg 2023-04-24 19:04:47 +08:00
ibuler
c824ae4478 perf: 修改 manager 2023-04-24 19:03:44 +08:00
ibuler
3cdb81cf4a perf: 搞定自定义 orm field 2023-04-24 19:00:31 +08:00
ibuler
378eee0402 pref: stash 2 2023-04-24 16:27:13 +08:00
Bai
9d2ae7d1ed fix: 修改 utils/disable_user_mfa.sh otp_level => mfa_level 2023-04-23 16:45:40 +08:00
ibuler
c991a73632 v1 2023-04-23 16:15:27 +08:00
feng
149ca1afce perf: 开源 acl去除 review 2023-04-21 18:41:47 +08:00
fit2bot
a1f65bccc5 feat: 只有系统管理员才能更新或删除系统管理员 (#10306)
Co-authored-by: feng <1304903146@qq.com>
2023-04-21 17:31:39 +08:00
ibuler
a105748a55 perf: 账号模版 protocols 过滤 2023-04-21 17:11:18 +08:00
fit2bot
f1ee454254 perf: user groups filter (#10300)
Co-authored-by: feng <1304903146@qq.com>
2023-04-21 15:35:56 +08:00
ibuler
a6ab886968 perf: 优化自定义类型的冲突 2023-04-21 15:21:11 +08:00
feng
f85daa088f perf: 创建资产 nodes 可为空 默认 default 2023-04-21 14:58:11 +08:00
fit2bot
ede53d3b6b perf: ssh key strategy translate (#10295)
Co-authored-by: feng <1304903146@qq.com>
2023-04-21 14:08:59 +08:00
ibuler
eb9ac213d5 perf: 去掉 debug msg 2023-04-21 11:32:49 +08:00
ibuler
06052b85a2 perf: 优化支持 自定义 applet
perf: 优化平台
2023-04-21 11:31:10 +08:00
老广
01827c7b3a Merge pull request #10292 from jumpserver/pr@dev@fix_util
fix: util add jobauditlog
2023-04-21 11:28:46 +08:00
Bai
14e572813f fix: util add jobauditlog 2023-04-21 11:20:51 +08:00
Jiangjie.Bai
f2e7845d4b Merge pull request #10286 from jumpserver/dev
v3.2.0
2023-04-20 18:33:59 +08:00
fit2bot
d75b7c014e perf: 更新模版暂不同步修改账号 (#10285)
Co-authored-by: feng <1304903146@qq.com>
2023-04-20 18:29:31 +08:00
Jiangjie.Bai
b44e6c258f Merge pull request #10284 from jumpserver/dev
v3.2.0
2023-04-20 18:23:12 +08:00
Bai
2ae951e6e6 fix: 修改翻译 2023-04-20 17:53:42 +08:00
fit2bot
10b033ee97 perf: 批量更新资产消息 (#10280)
Co-authored-by: feng <1304903146@qq.com>
2023-04-20 16:22:02 +08:00
ibuler
177d634d85 fix: 修复登录 acl 显示不对 2023-04-20 15:48:56 +08:00
feng
ee122690ff perf: asset date_updated 2023-04-20 15:48:34 +08:00
ibuler
dac708f952 perf: 优化 api doc 报错 2023-04-20 15:47:50 +08:00
老广
75724cbddb Merge pull request #10272 from jumpserver/pr@dev@perf_asset_task_i18n
perf: 优化资产任务的 i18n
2023-04-20 14:45:24 +08:00
老广
4b5d9d3a76 Merge pull request #10273 from jumpserver/pr@dev@account_auto_i18n
perf: account auto i18n
2023-04-20 14:44:54 +08:00
fit2bot
0de6c41406 perf: update templat account (#10274)
Co-authored-by: feng <1304903146@qq.com>
2023-04-20 14:43:40 +08:00
ibuler
b52f18aea6 perf: 修改 i18n 2023-04-20 14:39:31 +08:00
ibuler
be58539df8 perf: 修改支持 i18n 2023-04-20 14:19:13 +08:00
feng
f030638ba4 perf: account auto i18n 2023-04-20 14:10:39 +08:00
ibuler
f496f7d635 perf: 优化资产任务的 i18n 2023-04-20 13:51:41 +08:00
老广
7887548174 Merge pull request #10269 from jumpserver/pr@dev@fix_loong64_build
fix: 修复 loong64 构建失败
2023-04-20 13:22:00 +08:00
老广
8e61dc8e02 Merge pull request #10267 from jumpserver/pr@dev@perf_yaml_support_i18n
perf: yaml 文件支持 i18n
2023-04-20 13:21:22 +08:00
吴小白
651c53a92c fix: 修复 loong64 构建失败 2023-04-20 11:38:50 +08:00
fit2bot
c9ee46c0fb perf: windows 账号可连接性 ansible 刷新 (#10268)
Co-authored-by: feng <1304903146@qq.com>
2023-04-20 11:32:33 +08:00
ibuler
f2d34de161 perf: 修改格式 2023-04-20 11:27:10 +08:00
fit2bot
dc5f7a5c05 fix: 资产 克隆有切换至的账号400 (#10266)
Co-authored-by: feng <1304903146@qq.com>
2023-04-20 11:14:23 +08:00
ibuler
6b3665e8d0 perf: yaml 文件支持 i18n 2023-04-20 11:13:28 +08:00
fit2bot
11ad6ab273 fix: 修复作业中心未开启的acl生效的问题 (#10265)
* fix: 修复作业中心未开启的acl生效的问题

* perf: 优化代码风格

---------

Co-authored-by: Aaron3S <chenyang@fit2cloud.com>
2023-04-20 10:33:53 +08:00
jiangweidong
2ba32f6971 perf: 优化自定义改密时需要在命令中包含ssh登录用户的密码问题 2023-04-20 09:52:13 +08:00
Bai
96eb87f935 feat: 服务启动时校验 migrations 文件是否有冲突(DEBUG_DEV) 2023-04-19 14:14:37 +08:00
fit2bot
3afab38c5f perf: 资产平台排序 (#10258)
Co-authored-by: feng <1304903146@qq.com>
2023-04-19 13:21:57 +08:00
fit2bot
9dedce6264 perf: 翻译 (#10257)
Co-authored-by: feng <1304903146@qq.com>
2023-04-19 13:02:24 +08:00
ibuler
4849b2627a perf: 优化一下迁移 2023-04-19 11:13:29 +08:00
ibuler
12adf66f41 perf: 优化账号历史过滤 2023-04-19 11:13:29 +08:00
fit2bot
fc4a77df1a fix: 账号导入500 (#10255)
Co-authored-by: feng <1304903146@qq.com>
2023-04-19 10:57:38 +08:00
fit2bot
3bc8eda66a perf: 更新模版关联更新账号 (#10250)
Co-authored-by: feng <1304903146@qq.com>
2023-04-19 10:18:13 +08:00
Bai
d402780d00 feat: 服务启动时校验 migrations 文件是否有冲突(DEBUG_DEV) 2023-04-18 20:23:56 +08:00
fit2bot
28f08251b3 perf: 修复创建资产时,account 的校验 (#10247)
* perf: 修复创建资产时,account 的校验

* perf: 优化一下提示

---------

Co-authored-by: ibuler <ibuler@qq.com>
2023-04-18 20:10:51 +08:00
Aaron3S
ca898ed7b5 perf: 优化代码 2023-04-18 19:54:14 +08:00
Aaron3S
50421a1f89 fix: 修复作业中心选择收藏资产取不到资产的问题 2023-04-18 19:54:14 +08:00
ibuler
a83d1c7c46 perf: 优化 applet host platform 2023-04-18 19:13:04 +08:00
ibuler
389f94d672 perf: 修改 assets serializer 支持 accounts template 2023-04-18 19:12:26 +08:00
fit2bot
f47d0b1a40 perf: 工单发消息失败 (#10242)
Co-authored-by: feng <1304903146@qq.com>
2023-04-18 18:56:17 +08:00
fit2bot
a28239f313 fix: 登录复核刷新后404 (#10240)
Co-authored-by: feng <1304903146@qq.com>
2023-04-18 18:07:54 +08:00
老广
996690fc02 Merge pull request #10235 from jumpserver/pr@dev@perf_asset_set_default_nodes
perf: custom fields 仅custom 类型资产支持
2023-04-18 17:18:53 +08:00
ibuler
8b98bbddaa perf: custom fields 仅custom 类型资产支持 2023-04-18 17:07:01 +08:00
fit2bot
cf197f7efc perf: 创建资产通过账号模版创建账号 (#10234)
Co-authored-by: feng <1304903146@qq.com>
2023-04-18 17:03:49 +08:00
ibuler
5921b2ee8f perf: 修改默认节点 2023-04-18 16:29:41 +08:00
老广
52891bfca3 Merge pull request #10232 from jumpserver/pr@dev@perf_platform_internal_create
perf: 修改 platforms
2023-04-18 16:06:36 +08:00
fit2bot
0856b0cbbe fix: k8s 无密码账号登录 (#10233)
Co-authored-by: feng <1304903146@qq.com>
2023-04-18 15:31:47 +08:00
ibuler
b30e9aedce perf: 优化内置平台创建 2023-04-18 15:06:22 +08:00
ibuler
bacda8248b perf: 修改内置 platform 创建 2023-04-18 14:25:35 +08:00
ibuler
ce38b2263c perf: 修改 platforms 2023-04-18 14:02:24 +08:00
fit2bot
810aff9597 perf: k8s 支持网关 (#10229)
Co-authored-by: feng <1304903146@qq.com>
2023-04-18 11:32:59 +08:00
jiangweidong
cad88560bb perf: 修改OAuth2的access_token前缀格式 2023-04-18 10:29:29 +08:00
ibuler
faff0cd20a perf: 优化创建内置 platform 2023-04-17 18:54:55 +08:00
fit2bot
5a34372ca5 perf: 批量创建账号 没解密 (#10226)
Co-authored-by: feng <1304903146@qq.com>
2023-04-17 17:46:10 +08:00
fit2bot
cff4309b03 fix: export assets (#10224)
Co-authored-by: feng <1304903146@qq.com>
2023-04-17 15:42:46 +08:00
ibuler
024d344f7e perf: 去掉 _autmoation_id 2023-04-17 15:41:35 +08:00
ibuler
20e7efcd70 perf: 优化 platform automation 结构 2023-04-17 15:41:35 +08:00
fit2bot
2b00e6e3a1 fix: 修复资产列表 mini 时报错 (#10220)
Co-authored-by: ibuler <ibuler@qq.com>
2023-04-17 15:10:34 +08:00
fit2bot
b3b7575b0c fix: 批量更新资产账号 错误 secret (#10221)
Co-authored-by: feng <1304903146@qq.com>
2023-04-17 15:07:34 +08:00
Jiangjie.Bai
9109a5e6a2 Merge pull request #10213 from jumpserver/dev
v3.2.0 rc2
2023-04-14 18:33:00 +08:00
jiangweidong
690e01cb78 feat: 支持部分资源的自定义自动化任务(Ping/VerifyAccount/ChangeSecret) (#9947)
* feat: 支持部分资源的自定义自动化任务(Ping/VerifyAccount/ChangeSecret)

* perf: 去掉无用的属性

* perf: 优化自定义改密逻辑

* feat: 支持ssh_key认证

* perf: 去掉无用注释

* perf: 优化

* perf: 优化逻辑

* perf: 优化标题

* perf: 去掉一些无用的函数

* perf: 优化helptext
2023-04-14 18:31:09 +08:00
fit2bot
f07e4e53ec perf: 推送成功后 设置账号可连接性 (#10211)
Co-authored-by: feng <1304903146@qq.com>
2023-04-14 17:53:21 +08:00
fit2bot
b1374c6aba fix: 更新平台 ansible_enabled 未设置 (#10210)
Co-authored-by: feng <1304903146@qq.com>
2023-04-14 17:10:33 +08:00
fit2bot
e0f077b054 fix: k8s api 500 (#10209)
Co-authored-by: feng <1304903146@qq.com>
2023-04-14 16:57:08 +08:00
feng
31653cab11 perf: 单独推送账号 2023-04-14 16:22:54 +08:00
feng
976daaa726 fix: 修复AllTypes to_tree_nodes 方法 2023-04-14 15:39:37 +08:00
feng
b359b1059c fix: 修复所有ansible任务执行失败问题 2023-04-14 14:25:01 +08:00
ibuler
490611c560 perf: 修改 applet 2023-04-14 11:30:04 +08:00
Jiangjie.Bai
8a3a9c87a8 Merge pull request #10201 from jumpserver/dev
v3.2.0 rc1
2023-04-13 21:29:05 +08:00
feng
00fd546776 fix: 修复迁移文件冲突bug 2023-04-13 21:28:12 +08:00
Jiangjie.Bai
68351b1c39 Merge pull request #10196 from jumpserver/dev
v3.2.0 rc1
2023-04-13 19:21:05 +08:00
Bai
21da805e78 fix: fix conflicts 2023-04-13 19:20:18 +08:00
fit2bot
928513edd0 fix: fix conflicts (#10197)
* perf: domain gateway 也添加

* fix: 不支持es8 提示

* perf: 授权过期通知

* fix: 过滤系统用户密码过滤ansible不支持的字符

* perf: 优化 apt (#8398)

* pref: 修改 oracle lib path

* perf: 优化 apt

Co-authored-by: ibuler <ibuler@qq.com>

* fix: 修复授权过期通知bug (#8404)

Co-authored-by: feng626 <1304903146@qq.com>

* fix: 修改推送系统用户提示文案

* feat: add client linux arm64 version

* perf: 优化签名认证

* pref: 优化没有获取到节点的问题

* fix: 修复openid用户登录时默认邮件后缀使用配置项

* fix: 修复华为短信配置错误,前端提示不对的问题

* fix: 修复账号备份失败问题 (#8852)

Co-authored-by: feng626 <1304903146@qq.com>

* perf: 优化加密,没有rsa则不加密

* feat: 支持对开启SSL/TLS的MongoDb数据库改密

* perf: 工单新增相关过滤

* fix: 修复配置mfa失效日期 失效问题 (#8856)

Co-authored-by: feng626 <1304903146@qq.com>

* fix: 修复日志记录到syslog时中文编码问题

* workflow: 修改 Gitee 同步的目的仓库

* fix: 修复导出账号历史翻译信息

---------

Co-authored-by: Jiangjie.Bai <32935519+BaiJiangJie@users.noreply.github.com>
Co-authored-by: 老广 <ibuler@qq.com>
Co-authored-by: feng626 <1304903146@qq.com>
Co-authored-by: Jiangjie.Bai <bugatti_it@163.com>
Co-authored-by: jiangweidong <weidong.jiang@fit2cloud.com>
Co-authored-by: Bai <baijiangjie@gmail.com>
Co-authored-by: BugKing <wangzhen@fit2cloud.com>
2023-04-13 19:16:46 +08:00
fit2bot
1eb8e40d3e feat: 账号推送附加参数 (#10080)
* feat: 账号推送附加参数

* perf: 通过节点 资产 过滤平台api

* perf: push automation params

* perf: 修改playbook

* perf: params serializer

* perf: 账号推送playbook 调整

* perf: Automation serializer add params field

* perf: params 非必填

* perf: 添加is_params 给前端判断

* perf: is_params bool

* perf: 修改push account ansible逻辑

* perf: 修改获取push_kwargs方法

* perf: platform migrate

* perf: 修改api

* perf: 单个推送

* perf: push account

* perf: 修改asset auto_config

---------

Co-authored-by: feng <1304903146@qq.com>
Co-authored-by: feng626 <57284900+feng626@users.noreply.github.com>
2023-04-13 19:02:04 +08:00
jiangweidong
8e81aee1fd perf: luna连接时不显示 WinRM 协议选项 2023-04-13 18:29:21 +08:00
jiangweidong
e12b832992 perf: 关闭SFTP后,luna界面不显示相应选项 (#10186)
* perf: 关闭SFTP后,luna界面不显示相应选项

* perf: 修改默认值

* perf: 增加资产协议冗余字段,减少关联查询

* perf: 修改

* perf: 优化

* perf: 精简

* perf: 删掉空格

* perf: 修改继承类
2023-04-13 17:26:24 +08:00
fit2bot
1aadb760f4 perf: 优化命令长度限制到8m (#10193)
Co-authored-by: Aaron3S <chenyang@fit2cloud.com>
2023-04-13 15:47:16 +08:00
fit2bot
4654756966 fix: 修复账号克隆 500 (#10192)
Co-authored-by: feng <1304903146@qq.com>
2023-04-13 14:20:07 +08:00
Bai
4c7c8f482d fix: 修复执行批量命令时报错的问题 TypeError:set obiect is not subscriptable 2023-04-12 18:30:34 +08:00
fit2bot
30b89e5cc9 perf: 账号模版更新 (#10184)
Co-authored-by: feng <1304903146@qq.com>
2023-04-12 17:59:13 +08:00
老广
b0365838fb Merge pull request #10183 from O-Jiangweidong/pr@dev@perf_connect_gateway_no_gateway
perf: 当连接资产为网关时,connection_token不返回网域网关信息
2023-04-12 13:07:29 +08:00
jiangweidong
a59f1895a3 perf: 当连接资产为网关时,connection_token不返回网域网关信息 2023-04-12 11:43:06 +08:00
ibuler
59b27822be perf: 添加迁移文件 2023-04-11 19:32:29 +08:00
ibuler
36813f64db perf: 修改 device platform 支持 su 2023-04-11 19:32:29 +08:00
jiangweidong
111296ecd2 fix: 手机号码校验逻辑问题 2023-04-10 18:00:39 +08:00
jiangweidong
b7badc146a fix 2023-04-10 17:36:26 +08:00
jiangweidong
8ff1bae7e6 fix: 手机号可以为空及验证逻辑修改 2023-04-10 17:36:26 +08:00
Eric
b58488a7e9 perf: connection token api 兼容处理 2023-04-10 16:43:31 +08:00
老广
1f63a9675f Merge pull request #10169 from jumpserver/pr@dev@fix_migrate_error
perf: 优化 custom info
2023-04-10 15:19:38 +08:00
ibuler
907fcd7555 perf: 优化 custom info 2023-04-10 15:18:27 +08:00
Bai
616e636837 fix: 修复手机号字段问题 2023-04-10 14:36:22 +08:00
ibuler
34e846927b perf: 优化 connect token asset info 2023-04-10 13:47:38 +08:00
fit2bot
1248458451 perf: 优化支持 choices (#10151)
* perf: 支持自定义类型资产

* perf: 改名前

* perf: 优化支持 choices

* perf: 优化自定义资产

* perf: 优化资产的详情

* perf: 修改完成自定义平台和资产

---------

Co-authored-by: ibuler <ibuler@qq.com>
Co-authored-by: Jiangjie.Bai <bugatti_it@163.com>
2023-04-10 10:57:44 +08:00
wulabing
cec176cc33 fix notifications.py
fix ops.tasks.check_server_performance_period AttributeError: type object 'Status' has no attribute 'get_terminal_latest_stat'
2023-04-10 10:35:16 +08:00
jiangweidong
7833433d5f feat: 手机号支持选择区号 2023-04-10 10:33:31 +08:00
halo
ec2c8538d9 fix: 首次登录强制开启MFA页面bug 2023-04-07 10:19:49 +08:00
fit2bot
e34fbce082 perf: patch account 400 (#10153)
Co-authored-by: feng <1304903146@qq.com>
2023-04-06 19:53:01 +08:00
fit2bot
fb1978a40b fix: terminal status (#10142)
Co-authored-by: feng <1304903146@qq.com>
2023-04-06 10:31:41 +08:00
fit2bot
47d0882090 perf: 用户添加密码 设置是否已存在 (#10138)
Co-authored-by: feng <1304903146@qq.com>
2023-04-04 18:02:58 +08:00
fit2bot
7c1e92c787 fix: 更新账号 跳过name检查 (#10136)
Co-authored-by: feng <1304903146@qq.com>
2023-04-04 16:04:44 +08:00
老广
9af2974bad Merge pull request #10104 from O-Jiangweidong/pr@dev@feat_windows_winrm
feat: Windows类型资产增加winrm协议
2023-04-04 14:08:34 +08:00
Eric_Lee
ba5ca3532b Merge pull request #10133 from jumpserver/pr@dev@fix_deploy_applet
fix: 修正 applet 部署失败
2023-04-04 12:43:49 +08:00
吴小白
211963a098 fix: 修正 applet 部署失败 2023-04-04 12:32:54 +08:00
jiangweidong
187c1e3804 perf: 优化winrm协议网域连接支持ssh_key 2023-04-04 11:55:07 +08:00
Bai
55774dae02 fix: 修复Luna页面用户授权树搜索问题(同步加载方式) 2023-04-04 11:53:01 +08:00
Bai
00ec9b6d5a fix: 修复Luna页面用户授权树默认展开所有节点的问题(同步加载方式) 2023-04-04 11:31:38 +08:00
老广
98a2d9ffdb Merge pull request #10127 from jumpserver/pr@dev@fix_systemuser_without_username_migrate_error
fix: 优化系统用户迁移
2023-04-04 11:16:55 +08:00
ibuler
2b8d0a64fb fix: 优化系统用户迁移 2023-04-04 10:31:57 +08:00
fit2bot
3c07667689 perf: 修改 account migrate (#10125)
Co-authored-by: feng <1304903146@qq.com>
2023-04-03 18:53:37 +08:00
Eric
9686c66874 perf: 会话分享记录字段翻译 2023-04-03 18:37:01 +08:00
fit2bot
c5340b5adc perf: 修改 account (#10088)
* perf: 优化账号创建策略

* perf: 修改账号

* perf: 修改 account

* perf: 修改 account

* perf: 修改批量创建

* perf: 修改账号批量创建

* perf: 继续优化账号批量添加

* perf: 优化创建 accounts 的结果

* perf: 优化账号批量返回的格式

* perf: 优化账号

---------

Co-authored-by: ibuler <ibuler@qq.com>
2023-04-03 18:18:31 +08:00
fit2bot
4601bb9e58 perf: 优化mac客户端名字 (#10122)
Co-authored-by: feng <1304903146@qq.com>
2023-04-03 17:50:52 +08:00
老广
7d68148f7a Merge pull request #10110 from jumpserver/dependabot/pip/requirements/redis-4.5.4
build(deps): bump redis from 4.5.3 to 4.5.4 in /requirements
2023-04-03 17:13:46 +08:00
老广
e386e7f33a Merge pull request #10119 from jumpserver/pr@dev@fix_ldapuserimport
fix: 修复 LDAP 导入用户时指定其他组织,还会导入到 Default 组织的问题
2023-04-03 17:10:39 +08:00
Bai
34c9044d03 fix: 修复 LDAP 导入用户时指定其他组织,还会导入到 Default 组织的问题 2023-04-03 08:47:21 +00:00
fit2bot
90cbf653ac perf: 优化luna tree title (#10118)
Co-authored-by: feng <1304903146@qq.com>
2023-04-03 16:47:14 +08:00
Eric_Lee
1c93d7f0a3 Merge pull request #10107 from jumpserver/pr@dev@perf_dockerfile
perf: applet 使用 powershell 部署
2023-04-03 15:58:47 +08:00
Eric
d9ad5aee4a perf: 修改默认值和变量名 2023-04-03 15:39:15 +08:00
Eric
1fbaa85178 perf: 修改接口 2023-04-03 15:39:15 +08:00
Eric
789eb0cf36 feat: 协作分享增加读写控制 2023-04-03 15:39:15 +08:00
jiangweidong
cbe384161a perf: 优化一个函数名 2023-04-03 10:17:00 +08:00
jiangweidong
6aaa20ba17 Perf: 优化 2023-04-03 09:57:40 +08:00
dependabot[bot]
8b6a64d8ed build(deps): bump redis from 4.5.3 to 4.5.4 in /requirements
Bumps [redis](https://github.com/redis/redis-py) from 4.5.3 to 4.5.4.
- [Release notes](https://github.com/redis/redis-py/releases)
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES)
- [Commits](https://github.com/redis/redis-py/compare/v4.5.3...v4.5.4)

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-31 14:31:35 +00:00
jiangweidong
4c5e47cb99 perf: 普通用户工单申请时,选择指定账号,提示无权限 2023-03-30 16:26:12 +08:00
jiangweidong
cfe0206179 feat: winrm协议支持网域自动化 2023-03-30 14:58:20 +08:00
吴小白
caef6a5052 perf: applet 使用 powershell 部署 2023-03-30 12:09:03 +08:00
老广
0cd6667ede Merge pull request #10079 from jumpserver/pr@dev@perf_super_switch
perf: 支持 super 方式的切换用户
2023-03-30 10:24:43 +08:00
老广
d3cc8e5efb Merge pull request #10082 from jumpserver/dependabot/pip/requirements/redis-4.5.3
build(deps): bump redis from 4.3.3 to 4.5.3 in /requirements
2023-03-30 10:23:35 +08:00
jiangweidong
bc186df8d5 Merge branch 'dev' of https://github.com/jumpserver/jumpserver into pr@dev@feat_windows_winrm 2023-03-29 17:11:07 +08:00
jiangweidong
cab72c6991 feat: Windows类型资产增加winrm协议 2023-03-29 17:10:58 +08:00
Bai
8acfcda956 perf: issues 模版 2023-03-29 15:19:17 +08:00
Eric
344451ba55 perf: navicat 移到企业版 2023-03-29 14:56:20 +08:00
feng
678df5bf3e perf: 补回get_terminal_latest_stat 方法 2023-03-29 14:03:35 +08:00
老广
f214b47306 Merge pull request #10094 from jumpserver/pr@dev@perf_dockerfile
perf: 使用 docker.io 仓库
2023-03-29 10:06:42 +08:00
吴小白
5b017daba1 perf: 使用 docker.io 仓库 2023-03-29 10:03:14 +08:00
fit2bot
8d3319717e perf: 开启安全模式后过滤root administrator (#10089)
Co-authored-by: feng <1304903146@qq.com>
2023-03-28 16:26:40 +08:00
fit2bot
23b13db9e2 perf: category order (#10087)
Co-authored-by: feng <1304903146@qq.com>
2023-03-28 15:04:24 +08:00
Bai
3fa1b46312 fix: 修复授权规则Util类 2023-03-28 11:39:19 +08:00
Eric_Lee
1cad4a7add Merge pull request #10084 from jumpserver/pr@dev@fix_ssh_config
fix: 修正错误的 ssh 参数配置
2023-03-28 11:12:41 +08:00
吴小白
d04a0ff5d7 fix: 修正错误的 ssh 参数配置 2023-03-28 11:11:15 +08:00
dependabot[bot]
616e1ded20 build(deps): bump redis from 4.3.3 to 4.5.3 in /requirements
Bumps [redis](https://github.com/redis/redis-py) from 4.3.3 to 4.5.3.
- [Release notes](https://github.com/redis/redis-py/releases)
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES)
- [Commits](https://github.com/redis/redis-py/compare/v4.3.3...v4.5.3)

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 22:33:27 +00:00
jiangweidong
5b87470b5c perf: 优化账号活动日志界面的提示及操作日志的字段内容 2023-03-27 18:23:55 +08:00
Eric
118d33fa02 perf: 支持 super 方式的切换用户 2023-03-27 18:06:30 +08:00
Aaron3S
017682b383 perf: 增加我的资产通过 node_id 过滤我的资产 2023-03-27 14:53:39 +08:00
feng
1ac2fec13f feat: 收集账号 可选同步表 2023-03-27 14:13:44 +08:00
Bai
66d368f882 fix: 修改nodes_display required = False 2023-03-24 17:11:03 +08:00
Bai
30ab6836ab fix: 修改 login_button 2023-03-24 17:09:07 +08:00
fit2bot
55e1ef116b perf: clear secret (#10053)
Co-authored-by: feng <1304903146@qq.com>
2023-03-23 16:04:09 +08:00
Bai
5d022c7056 fix: 修复资产导入支持填写节点路径 2023-03-23 16:01:19 +08:00
fit2bot
f6c5c35a2c feat: 账号收集批量同步账号 (#10051)
Co-authored-by: feng <1304903146@qq.com>
2023-03-23 15:24:19 +08:00
老广
d3170e4815 Merge pull request #10050 from jumpserver/pr@dev@chore_readme
perf: 修改 readme
2023-03-23 14:34:42 +08:00
ibuler
3959f4615a perf: 修改 readme 2023-03-23 14:33:33 +08:00
ibuler
772ad7aff7 Merge branch 'dev' of github.com:jumpserver/jumpserver into dev 2023-03-23 14:18:21 +08:00
fit2bot
166d074adb perf: 修改 port (#10049)
Co-authored-by: ibuler <ibuler@qq.com>
2023-03-23 14:13:08 +08:00
ibuler
f12e6af86e perf: 修改 port 2023-03-23 14:11:26 +08:00
fit2bot
3b45ad0c61 feat: account remove secret (#10045)
Co-authored-by: feng <1304903146@qq.com>
2023-03-23 11:20:48 +08:00
老广
72b731629e Merge pull request #10043 from jumpserver/pr@dev@perf_ssh_negotiate
perf: 支持旧版本 SSH 服务端认证
2023-03-23 10:03:08 +08:00
吴小白
f9b83b11fb perf: 支持旧版本 SSH 服务端认证 2023-03-23 08:58:31 +08:00
老广
4b8fd64c5d Merge pull request #10041 from jumpserver/pr@dev@feat_k8s_support_gateway
feat: k8s 支持 gateway
2023-03-22 19:43:54 +08:00
ibuler
e3bd698baf feat: k8s 支持 gateway 2023-03-22 19:42:51 +08:00
fit2bot
0be3cb3c27 fix: account update (#10039)
Co-authored-by: feng <1304903146@qq.com>
2023-03-22 19:14:43 +08:00
fit2bot
f7ae23f7d9 perf: 导入资产账号模版api优化 (#10038)
Co-authored-by: feng <1304903146@qq.com>
Co-authored-by: feng626 <57284900+feng626@users.noreply.github.com>
2023-03-22 18:35:23 +08:00
老广
402c68edd0 Merge pull request #10036 from jumpserver/pr@dev@perf_device_add_sudo
perf: 优化一下
2023-03-22 17:21:27 +08:00
ibuler
4f703e2b31 merge: with dev 2023-03-22 17:20:56 +08:00
ibuler
1e0a6b5072 perf: 优化一下 2023-03-22 17:17:49 +08:00
ibuler
47c207ce13 perf: 硬件设备支持账号切换 2023-03-22 16:49:29 +08:00
ibuler
c6071740b1 perf: 硬件设备支持账号切换 2023-03-22 16:43:00 +08:00
老广
463d54a4d8 Merge pull request #10023 from jumpserver/pr@dev@asset_accounts_secret_type_default
perf: 设置资产账号的默认值,方便导入
2023-03-22 15:38:26 +08:00
老广
8289e4c2c8 Merge pull request #10032 from jumpserver/pr@dev@platform_set_protocols
perf: 修改 platform protocols
2023-03-22 15:38:01 +08:00
ibuler
aca0d62feb perf: 优化 protocols 2023-03-22 15:28:05 +08:00
ibuler
59d9572d07 perf: 优化 protocol 选择 2023-03-22 15:26:23 +08:00
ibuler
ba076f6612 perf: 优化提示 2023-03-22 14:56:20 +08:00
fit2bot
43d805d0ca perf: 配置CHANGE_AUTH_PLAN_SECURE_MODE_ENABLED 对改密的特权账号过滤 (#10033)
Co-authored-by: feng <1304903146@qq.com>
2023-03-22 14:48:05 +08:00
ibuler
180ded1773 perf: 修改 platform protocols 2023-03-22 14:15:25 +08:00
fit2bot
81b04c449a fix: tanslate (#10031)
Co-authored-by: feng <1304903146@qq.com>
2023-03-22 13:47:12 +08:00
fit2bot
ed4a4ceca1 perf: 批量创建账号 定义创建账号策略 忽略或抛出错误 (#10028)
Co-authored-by: feng <1304903146@qq.com>
2023-03-22 11:09:48 +08:00
老广
8e61b53460 Merge pull request #10016 from jumpserver/pr@dev@use_ghcr_registry
perf: 使用 ghcr.io 托管镜像
2023-03-21 14:17:31 +08:00
ibuler
cac59db1ec perf: 设置资产账号的默认值,方便导入 2023-03-21 12:43:54 +08:00
fit2bot
9413fd4cd1 perf: 支持 iframe 标签选择 (#9908)
* perf: 支持 iframe 标签选择

* perf: 完善 iframe 的选择语法

---------

Co-authored-by: Eric <xplzv@126.com>
2023-03-20 17:26:47 +08:00
jiangweidong
bac296f82e Merge pull request #10015 from O-Jiangweidong/pr@dev@perf_dbeaver_no_upgrade_no_download
perf: DBeaver连接时不检查更新、不提示创建实例数据库、不弹出下载驱动框
2023-03-20 16:01:37 +08:00
fit2bot
69cd7bce17 perf: 批量创建账号时,跳过unique检查 不去创建 (#9966)
Co-authored-by: feng <1304903146@qq.com>
2023-03-20 15:45:21 +08:00
吴小白
664ab0797a perf: 使用 ghcr.io 托管镜像 2023-03-20 14:22:33 +08:00
老广
4a55c55022 Merge pull request #10003 from jumpserver/pr@dev@perf_import_export
perf: 优化导入导出
2023-03-20 10:07:48 +08:00
ibuler
44b6fd8771 fix: 去掉 warning 2023-03-20 10:05:29 +08:00
jiangweidong
b6ccc53a71 perf: DBeaver连接时不检查更新、不提示创建实例数据库、不弹出下载驱动框 2023-03-20 10:02:50 +08:00
ibuler
209f0d72b4 perf: 去掉 warning 2023-03-20 10:01:42 +08:00
ibuler
eac4b41783 perf: 优化 warning 2023-03-20 09:59:34 +08:00
老广
7a35309e88 Merge pull request #10009 from WeiZhixiong/dev
fix: SyntaxWarning, apps/common/drf/parsers/base.py:114, "is" should be "=="
2023-03-20 09:51:40 +08:00
fit2bot
39e618c127 perf: 资产批量更新平台 (#10013)
Co-authored-by: feng <1304903146@qq.com>
2023-03-19 23:55:16 +08:00
WeiZhixiong
8e33c6f422 fix: SyntaxWarning, apps/common/drf/parsers/base.py:114, "is" should be "==" 2023-03-18 23:19:51 +08:00
ibuler
f5523aaf7b perf: 优化导入导出 2023-03-17 10:45:45 +00:00
ibuler
12db64ea18 perf: 优化导入导出 2023-03-17 18:44:21 +08:00
fit2bot
1acfdf0398 perf: 批量推送账号 分批处理 (#10000)
Co-authored-by: feng <1304903146@qq.com>
2023-03-17 17:10:10 +08:00
老广
074c9c85b1 Merge pull request #9999 from jumpserver/pr@dev@perf_ansible_config
perf: 优化 ansible 写法
2023-03-17 17:03:46 +08:00
ibuler
c094bce71e perf: 优化 ansible 写法 2023-03-17 16:57:40 +08:00
ibuler
cad6fffd74 perf: 优化 Ansible 账号选择 2023-03-16 19:09:29 +08:00
Bai
0747cf7c5e fix: 修复导出账号历史翻译信息 2023-03-16 16:40:53 +08:00
BugKing
927251902c workflow: 修改 Gitee 同步的目的仓库 2023-03-16 16:40:53 +08:00
Bai
11675dc850 fix: 修复日志记录到syslog时中文编码问题 2023-03-16 16:40:53 +08:00
Bai
93a7cee4de fix: 修复导出账号历史翻译信息 2023-03-16 11:18:41 +08:00
老广
1cfdfacdf7 Merge pull request #9982 from wan92hen/patch-1
workflow: 修改 Gitee 同步的目的仓库
2023-03-16 10:45:21 +08:00
BugKing
8b6c2f4cc6 workflow: 修改 Gitee 同步的目的仓库 2023-03-16 09:56:25 +08:00
Bai
41edeb9027 fix: 修复日志记录到syslog时中文编码问题 2023-03-15 19:46:01 +08:00
Jiangjie.Bai
2bcd411164 Merge pull request #9976 from jumpserver/dev
v3.1.0 rc4
2023-03-15 19:29:22 +08:00
ibuler
891d9d36b0 fix: windows 平台默认不开启 console 2023-03-15 19:01:18 +08:00
fit2bot
ebdd67d0f4 perf: endpoint rules list (#9975)
Co-authored-by: feng <1304903146@qq.com>
2023-03-15 18:24:39 +08:00
老广
09eebd7486 Merge pull request #9970 from jumpserver/pr@dev@perf_platform_change
perf: 优化资产平台的获取
2023-03-15 17:37:12 +08:00
Bai
894955dd68 fix: 修复更新授权报错的问题 2023-03-15 16:33:38 +08:00
halo
0ade034391 fix: 修复celery api 报错 2023-03-15 15:37:15 +08:00
jiangweidong
07eebd93fb perf: 测试资产可连接性选择账号策略优化 (#9954) 2023-03-15 15:16:27 +08:00
Bai
ffe9dd1f95 fix: 优化账号模版可以根据 protocols 过滤 secret_type 字段 2023-03-15 14:48:14 +08:00
ibuler
2b7f90349c perf: 优化资产平台的获取 2023-03-15 14:14:48 +08:00
Bai
48b937d867 fix: 修复手动登录用户失败的问题 2023-03-15 11:36:51 +08:00
Aaron3S
df249a0355 perf: 优化 playbook 删除策略,正在被 job 使用时无法被删除 2023-03-14 20:02:23 +08:00
fit2bot
2ce293bd81 fix: push ssh key account bug (#9948)
Co-authored-by: feng <1304903146@qq.com>
2023-03-14 17:15:04 +08:00
老广
bff97929b5 Merge pull request #9942 from jumpserver/pr@dev@perf_csv_loads_error
perf: 优化 csv parse
2023-03-14 16:35:37 +08:00
Bai
0053d469f9 fix: 修复用户导入模版中没有 password_strategy 字段问题 2023-03-14 16:31:57 +08:00
ibuler
4c24e95b47 perf: 优化 csv parse 2023-03-14 14:12:42 +08:00
fit2bot
c4945b3563 perf: 优化ansible 选择账号 (#9940)
Co-authored-by: feng <1304903146@qq.com>
2023-03-14 11:40:25 +08:00
ibuler
082af029a7 perf: 优化资产迁移,避免冲突 2023-03-14 11:21:52 +08:00
Bai
44d7165674 perf: 优化一些翻译信息,label 中带单位 2023-03-14 11:19:41 +08:00
fit2bot
d4102ceb7a perf: push select account (#9932)
Co-authored-by: feng <1304903146@qq.com>
2023-03-13 19:35:12 +08:00
老广
4a3196e193 Merge pull request #9931 from jumpserver/pr@dev@fix_excel_import_export
perf: 优化 csv import export
2023-03-13 18:07:57 +08:00
ibuler
16a7ccc95e perf: 优化文案 2023-03-13 18:06:54 +08:00
ibuler
6bb42b8d59 perf: 优化 csv import export 2023-03-13 17:57:50 +08:00
fit2bot
ed70432016 fix: 账号模版创建带密码的密钥之后无法添加到主机 (#9927)
Co-authored-by: feng <1304903146@qq.com>
2023-03-13 15:46:17 +08:00
老广
6a9e013f2f Merge pull request #9921 from jumpserver/pr@dev@fix_remoteapp_privileged_account
fix: 远程应用特权用户不生效问题
2023-03-13 11:18:26 +08:00
halo
9f98e3f098 fix: 远程应用特权用户不生效问题 2023-03-12 21:27:30 +08:00
ibuler
2ffb9a5aa3 perf: 修改 Import export 2023-03-10 19:23:49 +08:00
ibuler
fa3bfceddc perf: 优化导入导出
perf: remove debug

perf: 修改账号导入导出

perf: 去掉一些 debug
2023-03-10 19:23:49 +08:00
fit2bot
3658ecce0c perf: 修改 ssh key with pass 报错 (#9917)
Co-authored-by: ibuler <ibuler@qq.com>
2023-03-10 16:04:48 +08:00
Bai
aeb2e47880 feat: 支持飞书国际版(lark) 2023-03-10 15:13:12 +08:00
Bai
9be01b4c67 feat: 支持飞书国际版(lark) 2023-03-10 15:13:12 +08:00
Bai
83296be11f fix: ignore 2023-03-09 18:12:56 +08:00
Bai
266f5e9350 fix: 修复存在无效 es 时获取终端配置失败的问题 2023-03-09 17:12:05 +08:00
fit2bot
dfbe8c0bc4 fix: 创建资产 可连接性为更新 (#9905)
Co-authored-by: feng <1304903146@qq.com>
2023-03-09 13:59:44 +08:00
jiangweidong
3de2992238 fix: 有可能保存明文密码 2023-03-09 13:02:34 +08:00
Eric
fde92a28bd fix: 修复存储故障造成的录像获取失败问题 2023-03-09 11:51:00 +08:00
吴小白
2662ead1c4 perf: 正确配置 Ansible 证书校验 2023-03-09 11:19:24 +08:00
Bai
3f5af27a4e perf: 优化设置 MFA 文案(禁用=>重置) 2023-03-08 19:13:17 +08:00
fit2bot
c90a2df28e perf: automation account username change id (#9867)
* perf: automation account username change id

* perf: 授权账号模版 自推送

---------

Co-authored-by: feng <1304903146@qq.com>
2023-03-08 18:52:00 +08:00
老广
8a0bd3379c Merge pull request #9889 from jumpserver/pr@dev@perf_ignore_ssl
perf: tinkerd 部署增加 ignore-verify-certs 配置
2023-03-08 16:34:34 +08:00
Eric
26ad12d448 perf: build action use pypi mirror 2023-03-08 16:28:17 +08:00
Eric
177150c5cc perf: tinkerd 部署增加 ignore-verify-certs 配置 2023-03-08 16:16:10 +08:00
Bai
bbddf6a342 fix: 修复组织管理员查看活动日志详情时没有对象的问题 2023-03-08 15:57:43 +08:00
Bai
6bbe602ebb fix: 修复组织管理员查看操作日志可以看到 system 组织下的操作问题, 只有系统管理员可以查看任务监控 2023-03-08 15:22:49 +08:00
老广
21352a2ab7 Merge pull request #9871 from jumpserver/pr@dev@fix_su_from_accounts
fix: 修复su-from-accounts API 500问题,Unsubscribe msg error 转成debug
2023-03-08 14:06:59 +08:00
老广
1cbfd48e11 Merge pull request #9874 from jumpserver/pr@dev@fix_operatelog_hide_sth
fix: 操作日志显示用户加密后的密文,及日期格式调整
2023-03-08 14:06:12 +08:00
老广
c8c33c02ef Merge pull request #9880 from jumpserver/pr@dev@perf_applet_certs
fix: 修复自签证书下发布机部署失败
2023-03-08 14:04:47 +08:00
老广
261ec60ab7 Merge pull request #9870 from jumpserver/pr@dev@fix_reconnecttoken
feat: connection-token 添加重联兑换 API
2023-03-08 14:04:01 +08:00
老广
c1d1863af4 Merge pull request #9881 from jumpserver/pr@dev@perf_email_test_error
perf: 邮箱测试时,不填写'主题前缀'会报错
2023-03-08 14:02:37 +08:00
jiangweidong
72ca55c293 perf: 邮箱测试时,不填写'主题前缀'会报错 2023-03-08 13:49:38 +08:00
吴小白
7d6295775f perf: 还原国际化文本格式 2023-03-08 13:42:37 +08:00
吴小白
17ec105f69 perf: 修正错误 2023-03-08 13:40:55 +08:00
吴小白
366e20b165 fix: 修复自签证书下发布机部署失败 2023-03-08 13:27:03 +08:00
jiangweidong
be669f7f05 fix: 操作日志显示用户加密后的密文,及日期格式调整 2023-03-08 11:21:15 +08:00
feng
8833b19d79 fix: 修复su-from-accounts API 500问题,Unsubscribe msg error 转成debug 2023-03-08 10:58:37 +08:00
Bai
4c7bc105d7 feat: connection-token 添加重联兑换 API 2023-03-08 10:25:53 +08:00
老广
bb30fcd7fd Merge pull request #9851 from jumpserver/pr@dev@fix_private_key
fix: 修复 ed25519 私钥测试可连接性失败问题
2023-03-07 11:29:10 +08:00
Eric
eedc1ae8b5 fix: 修复类型问题 2023-03-02 19:05:27 +08:00
Eric
b951ed9206 fix: 修复 account 私钥文件生成 2023-03-02 18:57:49 +08:00
Eric
03cc487fe6 fix: 修复 ed25519 私钥测试可连接性失败问题 2023-03-02 18:50:09 +08:00
feng
22f3caa954 fix: 修复i8n 500 2023-03-02 16:23:16 +08:00
Bai
891c478d13 fix: 修复 ldap 用户登录时邮箱存在 500 的问题 2023-03-02 16:22:55 +08:00
Bai
1901ef7252 fix: 修复 ldap 用户登录时邮箱存在 500 的问题 2023-03-02 15:58:32 +08:00
Aaron3S
6bc2f73f49 fix: 修复作业执行没有日志权限的问题 2023-03-01 18:37:27 +08:00
fit2bot
820971e2be perf: k8s tree run (#9834)
Co-authored-by: feng <1304903146@qq.com>
2023-03-01 18:26:54 +08:00
Bai
27e1c17b26 fix: 资产类型树返回类型节点时, 没有platfrom设置isParent为False, 解决展开节点重复的问题 2023-03-01 17:28:39 +08:00
fit2bot
d8d73700ea perf: k8s tree update api (#9827)
Co-authored-by: feng <1304903146@qq.com>
2023-03-01 17:04:17 +08:00
ibuler
ed967dcba9 perf: 优化翻译 2023-03-01 15:20:55 +08:00
Bai
c39acc9a93 fix: 修改翻译 Core API & HelpText 2023-03-01 15:20:27 +08:00
Bai
c37e2d3dc2 fix: 修改翻译 已有 RDS 许可证 2023-03-01 15:20:27 +08:00
fit2bot
797c7635a7 perf: asset hardwareinfo (#9813)
Co-authored-by: feng <1304903146@qq.com>
2023-02-28 18:45:38 +08:00
老广
410668c209 Merge pull request #9812 from jumpserver/pr@dev@perf_rd_license
perf: 优化 RD License 配置
2023-02-28 18:31:16 +08:00
吴小白
3cbd772c4e perf: 优化 RD License 配置 2023-02-28 18:00:08 +08:00
Bai
bc2d4735c1 fix: 修改翻译 2023-02-28 17:59:04 +08:00
fit2bot
dfa3f4b53b perf: 推送账号 社区版定时任务关闭 (#9804)
Co-authored-by: feng <1304903146@qq.com>
2023-02-28 13:35:17 +08:00
老广
442dbc836d Merge pull request #9799 from jumpserver/pr@dev@fix_protocol_init_error
perf: 修改协议创建时一些默认值
2023-02-28 09:44:31 +08:00
ibuler
8c81e60a1e perf: 修改协议创建时一些默认值 2023-02-27 19:48:07 +08:00
fit2bot
fccdb66530 perf: 今日活跃资产 (#9796)
Co-authored-by: feng <1304903146@qq.com>
2023-02-27 18:10:08 +08:00
Aaron3S
094ad85d39 fix: 默认增加普通用户作业中心权限 2023-02-27 17:27:45 +08:00
ibuler
32081ea6ec perf: 添加账号用户名的推荐
perf: 修改账号推荐
2023-02-27 15:19:59 +08:00
ibuler
8937447955 perf: 修改资产 address 长度,以支持 mb4
perf: 修改长度
2023-02-27 14:07:54 +08:00
ibuler
454a38f994 perf: 去掉没有 Name 的迁移 2023-02-27 14:02:30 +08:00
老广
972d6fb924 Merge pull request #9777 from jumpserver/pr@dev@perf_account_migrate2
perf: 优化迁移 accounts
2023-02-27 10:08:00 +08:00
ibuler
d2b6bb5013 perf: 优化迁移 accounts
perf: 优化账号迁移,同名的迁移到历史中
2023-02-26 09:47:40 +08:00
Bai
a6388fc482 perf: 优化 README 2023-02-25 22:47:46 +08:00
Bai
32c034fdec perf: 优化 README 2023-02-25 22:47:46 +08:00
Bai
e1724844b0 perf: 优化 README 2023-02-25 22:47:46 +08:00
Bai
912ee3de09 perf: 优化 README 2023-02-25 13:01:49 +08:00
Bai
78c6252318 perf: 优化 README 2023-02-25 13:01:49 +08:00
Bai
d07c3e2de5 perf: 优化 README 2023-02-25 13:01:49 +08:00
Bai
83d97111c6 perf: 优化 README 2023-02-25 13:01:49 +08:00
Bai
616b0d7e5d perf: 优化 README 2023-02-25 13:01:49 +08:00
Bai
6168608fa1 perf: 优化 README 2023-02-25 13:01:49 +08:00
Bai
9e8cf1926e perf: 优化 README 2023-02-25 13:01:49 +08:00
Bai
11ba29cb68 perf: 优化 README 2023-02-25 13:01:49 +08:00
Bai
e8e23c2566 perf: 优化 README 2023-02-25 13:01:49 +08:00
Bai
8db518d2cd perf: 优化 README 2023-02-25 13:01:49 +08:00
老广
ec31b4de73 Merge pull request #9759 from jumpserver/pr@dev@fix_activity_save_error
fix: 解决Activity保存因为参数出错问题
2023-02-24 18:18:18 +08:00
fit2bot
f1c568dfc0 perf: 修改host info 接口, 社区开放applet, 修改改密发邮件bug (#9757)
Co-authored-by: feng <1304903146@qq.com>
2023-02-24 18:08:22 +08:00
jiangweidong
824e4c9e81 fix: 解决Activity保存因为参数出错问题 2023-02-24 17:59:32 +08:00
老广
9895ae73bc Merge pull request #9756 from jumpserver/pr@dev@update_support_version
update: 更新问题支持版本说明
2023-02-24 15:43:51 +08:00
吴小白
7d3a702e7d update: 更新问题支持版本说明 2023-02-24 15:37:51 +08:00
Bai
6541cd9f5f fix: 修复 web gui 支持的数据库 2023-02-24 15:12:41 +08:00
ibuler
22a1d60e3f perf: 优化 msg 2023-02-24 14:46:43 +08:00
Bai
63ca4f8fab fix: 修复认证MFA失败次数清空问题 2023-02-24 14:44:13 +08:00
fit2bot
a4a871ff2b fix: 修复计算今日活跃资产过滤逻辑 (#9745)
Co-authored-by: Bai <baijiangjie@gmail.com>
2023-02-24 12:16:45 +08:00
Bai
1b2de703f4 fix: 修复获取授权资产详情时返回 spec_info 字段, 解决连接 Magnus 问题 2023-02-24 11:41:15 +08:00
maninhill
4650652faf perf:更新 README 中的产品 UI 展示截图 2023-02-24 00:32:15 +08:00
ibuler
0f338a3b58 perf: 修复社区版可能引起的问题 2023-02-24 00:31:38 +08:00
老广
6bb6e8eb9b Merge pull request #9735 from jumpserver/dev
fix: 修复 loong64 grpc 构建失败
2023-02-23 21:48:51 +08:00
老广
472c14fd27 Merge pull request #9734 from jumpserver/pr@dev@fix_build_grpc
fix: 修复 loong64 grpc 构建失败
2023-02-23 21:46:26 +08:00
吴小白
9d4854b8c3 fix: 修复 loong64 grpc 构建失败 2023-02-23 21:34:21 +08:00
517 changed files with 14800 additions and 6080 deletions

View File

@@ -1,5 +1,4 @@
.git
logs/*
data/*
.github
tmp/*
@@ -8,4 +7,4 @@ celerybeat.pid
### Vagrant ###
.vagrant/
apps/xpack/.git
.history/

View File

@@ -3,8 +3,10 @@ name: 需求建议
about: 提出针对本项目的想法和建议
title: "[Feature] "
labels: 类型:需求
assignees: ibuler
assignees:
- ibuler
- baijiangjie
- wojiushixiaobai
---
**请描述您的需求或者改进建议.**

View File

@@ -3,11 +3,13 @@ name: Bug 提交
about: 提交产品缺陷帮助我们更好的改进
title: "[Bug] "
labels: 类型:bug
assignees: wojiushixiaobai
assignees:
- wojiushixiaobai
- baijiangjie
---
**JumpServer 版本(v1.5.9以下不再支持)**
**JumpServer 版本( v2.28 之前的版本不再支持 )**
**浏览器版本**
@@ -17,6 +19,6 @@ assignees: wojiushixiaobai
**Bug 重现步骤(有截图更好)**
1.
2.
3.
1.
2.
3.

View File

@@ -3,7 +3,9 @@ name: 问题咨询
about: 提出针对本项目安装部署、使用及其他方面的相关问题
title: "[Question] "
labels: 类型:提问
assignees: wojiushixiaobai
assignees:
- wojiushixiaobai
- baijiangjie
---

View File

@@ -21,17 +21,44 @@ jobs:
actions: 'remove-labels'
labels: '状态:待反馈'
add-label-if-not-author:
add-label-if-is-member:
runs-on: ubuntu-latest
if: (github.event.issue.user.id != github.event.comment.user.id) && !github.event.issue.pull_request && (github.event.issue.state == 'open')
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get Organization name
id: org_name
run: echo "data=$(echo '${{ github.repository }}' | cut -d '/' -f 1)" >> $GITHUB_OUTPUT
- name: Get Organization public members
uses: octokit/request-action@v2.x
id: members
with:
route: GET /orgs/${{ steps.org_name.outputs.data }}/public_members
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Process public members data
# 将 members 中的数据转化为 login 字段的拼接字符串
id: member_names
run: echo "data=$(echo '${{ steps.members.outputs.data }}' | jq '[.[].login] | join(",")')" >> $GITHUB_OUTPUT
- run: "echo members: '${{ steps.members.outputs.data }}'"
- run: "echo member names: '${{ steps.member_names.outputs.data }}'"
- run: "echo comment user: '${{ github.event.comment.user.login }}'"
- run: "echo contains? : '${{ contains(steps.member_names.outputs.data, github.event.comment.user.login) }}'"
- name: Add require replay label
if: contains(steps.member_names.outputs.data, github.event.comment.user.login)
uses: actions-cool/issues-helper@v2
with:
actions: 'add-labels'
labels: '状态:待反馈'
- name: Remove require handle label
if: contains(steps.member_names.outputs.data, github.event.comment.user.login)
uses: actions-cool/issues-helper@v2
with:
actions: 'remove-labels'

View File

@@ -24,6 +24,7 @@ jobs:
build-args: |
APT_MIRROR=http://deb.debian.org
PIP_MIRROR=https://pypi.org/simple
PIP_JMS_MIRROR=https://pypi.org/simple
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -20,4 +20,4 @@ jobs:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_SSH_PRIVATE_KEY }}
with:
source-repo: 'git@github.com:jumpserver/jumpserver.git'
destination-repo: 'git@gitee.com:jumpserver/jumpserver.git'
destination-repo: 'git@gitee.com:fit2cloud-feizhiyun/JumpServer.git'

2
.gitignore vendored
View File

@@ -35,7 +35,6 @@ celerybeat-schedule.db
docs/_build/
xpack
xpack.bak
logs/*
### Vagrant ###
.vagrant/
release/*
@@ -43,3 +42,4 @@ releashe
/apps/script.py
data/*
test.py
.history/

View File

@@ -1,4 +1,4 @@
FROM python:3.9-slim as stage-build
FROM jumpserver/python:3.9-slim-buster as stage-build
ARG TARGETARCH
ARG VERSION
@@ -8,7 +8,7 @@ WORKDIR /opt/jumpserver
ADD . .
RUN cd utils && bash -ixeu build.sh
FROM python:3.9-slim
FROM jumpserver/python:3.9-slim-buster
ARG TARGETARCH
MAINTAINER JumpServer Team <ibuler@qq.com>
@@ -22,11 +22,14 @@ ARG DEPENDENCIES=" \
libpq-dev \
libffi-dev \
libjpeg-dev \
libkrb5-dev \
libldap2-dev \
libsasl2-dev \
libssl-dev \
libxml2-dev \
libxmlsec1-dev \
libxmlsec1-openssl \
freerdp2-dev \
libaio-dev"
ARG TOOLS=" \
@@ -55,7 +58,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \
&& apt-get -y install --no-install-recommends ${DEPENDENCIES} \
&& apt-get -y install --no-install-recommends ${TOOLS} \
&& mkdir -p /root/.ssh/ \
&& echo "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null" > /root/.ssh/config \
&& echo "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null\n\tCiphers +aes128-cbc\n\tKexAlgorithms +diffie-hellman-group1-sha1\n\tHostKeyAlgorithms +ssh-rsa" > /root/.ssh/config \
&& echo "set mouse-=a" > ~/.vimrc \
&& echo "no" | dpkg-reconfigure dash \
&& echo "zh_CN.UTF-8" | dpkg-reconfigure locales \
@@ -65,27 +68,35 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \
ARG DOWNLOAD_URL=https://download.jumpserver.org
RUN mkdir -p /opt/oracle/ \
&& cd /opt/oracle/ \
&& wget ${DOWNLOAD_URL}/public/instantclient-basiclite-linux.${TARGETARCH}-19.10.0.0.0.zip \
&& unzip instantclient-basiclite-linux.${TARGETARCH}-19.10.0.0.0.zip \
&& sh -c "echo /opt/oracle/instantclient_19_10 > /etc/ld.so.conf.d/oracle-instantclient.conf" \
&& ldconfig \
&& rm -f instantclient-basiclite-linux.${TARGETARCH}-19.10.0.0.0.zip
RUN set -ex \
&& \
if [ "${TARGETARCH}" == "amd64" ] || [ "${TARGETARCH}" == "arm64" ]; then \
mkdir -p /opt/oracle; \
cd /opt/oracle; \
wget ${DOWNLOAD_URL}/public/instantclient-basiclite-linux.${TARGETARCH}-19.10.0.0.0.zip; \
unzip instantclient-basiclite-linux.${TARGETARCH}-19.10.0.0.0.zip; \
echo "/opt/oracle/instantclient_19_10" > /etc/ld.so.conf.d/oracle-instantclient.conf; \
ldconfig; \
rm -f instantclient-basiclite-linux.${TARGETARCH}-19.10.0.0.0.zip; \
fi
WORKDIR /tmp/build
COPY ./requirements ./requirements
ARG PIP_MIRROR=https://pypi.douban.com/simple
ENV PIP_MIRROR=$PIP_MIRROR
ARG PIP_JMS_MIRROR=https://pypi.douban.com/simple
ENV PIP_JMS_MIRROR=$PIP_JMS_MIRROR
RUN --mount=type=cache,target=/root/.cache/pip \
set -ex \
&& pip config set global.index-url ${PIP_MIRROR} \
&& pip install --upgrade pip \
&& pip install --upgrade setuptools wheel \
&& \
if [ "${TARGETARCH}" == "loong64" ]; then \
pip install https://download.jumpserver.org/pypi/simple/cryptography/cryptography-38.0.4-cp39-cp39-linux_loongarch64.whl; \
pip install https://download.jumpserver.org/pypi/simple/greenlet/greenlet-1.1.2-cp39-cp39-linux_loongarch64.whl; \
pip install https://download.jumpserver.org/pypi/simple/PyNaCl/PyNaCl-1.5.0-cp39-cp39-linux_loongarch64.whl; \
fi \
&& pip install $(grep -E 'jms|jumpserver' requirements/requirements.txt) -i ${PIP_JMS_MIRROR} \
&& pip install -r requirements/requirements.txt

View File

@@ -1,10 +1,21 @@
ARG VERSION
FROM registry.fit2cloud.com/jumpserver/xpack:${VERSION} as build-xpack
FROM jumpserver/core:${VERSION}
ARG TARGETARCH
COPY --from=build-xpack /opt/xpack /opt/jumpserver/apps/xpack
WORKDIR /opt/jumpserver
ARG ORACLE_VERSION=1.4.0b1
RUN --mount=type=cache,target=/root/.cache/pip \
set -ex \
&& \
if [ "${TARGETARCH}" == "amd64" ] || [ "${TARGETARCH}" == "arm64" ] || [ "${TARGETARCH}" == "loong64" ]; then \
pip install https://download.jumpserver.org/pypi/simple/oracledb/oracledb-${ORACLE_VERSION}-cp39-cp39-linux_$(uname -m).whl; \
fi \
&& \
if [ "${TARGETARCH}" == "loong64" ]; then \
pip install https://download.jumpserver.org/pypi/simple/grpcio/grpcio-1.54.2-cp39-cp39-linux_loongarch64.whl; \
fi \
&& pip install -r requirements/requirements_xpack.txt

View File

@@ -1,95 +0,0 @@
FROM python:3.9-slim as stage-build
ARG TARGETARCH
ARG VERSION
ENV VERSION=$VERSION
WORKDIR /opt/jumpserver
ADD . .
RUN cd utils && bash -ixeu build.sh
FROM python:3.9-slim
ARG TARGETARCH
MAINTAINER JumpServer Team <ibuler@qq.com>
ARG BUILD_DEPENDENCIES=" \
g++ \
make \
pkg-config"
ARG DEPENDENCIES=" \
freetds-dev \
libpq-dev \
libffi-dev \
libjpeg-dev \
libldap2-dev \
libsasl2-dev \
libxml2-dev \
libxmlsec1-dev \
libxmlsec1-openssl \
libaio-dev"
ARG TOOLS=" \
ca-certificates \
curl \
default-libmysqlclient-dev \
default-mysql-client \
locales \
openssh-client \
procps \
sshpass \
telnet \
unzip \
vim \
git \
wget"
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \
set -ex \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& apt-get update \
&& apt-get -y install --no-install-recommends ${BUILD_DEPENDENCIES} \
&& apt-get -y install --no-install-recommends ${DEPENDENCIES} \
&& apt-get -y install --no-install-recommends ${TOOLS} \
&& mkdir -p /root/.ssh/ \
&& echo "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null" > /root/.ssh/config \
&& echo "set mouse-=a" > ~/.vimrc \
&& echo "no" | dpkg-reconfigure dash \
&& echo "zh_CN.UTF-8" | dpkg-reconfigure locales \
&& sed -i "s@# export @export @g" ~/.bashrc \
&& sed -i "s@# alias @alias @g" ~/.bashrc \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp/build
COPY ./requirements ./requirements
ARG PIP_MIRROR=https://pypi.douban.com/simple
ENV PIP_MIRROR=$PIP_MIRROR
ARG PIP_JMS_MIRROR=https://pypi.douban.com/simple
ENV PIP_JMS_MIRROR=$PIP_JMS_MIRROR
RUN --mount=type=cache,target=/root/.cache/pip \
set -ex \
&& pip config set global.index-url ${PIP_MIRROR} \
&& pip install --upgrade pip \
&& pip install --upgrade setuptools wheel \
&& pip install https://download.jumpserver.org/pypi/simple/cryptography/cryptography-38.0.4-cp39-cp39-linux_loongarch64.whl \
&& pip install https://download.jumpserver.org/pypi/simple/greenlet/greenlet-1.1.2-cp39-cp39-linux_loongarch64.whl \
&& pip install $(grep 'PyNaCl' requirements/requirements.txt) \
&& GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true pip install grpcio \
&& pip install $(grep -E 'jms|jumpserver' requirements/requirements.txt) -i ${PIP_JMS_MIRROR} \
&& pip install -r requirements/requirements.txt
COPY --from=stage-build /opt/jumpserver/release/jumpserver /opt/jumpserver
RUN echo > /opt/jumpserver/config.yml \
&& rm -rf /tmp/build
WORKDIR /opt/jumpserver
VOLUME /opt/jumpserver/data
VOLUME /opt/jumpserver/logs
ENV LANG=zh_CN.UTF-8
EXPOSE 8080
ENTRYPOINT ["./entrypoint.sh"]

1
GITSHA Normal file
View File

@@ -0,0 +1 @@
fe37913ed998fdd4e216626faee011ceba26e56f

View File

@@ -10,10 +10,26 @@
<a href="https://github.com/jumpserver/jumpserver"><img src="https://img.shields.io/github/stars/jumpserver/jumpserver?color=%231890FF&style=flat-square" alt="Stars"></a>
</p>
--------------------------
<p align="center">
JumpServer <a href="https://github.com/jumpserver/jumpserver/releases/tag/v3.0.0">v3.0</a> 正式发布。
<br>
9 年时间,倾情投入,用心做好一款开源堡垒机。
</p>
JumpServer 是广受欢迎的开源堡垒机,是符合 4A 规范的专业运维安全审计系统。
JumpServer 堡垒机帮助企业以更安全的方式管控和登录各种类型的资产,包括:
- **SSH**: Linux / Unix / 网络设备 等;
- **Windows**: Web 方式连接 / 原生 RDP 连接;
- **数据库**: MySQL / MariaDB / PostgreSQL / Oracle / SQLServer / ClickHouse 等;
- **NoSQL**: Redis / MongoDB 等;
- **GPT**: ChatGPT 等;
- **云服务**: Kubernetes / VMware vSphere 等;
- **Web 站点**: 各类系统的 Web 管理后台;
- **应用**: 通过 Remote App 连接各类应用。
## 产品特色
- **开源**: 零门槛,线上快速获取和安装;
@@ -22,12 +38,10 @@ JumpServer 是广受欢迎的开源堡垒机,是符合 4A 规范的专业运
- **多云支持**: 一套系统,同时管理不同云上面的资产;
- **多租户**: 一套系统,多个子公司或部门同时使用;
- **云端存储**: 审计录像云端存储,永不丢失;
- **多应用支持**: 全面支持各类资产包括服务器、数据库、Windows RemoteApp、Kubernetes 等;
- **安全可靠**: 被广泛使用、验证和信赖,连续 9 年的持续研发投入和产品更新升级。
## UI 展示
![UI展示](https://www.jumpserver.org/images/screenshot/1.png)
![UI展示](https://docs.jumpserver.org/zh/v3/img/dashboard.png)
## 在线体验
@@ -41,9 +55,9 @@ JumpServer 是广受欢迎的开源堡垒机,是符合 4A 规范的专业运
## 快速开始
- [极速安装](https://docs.jumpserver.org/zh/master/install/setup_by_fast/)
- [手动安装](https://github.com/jumpserver/installer)
- [快速入门](https://docs.jumpserver.org/zh/v3/quick_start/)
- [产品文档](https://docs.jumpserver.org)
- [在线学习](https://edu.fit2cloud.com/page/2635362)
- [知识库](https://kb.fit2cloud.com/categories/jumpserver)
## 案例研究
@@ -61,14 +75,11 @@ JumpServer 是广受欢迎的开源堡垒机,是符合 4A 规范的专业运
- [东方明珠JumpServer高效管控异构化、分布式云端资产](https://blog.fit2cloud.com/?p=687)
- [江苏农信JumpServer堡垒机助力行业云安全运维](https://blog.fit2cloud.com/?p=666)
## 社区
## 社区交流
如果您在使用过程中有任何疑问或对建议,欢迎提交 [GitHub Issue](https://github.com/jumpserver/jumpserver/issues/new/choose)
或加入到我们的社区当中进行进一步交流沟通。
如果您在使用过程中有任何疑问或对建议,欢迎提交 [GitHub Issue](https://github.com/jumpserver/jumpserver/issues/new/choose)
### 微信交流群
<img src="https://download.jumpserver.org/images/wecom-group.jpeg" alt="微信群二维码" width="200"/>
您也可以到我们的 [社区论坛](https://bbs.fit2cloud.com/c/js/5) 当中进行交流沟通。
### 参与贡献
@@ -78,15 +89,20 @@ JumpServer 是广受欢迎的开源堡垒机,是符合 4A 规范的专业运
## 组件项目
| 项目 | 状态 | 描述 |
|--------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| [Lina](https://github.com/jumpserver/lina) | <a href="https://github.com/jumpserver/lina/releases"><img alt="Lina release" src="https://img.shields.io/github/release/jumpserver/lina.svg" /></a> | JumpServer Web UI 项目 |
| [Luna](https://github.com/jumpserver/luna) | <a href="https://github.com/jumpserver/luna/releases"><img alt="Luna release" src="https://img.shields.io/github/release/jumpserver/luna.svg" /></a> | JumpServer Web Terminal 项目 |
| [KoKo](https://github.com/jumpserver/koko) | <a href="https://github.com/jumpserver/koko/releases"><img alt="Koko release" src="https://img.shields.io/github/release/jumpserver/koko.svg" /></a> | JumpServer 字符协议 Connector 项目,替代原来 Python 版本的 [Coco](https://github.com/jumpserver/coco) |
| [Lion](https://github.com/jumpserver/lion-release) | <a href="https://github.com/jumpserver/lion-release/releases"><img alt="Lion release" src="https://img.shields.io/github/release/jumpserver/lion-release.svg" /></a> | JumpServer 图形协议 Connector 项目,依赖 [Apache Guacamole](https://guacamole.apache.org/) |
| [Magnus](https://github.com/jumpserver/magnus-release) | <a href="https://github.com/jumpserver/magnus-release/releases"><img alt="Magnus release" src="https://img.shields.io/github/release/jumpserver/magnus-release.svg" /> | JumpServer 数据库代理 Connector 项目 |
| [Clients](https://github.com/jumpserver/clients) | <a href="https://github.com/jumpserver/clients/releases"><img alt="Clients release" src="https://img.shields.io/github/release/jumpserver/clients.svg" /> | JumpServer 客户端 项目 |
| [Installer](https://github.com/jumpserver/installer) | <a href="https://github.com/jumpserver/installer/releases"><img alt="Installer release" src="https://img.shields.io/github/release/jumpserver/installer.svg" /> | JumpServer 安装包 项目 |
| 项目 | 状态 | 描述 |
|--------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| [Lina](https://github.com/jumpserver/lina) | <a href="https://github.com/jumpserver/lina/releases"><img alt="Lina release" src="https://img.shields.io/github/release/jumpserver/lina.svg" /></a> | JumpServer Web UI 项目 |
| [Luna](https://github.com/jumpserver/luna) | <a href="https://github.com/jumpserver/luna/releases"><img alt="Luna release" src="https://img.shields.io/github/release/jumpserver/luna.svg" /></a> | JumpServer Web Terminal 项目 |
| [KoKo](https://github.com/jumpserver/koko) | <a href="https://github.com/jumpserver/koko/releases"><img alt="Koko release" src="https://img.shields.io/github/release/jumpserver/koko.svg" /></a> | JumpServer 字符协议 Connector 项目 |
| [Lion](https://github.com/jumpserver/lion-release) | <a href="https://github.com/jumpserver/lion-release/releases"><img alt="Lion release" src="https://img.shields.io/github/release/jumpserver/lion-release.svg" /></a> | JumpServer 图形协议 Connector 项目,依赖 [Apache Guacamole](https://guacamole.apache.org/) |
| [Razor](https://github.com/jumpserver/razor) | <img alt="Chen" src="https://img.shields.io/badge/release-私有发布-red" /> | JumpServer RDP 代理 Connector 项目 |
| [Tinker](https://github.com/jumpserver/tinker) | <img alt="Tinker" src="https://img.shields.io/badge/release-私有发布-red" /> | JumpServer 远程应用 Connector 项目 |
| [Magnus](https://github.com/jumpserver/magnus-release) | <a href="https://github.com/jumpserver/magnus-release/releases"><img alt="Magnus release" src="https://img.shields.io/github/release/jumpserver/magnus-release.svg" /> | JumpServer 数据库代理 Connector 项目 |
| [Chen](https://github.com/jumpserver/chen-release) | <a href="https://github.com/jumpserver/chen-release/releases"><img alt="Chen release" src="https://img.shields.io/github/release/jumpserver/chen-release.svg" /> | JumpServer Web DB 项目,替代原来的 OmniDB |
| [Kael](https://github.com/jumpserver/kael) | <a href="https://github.com/jumpserver/kael/releases"><img alt="Kael release" src="https://img.shields.io/github/release/jumpserver/kael.svg" /> | JumpServer 连接 GPT 资产的组件项目 |
| [Wisp](https://github.com/jumpserver/wisp) | <a href="https://github.com/jumpserver/wisp/releases"><img alt="Magnus release" src="https://img.shields.io/github/release/jumpserver/wisp.svg" /> | JumpServer 各系统终端组件和 Core Api 通信的组件项目 |
| [Clients](https://github.com/jumpserver/clients) | <a href="https://github.com/jumpserver/clients/releases"><img alt="Clients release" src="https://img.shields.io/github/release/jumpserver/clients.svg" /> | JumpServer 客户端 项目 |
| [Installer](https://github.com/jumpserver/installer) | <a href="https://github.com/jumpserver/installer/releases"><img alt="Installer release" src="https://img.shields.io/github/release/jumpserver/installer.svg" /> | JumpServer 安装包 项目 |
## 安全说明
@@ -96,11 +112,6 @@ JumpServer是一款安全产品请参考 [基本安全建议](https://docs.ju
- 邮箱support@fit2cloud.com
- 电话400-052-0755
## 致谢
- [Apache Guacamole](https://guacamole.apache.org/) Web 页面连接 RDP、SSH、VNC 等协议资产JumpServer Lion 组件使用到该项目;
- [OmniDB](https://omnidb.org/) Web 页面连接使用数据库JumpServer Web 数据库组件使用到该项目。
## License & Copyright
Copyright (c) 2014-2023 飞致云 FIT2CLOUD, All rights reserved.

View File

@@ -1,26 +1,28 @@
from django.shortcuts import get_object_or_404
from rest_framework.decorators import action
from rest_framework.generics import ListAPIView
from rest_framework.generics import ListAPIView, CreateAPIView
from rest_framework.response import Response
from rest_framework.status import HTTP_200_OK
from accounts import serializers
from accounts.filters import AccountFilterSet
from accounts.models import Account
from assets.models import Asset
from common.permissions import UserConfirmation, ConfirmType
from assets.models import Asset, Node
from common.api import ExtraFilterFieldsMixin
from common.permissions import UserConfirmation, ConfirmType, IsValidUser
from common.views.mixins import RecordViewLogMixin
from orgs.mixins.api import OrgBulkModelViewSet
from rbac.permissions import RBACPermission
__all__ = [
'AccountViewSet', 'AccountSecretsViewSet',
'AccountHistoriesSecretAPI'
'AccountHistoriesSecretAPI', 'AssetAccountBulkCreateApi',
]
class AccountViewSet(OrgBulkModelViewSet):
model = Account
search_fields = ('username', 'asset__address', 'name')
search_fields = ('username', 'name', 'asset__name', 'asset__address')
filterset_class = AccountFilterSet
serializer_classes = {
'default': serializers.AccountSerializer,
@@ -28,7 +30,9 @@ class AccountViewSet(OrgBulkModelViewSet):
rbac_perms = {
'partial_update': ['accounts.change_account'],
'su_from_accounts': 'accounts.view_account',
'clear_secret': 'accounts.change_account',
}
export_as_zip = True
@action(methods=['get'], detail=False, url_path='su-from-accounts')
def su_from_accounts(self, request, *args, **kwargs):
@@ -42,11 +46,43 @@ class AccountViewSet(OrgBulkModelViewSet):
asset = get_object_or_404(Asset, pk=asset_id)
accounts = asset.accounts.all()
else:
accounts = []
accounts = Account.objects.none()
accounts = self.filter_queryset(accounts)
serializer = serializers.AccountSerializer(accounts, many=True)
return Response(data=serializer.data)
@action(
methods=['get'], detail=False, url_path='username-suggestions',
permission_classes=[IsValidUser]
)
def username_suggestions(self, request, *args, **kwargs):
asset_ids = request.query_params.get('assets')
node_keys = request.query_params.get('keys')
username = request.query_params.get('username')
assets = Asset.objects.all()
if asset_ids:
assets = assets.filter(id__in=asset_ids.split(','))
if node_keys:
patten = Node.get_node_all_children_key_pattern(node_keys.split(','))
assets = assets.filter(nodes__key__regex=patten)
accounts = Account.objects.filter(asset__in=assets)
if username:
accounts = accounts.filter(username__icontains=username)
usernames = list(accounts.values_list('username', flat=True).distinct()[:10])
usernames.sort()
common = [i for i in usernames if i in usernames if i.lower() in ['root', 'admin', 'administrator']]
others = [i for i in usernames if i not in common]
usernames = common + others
return Response(data=usernames)
@action(methods=['patch'], detail=False, url_path='clear-secret')
def clear_secret(self, request, *args, **kwargs):
account_ids = request.data.get('account_ids', [])
self.model.objects.filter(id__in=account_ids).update(secret=None)
return Response(status=HTTP_200_OK)
class AccountSecretsViewSet(RecordViewLogMixin, AccountViewSet):
"""
@@ -63,7 +99,21 @@ class AccountSecretsViewSet(RecordViewLogMixin, AccountViewSet):
}
class AccountHistoriesSecretAPI(RecordViewLogMixin, ListAPIView):
class AssetAccountBulkCreateApi(CreateAPIView):
serializer_class = serializers.AssetAccountBulkSerializer
rbac_perms = {
'POST': 'accounts.add_account',
}
def create(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
data = serializer.create(serializer.validated_data)
serializer = serializers.AssetAccountBulkSerializerResultSerializer(data, many=True)
return Response(data=serializer.data, status=HTTP_200_OK)
class AccountHistoriesSecretAPI(ExtraFilterFieldsMixin, RecordViewLogMixin, ListAPIView):
model = Account.history.model
serializer_class = serializers.AccountHistorySerializer
http_method_names = ['get', 'options']
@@ -75,6 +125,10 @@ class AccountHistoriesSecretAPI(RecordViewLogMixin, ListAPIView):
def get_object(self):
return get_object_or_404(Account, pk=self.kwargs.get('pk'))
@staticmethod
def filter_spm_queryset(resource_ids, queryset):
return queryset.filter(history_id__in=resource_ids)
def get_queryset(self):
account = self.get_object()
histories = account.history.all()

View File

@@ -24,15 +24,16 @@ class AccountsTaskCreateAPI(CreateAPIView):
def perform_create(self, serializer):
data = serializer.validated_data
accounts = data.get('accounts', [])
params = data.get('params')
account_ids = [str(a.id) for a in accounts]
if data['action'] == 'push':
task = push_accounts_to_assets_task.delay(account_ids)
task = push_accounts_to_assets_task.delay(account_ids, params)
else:
account = accounts[0]
asset = account.asset
if not asset.auto_info['ansible_enabled'] or \
not asset.auto_info['ping_enabled']:
if not asset.auto_config['ansible_enabled'] or \
not asset.auto_config['ping_enabled']:
raise NotSupportedTemporarilyError()
task = verify_accounts_connectivity_task.delay(account_ids)

View File

@@ -1,19 +1,58 @@
from rbac.permissions import RBACPermission
from common.permissions import UserConfirmation, ConfirmType
from django_filters import rest_framework as drf_filters
from rest_framework.decorators import action
from rest_framework.response import Response
from common.views.mixins import RecordViewLogMixin
from orgs.mixins.api import OrgBulkModelViewSet
from accounts import serializers
from accounts.models import AccountTemplate
from assets.const import Protocol
from common.drf.filters import BaseFilterSet
from common.permissions import UserConfirmation, ConfirmType
from common.views.mixins import RecordViewLogMixin
from orgs.mixins.api import OrgBulkModelViewSet
from rbac.permissions import RBACPermission
class AccountTemplateFilterSet(BaseFilterSet):
protocols = drf_filters.CharFilter(method='filter_protocols')
class Meta:
model = AccountTemplate
fields = ('username', 'name')
@staticmethod
def filter_protocols(queryset, name, value):
secret_types = set()
protocols = value.split(',')
protocol_secret_type_map = Protocol.settings()
for p in protocols:
if p not in protocol_secret_type_map:
continue
_st = protocol_secret_type_map[p].get('secret_types', [])
secret_types.update(_st)
if not secret_types:
secret_types = ['password']
queryset = queryset.filter(secret_type__in=secret_types)
return queryset
class AccountTemplateViewSet(OrgBulkModelViewSet):
model = AccountTemplate
filterset_fields = ("username", 'name')
filterset_class = AccountTemplateFilterSet
search_fields = ('username', 'name')
serializer_classes = {
'default': serializers.AccountTemplateSerializer
'default': serializers.AccountTemplateSerializer,
}
rbac_perms = {
'su_from_account_templates': 'accounts.view_accounttemplate',
}
@action(methods=['get'], detail=False, url_path='su-from-account-templates')
def su_from_account_templates(self, request, *args, **kwargs):
pk = request.query_params.get('template_id')
templates = AccountTemplate.get_su_from_account_templates(pk)
templates = self.filter_queryset(templates)
serializer = self.get_serializer(templates, many=True)
return Response(data=serializer.data)
class AccountTemplateSecretsViewSet(RecordViewLogMixin, AccountTemplateViewSet):

View File

@@ -1,13 +1,11 @@
# -*- coding: utf-8 -*-
#
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.response import Response
from accounts import serializers
from accounts.const import AutomationTypes
from accounts.const import Source
from accounts.filters import GatheredAccountFilterSet
from accounts.models import GatherAccountsAutomation
from accounts.models import GatheredAccount
@@ -50,22 +48,12 @@ class GatheredAccountViewSet(OrgBulkModelViewSet):
'default': serializers.GatheredAccountSerializer,
}
rbac_perms = {
'sync_account': 'assets.add_gatheredaccount',
'sync_accounts': 'assets.add_gatheredaccount',
}
@action(methods=['post'], detail=True, url_path='sync')
def sync_account(self, request, *args, **kwargs):
gathered_account = super().get_object()
asset = gathered_account.asset
username = gathered_account.username
accounts = asset.accounts.filter(username=username)
if accounts.exists():
accounts.update(source=Source.COLLECTED)
else:
asset.accounts.model.objects.create(
asset=asset, username=username,
name=f'{username}-{_("Collected")}',
source=Source.COLLECTED
)
@action(methods=['post'], detail=False, url_path='sync-accounts')
def sync_accounts(self, request, *args, **kwargs):
gathered_account_ids = request.data.get('gathered_account_ids')
gathered_accounts = self.model.objects.filter(id__in=gathered_account_ids)
self.model.sync_accounts(gathered_accounts)
return Response(status=status.HTTP_201_CREATED)

View File

@@ -0,0 +1,38 @@
- hosts: custom
gather_facts: no
vars:
ansible_connection: local
tasks:
- name: Test privileged account
ssh_ping:
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_secret_type: "{{ jms_account.secret_type }}"
login_private_key_path: "{{ jms_account.private_key_path }}"
register: ping_info
- name: Change asset password
custom_command:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_secret_type: "{{ jms_account.secret_type }}"
login_private_key_path: "{{ jms_account.private_key_path }}"
name: "{{ account.username }}"
password: "{{ account.secret }}"
commands: "{{ params.commands }}"
first_conn_delay_time: "{{ first_conn_delay_time | default(0.5) }}"
ignore_errors: true
when: ping_info is succeeded
register: change_info
- name: Verify password
ssh_ping:
login_user: "{{ account.username }}"
login_password: "{{ account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"

View File

@@ -0,0 +1,20 @@
id: change_secret_by_ssh
name: "{{ 'SSH account change secret' | trans }}"
category:
- device
- host
type:
- all
method: change_secret
params:
- name: commands
type: list
label: '自定义命令'
default: [ '' ]
help_text: '自定义命令中如需包含账号的 账号、密码、SSH 连接的用户密码 字段,<br />请使用 &#123;username&#125;、&#123;password&#125;、&#123;login_password&#125;格式,执行任务时会进行替换 。<br />比如针对 Cisco 主机进行改密,一般需要配置五条命令:<br />1. enable<br />2. &#123;login_password&#125;<br />3. configure terminal<br />4. username &#123;username&#125; privilege 0 password &#123;password&#125; <br />5. end'
i18n:
SSH account change secret:
zh: 使用 SSH 命令行自定义改密
ja: SSH コマンドライン方式でカスタムパスワード変更
en: Custom password change by SSH command line

View File

@@ -38,8 +38,8 @@
db: "{{ jms_asset.spec_info.db_name }}"
name: "{{ account.username }}"
password: "{{ account.secret }}"
ignore_errors: true
when: db_info is succeeded
register: change_info
- name: Verify password
mongodb_ping:
@@ -53,6 +53,3 @@
ssl_certfile: "{{ jms_asset.secret_info.client_key }}"
connection_options:
- tlsAllowInvalidHostnames: "{{ jms_asset.spec_info.allow_invalid_cert}}"
when:
- db_info is succeeded
- change_info is succeeded

View File

@@ -1,6 +1,12 @@
id: change_secret_mongodb
name: Change secret for MongoDB
name: "{{ 'MongoDB account change secret' | trans }}"
category: database
type:
- mongodb
method: change_secret
i18n:
MongoDB account change secret:
zh: 使用 Ansible 模块 mongodb 执行 MongoDB 账号改密
ja: Ansible mongodb モジュールを使用して MongoDB アカウントのパスワード変更
en: Using Ansible module mongodb to change MongoDB account secret

View File

@@ -28,8 +28,8 @@
password: "{{ account.secret }}"
host: "%"
priv: "{{ account.username + '.*:USAGE' if db_name == '' else db_name + '.*:ALL' }}"
ignore_errors: true
when: db_info is succeeded
register: change_info
- name: Verify password
community.mysql.mysql_info:
@@ -38,6 +38,3 @@
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
filter: version
when:
- db_info is succeeded
- change_info is succeeded

View File

@@ -1,7 +1,13 @@
id: change_secret_mysql
name: Change secret for MySQL
name: "{{ 'MySQL account change secret' | trans }}"
category: database
type:
- mysql
- mariadb
method: change_secret
i18n:
MySQL account change secret:
zh: 使用 Ansible 模块 mysql 执行 MySQL 账号改密
ja: Ansible mysql モジュールを使用して MySQL アカウントのパスワード変更
en: Using Ansible module mysql to change MySQL account secret

View File

@@ -29,8 +29,8 @@
mode: "{{ jms_account.mode }}"
name: "{{ account.username }}"
password: "{{ account.secret }}"
ignore_errors: true
when: db_info is succeeded
register: change_info
- name: Verify password
oracle_ping:
@@ -39,6 +39,3 @@
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_database: "{{ jms_asset.spec_info.db_name }}"
when:
- db_info is succeeded
- change_info is succeeded

View File

@@ -1,6 +1,11 @@
id: change_secret_oracle
name: Change secret for Oracle
name: "{{ 'Oracle account change secret' | trans }}"
category: database
type:
- oracle
method: change_secret
i18n:
Oracle account change secret:
zh: Oracle 账号改密
ja: Oracle アカウントのパスワード変更

View File

@@ -29,8 +29,8 @@
name: "{{ account.username }}"
password: "{{ account.secret }}"
role_attr_flags: LOGIN
ignore_errors: true
when: result is succeeded
register: change_info
- name: Verify password
community.postgresql.postgresql_ping:
@@ -39,8 +39,3 @@
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
db: "{{ jms_asset.spec_info.db_name }}"
when:
- result is succeeded
- change_info is succeeded
register: result
failed_when: not result.is_available

View File

@@ -1,6 +1,11 @@
id: change_secret_postgresql
name: Change secret for PostgreSQL
name: "{{ 'PostgreSQL account change secret' | trans }}"
category: database
type:
- postgresql
method: change_secret
i18n:
PostgreSQL account change secret:
zh: PostgreSQL 账号改密
ja: PostgreSQL アカウントのパスワード変更

View File

@@ -41,8 +41,8 @@
login_port: "{{ jms_asset.port }}"
name: '{{ jms_asset.spec_info.db_name }}'
script: "ALTER LOGIN {{ account.username }} WITH PASSWORD = '{{ account.secret }}'; select @@version"
ignore_errors: true
when: user_exist.query_results[0] | length != 0
register: change_info
- name: Add SQLServer user
community.general.mssql_script:
@@ -52,8 +52,8 @@
login_port: "{{ jms_asset.port }}"
name: '{{ jms_asset.spec_info.db_name }}'
script: "CREATE LOGIN {{ account.username }} WITH PASSWORD = '{{ account.secret }}'; select @@version"
ignore_errors: true
when: user_exist.query_results[0] | length == 0
register: change_info
- name: Verify password
community.general.mssql_script:
@@ -64,6 +64,3 @@
name: '{{ jms_asset.spec_info.db_name }}'
script: |
SELECT @@version
when:
- db_info is succeeded
- change_info is succeeded

View File

@@ -1,6 +1,11 @@
id: change_secret_sqlserver
name: Change secret for SQLServer
name: "{{ 'SQLServer account change secret' | trans }}"
category: database
type:
- sqlserver
method: change_secret
i18n:
SQLServer account change secret:
zh: SQLServer 账号改密
ja: SQLServer アカウントのパスワード変更

View File

@@ -1,54 +1,92 @@
- hosts: demo
gather_facts: no
tasks:
- name: Test privileged account
- name: "Test privileged {{ jms_account.username }} account"
ansible.builtin.ping:
- name: Change password
- name: "Check if {{ account.username }} user exists"
getent:
database: passwd
key: "{{ account.username }}"
register: user_info
ignore_errors: yes # 忽略错误如果用户不存在时不会导致playbook失败
- name: "Add {{ account.username }} user"
ansible.builtin.user:
name: "{{ account.username }}"
shell: "{{ params.shell }}"
home: "{{ params.home | default('/home/' + account.username, true) }}"
groups: "{{ params.groups }}"
expires: -1
state: present
when: user_info.failed
- name: "Add {{ account.username }} group"
ansible.builtin.group:
name: "{{ account.username }}"
state: present
when: user_info.failed
- name: "Add {{ account.username }} user to group"
ansible.builtin.user:
name: "{{ account.username }}"
groups: "{{ params.groups }}"
when:
- user_info.failed
- params.groups
- name: "Change {{ account.username }} password"
ansible.builtin.user:
name: "{{ account.username }}"
password: "{{ account.secret | password_hash('des') }}"
update_password: always
when: secret_type == "password"
- name: create user If it already exists, no operation will be performed
ansible.builtin.user:
name: "{{ account.username }}"
when: secret_type == "ssh_key"
ignore_errors: true
when: account.secret_type == "password"
- name: remove jumpserver ssh key
ansible.builtin.lineinfile:
dest: "{{ kwargs.dest }}"
regexp: "{{ kwargs.regexp }}"
dest: "{{ ssh_params.dest }}"
regexp: "{{ ssh_params.regexp }}"
state: absent
when:
- secret_type == "ssh_key"
- kwargs.strategy == "set_jms"
- account.secret_type == "ssh_key"
- ssh_params.strategy == "set_jms"
- name: Change SSH key
- name: "Change {{ account.username }} SSH key"
ansible.builtin.authorized_key:
user: "{{ account.username }}"
key: "{{ account.secret }}"
exclusive: "{{ kwargs.exclusive }}"
when: secret_type == "ssh_key"
exclusive: "{{ ssh_params.exclusive }}"
when: account.secret_type == "ssh_key"
- name: "Set {{ account.username }} sudo setting"
ansible.builtin.lineinfile:
dest: /etc/sudoers
state: present
regexp: "^{{ account.username }} ALL="
line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}"
validate: visudo -cf %s
when:
- user_info.failed
- params.sudo
- name: Refresh connection
ansible.builtin.meta: reset_connection
- name: Verify password
- name: "Verify {{ account.username }} password"
ansible.builtin.ping:
become: no
vars:
ansible_user: "{{ account.username }}"
ansible_password: "{{ account.secret }}"
ansible_become: no
when: secret_type == "password"
when: account.secret_type == "password"
- name: Verify SSH key
- name: "Verify {{ account.username }} SSH key"
ansible.builtin.ping:
become: no
vars:
ansible_user: "{{ account.username }}"
ansible_ssh_private_key_file: "{{ account.private_key_path }}"
ansible_become: no
when: secret_type == "ssh_key"
when: account.secret_type == "ssh_key"

View File

@@ -1,6 +1,61 @@
id: change_secret_aix
name: Change secret for aix
name: "{{ 'AIX account change secret' | trans }}"
category: host
type:
- AIX
method: change_secret
params:
- name: sudo
type: str
label: 'Sudo'
default: '/bin/whoami'
help_text: '使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig'
- name: shell
type: str
label: 'Shell'
default: '/bin/bash'
- name: home
type: str
label: "{{ 'Params home label' | trans }}"
default: ''
help_text: "{{ 'Params home help text' | trans }}"
- name: groups
type: str
label: "{{ 'Params groups label' | trans }}"
default: ''
help_text: "{{ 'Params groups help text' | trans }}"
i18n:
AIX account change secret:
zh: '使用 Ansible 模块 user 执行账号改密 (DES)'
ja: 'Ansible user モジュールを使用してアカウントのパスワード変更 (DES)'
en: 'Using Ansible module user to change account secret (DES)'
Params sudo help text:
zh: '使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig'
ja: 'コンマで区切って複数のコマンドを入力してください。例: /bin/whoami,/sbin/ifconfig'
en: 'Use commas to separate multiple commands, such as: /bin/whoami,/sbin/ifconfig'
Params home help text:
zh: '默认家目录 /home/{账号用户名}'
ja: 'デフォルトのホームディレクトリ /home/{アカウントユーザ名}'
en: 'Default home directory /home/{account username}'
Params groups help text:
zh: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)'
ja: 'グループを入力してください。複数のグループはコンマで区切ってください(既存のグループを入力してください)'
en: 'Please enter the group. Multiple groups are separated by commas (please enter the existing group)'
Params home label:
zh: '家目录'
ja: 'ホームディレクトリ'
en: 'Home'
Params groups label:
zh: '用户组'
ja: 'グループ'
en: 'Groups'

View File

@@ -1,54 +1,92 @@
- hosts: demo
gather_facts: no
tasks:
- name: Test privileged account
- name: "Test privileged {{ jms_account.username }} account"
ansible.builtin.ping:
- name: Change password
- name: "Check if {{ account.username }} user exists"
getent:
database: passwd
key: "{{ account.username }}"
register: user_info
ignore_errors: yes # 忽略错误如果用户不存在时不会导致playbook失败
- name: "Add {{ account.username }} user"
ansible.builtin.user:
name: "{{ account.username }}"
shell: "{{ params.shell }}"
home: "{{ params.home | default('/home/' + account.username, true) }}"
groups: "{{ params.groups }}"
expires: -1
state: present
when: user_info.failed
- name: "Add {{ account.username }} group"
ansible.builtin.group:
name: "{{ account.username }}"
state: present
when: user_info.failed
- name: "Add {{ account.username }} user to group"
ansible.builtin.user:
name: "{{ account.username }}"
groups: "{{ params.groups }}"
when:
- user_info.failed
- params.groups
- name: "Change {{ account.username }} password"
ansible.builtin.user:
name: "{{ account.username }}"
password: "{{ account.secret | password_hash('sha512') }}"
update_password: always
when: secret_type == "password"
- name: create user If it already exists, no operation will be performed
ansible.builtin.user:
name: "{{ account.username }}"
when: secret_type == "ssh_key"
ignore_errors: true
when: account.secret_type == "password"
- name: remove jumpserver ssh key
ansible.builtin.lineinfile:
dest: "{{ kwargs.dest }}"
regexp: "{{ kwargs.regexp }}"
dest: "{{ ssh_params.dest }}"
regexp: "{{ ssh_params.regexp }}"
state: absent
when:
- secret_type == "ssh_key"
- kwargs.strategy == "set_jms"
- account.secret_type == "ssh_key"
- ssh_params.strategy == "set_jms"
- name: Change SSH key
- name: "Change {{ account.username }} SSH key"
ansible.builtin.authorized_key:
user: "{{ account.username }}"
key: "{{ account.secret }}"
exclusive: "{{ kwargs.exclusive }}"
when: secret_type == "ssh_key"
exclusive: "{{ ssh_params.exclusive }}"
when: account.secret_type == "ssh_key"
- name: "Set {{ account.username }} sudo setting"
ansible.builtin.lineinfile:
dest: /etc/sudoers
state: present
regexp: "^{{ account.username }} ALL="
line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}"
validate: visudo -cf %s
when:
- user_info.failed
- params.sudo
- name: Refresh connection
ansible.builtin.meta: reset_connection
- name: Verify password
- name: "Verify {{ account.username }} password"
ansible.builtin.ping:
become: no
vars:
ansible_user: "{{ account.username }}"
ansible_password: "{{ account.secret }}"
ansible_become: no
when: secret_type == "password"
when: account.secret_type == "password"
- name: Verify SSH key
- name: "Verify {{ account.username }} SSH key"
ansible.builtin.ping:
become: no
vars:
ansible_user: "{{ account.username }}"
ansible_ssh_private_key_file: "{{ account.private_key_path }}"
ansible_become: no
when: secret_type == "ssh_key"
when: account.secret_type == "ssh_key"

View File

@@ -1,7 +1,63 @@
id: change_secret_posix
name: Change secret for posix
name: "{{ 'Posix account change secret' | trans }}"
category: host
type:
- unix
- linux
method: change_secret
params:
- name: sudo
type: str
label: 'Sudo'
default: '/bin/whoami'
help_text: '使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig'
- name: shell
type: str
label: 'Shell'
default: '/bin/bash'
help_text: ''
- name: home
type: str
label: "{{ 'Params home label' | trans }}"
default: ''
help_text: "{{ 'Params home help text' | trans }}"
- name: groups
type: str
label: "{{ 'Params groups label' | trans }}"
default: ''
help_text: "{{ 'Params groups help text' | trans }}"
i18n:
Posix account change secret:
zh: '使用 Ansible 模块 user 执行账号改密 (SHA512)'
ja: 'Ansible user モジュールを使用して アカウントのパスワード変更 (SHA512)'
en: 'Using Ansible module user to change account secret (SHA512)'
Params sudo help text:
zh: '使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig'
ja: 'コンマで区切って複数のコマンドを入力してください。例: /bin/whoami,/sbin/ifconfig'
en: 'Use commas to separate multiple commands, such as: /bin/whoami,/sbin/ifconfig'
Params home help text:
zh: '默认家目录 /home/{账号用户名}'
ja: 'デフォルトのホームディレクトリ /home/{アカウントユーザ名}'
en: 'Default home directory /home/{account username}'
Params groups help text:
zh: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)'
ja: 'グループを入力してください。複数のグループはコンマで区切ってください(既存のグループを入力してください)'
en: 'Please enter the group. Multiple groups are separated by commas (please enter the existing group)'
Params home label:
zh: '家目录'
ja: 'ホームディレクトリ'
en: 'Home'
Params groups label:
zh: '用户组'
ja: 'グループ'
en: 'Groups'

View File

@@ -8,19 +8,16 @@
# debug:
# msg: "Username: {{ account.username }}, Password: {{ account.secret }}"
- name: Get groups of a Windows user
ansible.windows.win_user:
name: "{{ jms_account.username }}"
register: user_info
- name: Change password
ansible.windows.win_user:
fullname: "{{ account.username}}"
name: "{{ account.username }}"
password: "{{ account.secret }}"
groups: "{{ user_info.groups[0].name }}"
password_never_expires: yes
groups: "{{ params.groups }}"
groups_action: add
update_password: always
ignore_errors: true
when: account.secret_type == "password"
- name: Refresh connection

View File

@@ -1,7 +1,26 @@
id: change_secret_local_windows
name: Change secret local account for Windows
name: "{{ 'Windows account change secret' | trans }}"
version: 1
method: change_secret
category: host
type:
- windows
params:
- name: groups
type: str
label: '用户组'
default: 'Users,Remote Desktop Users'
help_text: "{{ 'Params groups help text' | trans }}"
i18n:
Windows account change secret:
zh: '使用 Ansible 模块 win_user 执行 Windows 账号改密'
ja: 'Ansible win_user モジュールを使用して Windows アカウントのパスワード変更'
en: 'Using Ansible module win_user to change Windows account secret'
Params groups help text:
zh: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)'
ja: 'グループを入力してください。複数のグループはコンマで区切ってください(既存のグループを入力してください)'
en: 'Please enter the group. Multiple groups are separated by commas (please enter the existing group)'

View File

@@ -12,7 +12,7 @@ from accounts.models import ChangeSecretRecord
from accounts.notifications import ChangeSecretExecutionTaskMsg
from accounts.serializers import ChangeSecretRecordBackUpSerializer
from assets.const import HostTypes
from common.utils import get_logger, lazyproperty
from common.utils import get_logger
from common.utils.file import encrypt_and_compress_zip_file
from common.utils.timezone import local_now_display
from users.models import User
@@ -28,23 +28,23 @@ class ChangeSecretManager(AccountBasePlaybookManager):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.method_hosts_mapper = defaultdict(list)
self.secret_type = self.execution.snapshot['secret_type']
self.secret_type = self.execution.snapshot.get('secret_type')
self.secret_strategy = self.execution.snapshot.get(
'secret_strategy', SecretStrategy.custom
)
self.ssh_key_change_strategy = self.execution.snapshot.get(
'ssh_key_change_strategy', SSHKeyStrategy.add
)
self.snapshot_account_usernames = self.execution.snapshot['accounts']
self.account_ids = self.execution.snapshot['accounts']
self.name_recorder_mapper = {} # 做个映射,方便后面处理
@classmethod
def method_type(cls):
return AutomationTypes.change_secret
def get_kwargs(self, account, secret):
def get_ssh_params(self, account, secret, secret_type):
kwargs = {}
if self.secret_type != SecretType.SSH_KEY:
if secret_type != SecretType.SSH_KEY:
return kwargs
kwargs['strategy'] = self.ssh_key_change_strategy
kwargs['exclusive'] = 'yes' if kwargs['strategy'] == SSHKeyStrategy.set else 'no'
@@ -54,18 +54,34 @@ class ChangeSecretManager(AccountBasePlaybookManager):
kwargs['regexp'] = '.*{}$'.format(secret.split()[2].strip())
return kwargs
@lazyproperty
def secret_generator(self):
def secret_generator(self, secret_type):
return SecretGenerator(
self.secret_strategy, self.secret_type,
self.secret_strategy, secret_type,
self.execution.snapshot.get('password_rules')
)
def get_secret(self):
def get_secret(self, secret_type):
if self.secret_strategy == SecretStrategy.custom:
return self.execution.snapshot['secret']
else:
return self.secret_generator.get_secret()
return self.secret_generator(secret_type).get_secret()
def get_accounts(self, privilege_account):
if not privilege_account:
print(f'not privilege account')
return []
asset = privilege_account.asset
accounts = asset.accounts.all()
accounts = accounts.filter(id__in=self.account_ids)
if self.secret_type:
accounts = accounts.filter(secret_type=self.secret_type)
if settings.CHANGE_AUTH_PLAN_SECURE_MODE_ENABLED:
accounts = accounts.filter(privileged=False).exclude(
username__in=['root', 'administrator', privilege_account.username]
)
return accounts
def host_callback(
self, host, asset=None, account=None,
@@ -78,17 +94,10 @@ class ChangeSecretManager(AccountBasePlaybookManager):
if host.get('error'):
return host
accounts = asset.accounts.all()
if account:
accounts = accounts.exclude(username=account.username)
if '*' not in self.snapshot_account_usernames:
accounts = accounts.filter(username__in=self.snapshot_account_usernames)
accounts = accounts.filter(secret_type=self.secret_type)
accounts = self.get_accounts(account)
if not accounts:
print('没有发现待改密账号: %s 用户: %s 类型: %s' % (
asset.name, self.snapshot_account_usernames, self.secret_type
print('没有发现待改密账号: %s 用户ID: %s 类型: %s' % (
asset.name, self.account_ids, self.secret_type
))
return []
@@ -97,16 +106,17 @@ class ChangeSecretManager(AccountBasePlaybookManager):
method_hosts = [h for h in method_hosts if h != host['name']]
inventory_hosts = []
records = []
host['secret_type'] = self.secret_type
if asset.type == HostTypes.WINDOWS and self.secret_type == SecretType.SSH_KEY:
print(f'Windows {asset} does not support ssh key push \n')
print(f'Windows {asset} does not support ssh key push')
return inventory_hosts
host['ssh_params'] = {}
for account in accounts:
h = deepcopy(host)
secret_type = account.secret_type
h['name'] += '(' + account.username + ')'
new_secret = self.get_secret()
new_secret = self.get_secret(secret_type)
recorder = ChangeSecretRecord(
asset=asset, account=account, execution=self.execution,
@@ -116,15 +126,15 @@ class ChangeSecretManager(AccountBasePlaybookManager):
self.name_recorder_mapper[h['name']] = recorder
private_key_path = None
if self.secret_type == SecretType.SSH_KEY:
if secret_type == SecretType.SSH_KEY:
private_key_path = self.generate_private_key_path(new_secret, path_dir)
new_secret = self.generate_public_key(new_secret)
h['kwargs'] = self.get_kwargs(account, new_secret)
h['ssh_params'].update(self.get_ssh_params(account, new_secret, secret_type))
h['account'] = {
'name': account.name,
'username': account.username,
'secret_type': account.secret_type,
'secret_type': secret_type,
'secret': new_secret,
'private_key_path': private_key_path
}
@@ -206,7 +216,7 @@ class ChangeSecretManager(AccountBasePlaybookManager):
serializer = serializer_cls(recorders, many=True)
header = [str(v.label) for v in serializer.child.fields.values()]
rows = [list(row.values()) for row in serializer.data]
rows = [[str(i) for i in row.values()] for row in serializer.data]
if not rows:
return False

View File

@@ -1,6 +1,11 @@
id: gather_accounts_mongodb
name: Gather account from MongoDB
name: "{{ 'MongoDB account gather' | trans }}"
category: database
type:
- mongodb
method: gather_accounts
i18n:
MongoDB account gather:
zh: MongoDB 账号收集
ja: MongoDB アカウントの収集

View File

@@ -1,7 +1,12 @@
id: gather_accounts_mysql
name: Gather account from MySQL
name: "{{ 'MySQL account gather' | trans }}"
category: database
type:
- mysql
- mariadb
method: gather_accounts
i18n:
MySQL account gather:
zh: MySQL 账号收集
ja: MySQL アカウントの収集

View File

@@ -1,6 +1,11 @@
id: gather_accounts_oracle
name: Gather account from Oracle
name: "{{ 'Oracle account gather' | trans }}"
category: database
type:
- oracle
method: gather_accounts
i18n:
Oracle account gather:
zh: Oracle 账号收集
ja: Oracle アカウントの収集

View File

@@ -1,6 +1,11 @@
id: gather_accounts_postgresql
name: Gather account for PostgreSQL
name: "{{ 'PostgreSQL account gather' | trans }}"
category: database
type:
- postgresql
method: gather_accounts
i18n:
PostgreSQL account gather:
zh: PostgreSQL 账号收集
ja: PostgreSQL アカウントの収集

View File

@@ -1,3 +1,5 @@
import re
from django.utils import timezone
__all__ = ['GatherAccountsFilter']
@@ -13,8 +15,8 @@ class GatherAccountsFilter:
def mysql_filter(info):
result = {}
for _, user_dict in info.items():
for username, data in user_dict.items():
if data.get('account_locked') == 'N':
for username, _ in user_dict.items():
if len(username.split('.')) == 1:
result[username] = {}
return result
@@ -27,18 +29,25 @@ class GatherAccountsFilter:
@staticmethod
def posix_filter(info):
username_pattern = re.compile(r'^(\S+)')
ip_pattern = re.compile(r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})')
login_time_pattern = re.compile(r'\w{3} \d{2} \d{2}:\d{2}:\d{2} \d{4}')
result = {}
for line in info:
data = line.split('@')
if len(data) == 1:
result[line] = {}
usernames = username_pattern.findall(line)
username = ''.join(usernames)
if username:
result[username] = {}
else:
continue
if len(data) != 3:
continue
username, address, dt = data
date = timezone.datetime.strptime(f'{dt} +0800', '%b %d %H:%M:%S %Y %z')
result[username] = {'address': address, 'date': date}
ip_addrs = ip_pattern.findall(line)
ip_addr = ''.join(ip_addrs)
if ip_addr:
result[username].update({'address': ip_addr})
login_times = login_time_pattern.findall(line)
if login_times:
date = timezone.datetime.strptime(f'{login_times[0]} +0800', '%b %d %H:%M:%S %Y %z')
result[username].update({'date': date})
return result
@staticmethod
@@ -60,4 +69,6 @@ class GatherAccountsFilter:
if not run_method_name:
return info
return getattr(self, f'{run_method_name}_filter')(info)
if hasattr(self, f'{run_method_name}_filter'):
return getattr(self, f'{run_method_name}_filter')(info)
return info

View File

@@ -5,7 +5,7 @@
ansible.builtin.shell:
cmd: >
users=$(getent passwd | grep -v nologin | grep -v shutdown | awk -F":" '{ print $1 }');for i in $users;
do k=$(last -w -F $i -1 | head -1 | grep -v ^$ | awk '{ print $1"@"$3"@"$5,$6,$7,$8 }')
do k=$(last -w -F $i -1 | head -1 | grep -v ^$ | awk '{ print $0 }')
if [ -n "$k" ]; then
echo $k
else

View File

@@ -1,7 +1,13 @@
id: gather_accounts_posix
name: Gather posix account
name: "{{ 'Posix account gather' | trans }}"
category: host
type:
- linux
- unix
method: gather_accounts
i18n:
Posix account gather:
zh: 使用命令 getent passwd 收集 Posix 资产账号
ja: コマンド getent を使用してアセットアカウントを収集する
en: Using command getent to gather accounts

View File

@@ -1,7 +1,13 @@
id: gather_accounts_windows
name: Gather account windows
name: "{{ 'Windows account gather' | trans }}"
version: 1
method: gather_accounts
category: host
type:
- windows
i18n:
Windows account gather:
zh: 使用命令 net user 收集 Windows 账号
ja: コマンド net user を使用して Windows アカウントを収集する
en: Using command net user to gather accounts

View File

@@ -12,6 +12,7 @@ class GatherAccountsManager(AccountBasePlaybookManager):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.host_asset_mapper = {}
self.is_sync_account = self.execution.snapshot.get('is_sync_account')
@classmethod
def method_type(cls):
@@ -22,29 +23,41 @@ class GatherAccountsManager(AccountBasePlaybookManager):
self.host_asset_mapper[host['name']] = asset
return host
def filter_success_result(self, host, result):
result = GatherAccountsFilter(host).run(self.method_id_meta_mapper, result)
def filter_success_result(self, tp, result):
result = GatherAccountsFilter(tp).run(self.method_id_meta_mapper, result)
return result
@staticmethod
def update_or_create_gathered_accounts(asset, result):
def generate_data(asset, result):
data = []
for username, info in result.items():
d = {'asset': asset, 'username': username, 'present': True}
if info.get('date'):
d['date_last_login'] = info['date']
if info.get('address'):
d['address_last_login'] = info['address'][:32]
data.append(d)
return data
def update_or_create_accounts(self, asset, result):
data = self.generate_data(asset, result)
with tmp_to_org(asset.org_id):
gathered_accounts = []
GatheredAccount.objects.filter(asset=asset, present=True).update(present=False)
for username, data in result.items():
d = {'asset': asset, 'username': username, 'present': True}
if data.get('date'):
d['date_last_login'] = data['date']
if data.get('address'):
d['address_last_login'] = data['address'][:32]
GatheredAccount.objects.update_or_create(
for d in data:
username = d['username']
gathered_account, __ = GatheredAccount.objects.update_or_create(
defaults=d, asset=asset, username=username,
)
gathered_accounts.append(gathered_account)
if not self.is_sync_account:
return
GatheredAccount.sync_accounts(gathered_accounts)
def on_host_success(self, host, result):
info = result.get('debug', {}).get('res', {}).get('info', {})
asset = self.host_asset_mapper.get(host)
if asset and info:
result = self.filter_success_result(asset.type, info)
self.update_or_create_gathered_accounts(asset, result)
self.update_or_create_accounts(asset, result)
else:
logger.error("Not found info".format(host))

View File

@@ -1,30 +1,6 @@
import os
import copy
from accounts.const import AutomationTypes
from assets.automations.methods import get_platform_automation_methods
def copy_change_secret_to_push_account(methods):
push_account = AutomationTypes.push_account
change_secret = AutomationTypes.change_secret
copy_methods = copy.deepcopy(methods)
for method in copy_methods:
if not method['id'].startswith(change_secret):
continue
copy_method = copy.deepcopy(method)
copy_method['method'] = push_account.value
copy_method['id'] = copy_method['id'].replace(
change_secret, push_account
)
copy_method['name'] = copy_method['name'].replace(
'Change secret', 'Push account'
)
methods.append(copy_method)
return methods
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
automation_methods = get_platform_automation_methods(BASE_DIR)
platform_automation_methods = copy_change_secret_to_push_account(automation_methods)
platform_automation_methods = get_platform_automation_methods(BASE_DIR)

View File

@@ -0,0 +1,55 @@
- hosts: mongodb
gather_facts: no
vars:
ansible_python_interpreter: /usr/local/bin/python
tasks:
- name: Test MongoDB connection
mongodb_ping:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_database: "{{ jms_asset.spec_info.db_name }}"
ssl: "{{ jms_asset.spec_info.use_ssl }}"
ssl_ca_certs: "{{ jms_asset.secret_info.ca_cert }}"
ssl_certfile: "{{ jms_asset.secret_info.client_key }}"
connection_options:
- tlsAllowInvalidHostnames: "{{ jms_asset.spec_info.allow_invalid_cert}}"
register: db_info
- name: Display MongoDB version
debug:
var: db_info.server_version
when: db_info is succeeded
- name: Change MongoDB password
mongodb_user:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_database: "{{ jms_asset.spec_info.db_name }}"
ssl: "{{ jms_asset.spec_info.use_ssl }}"
ssl_ca_certs: "{{ jms_asset.secret_info.ca_cert }}"
ssl_certfile: "{{ jms_asset.secret_info.client_key }}"
connection_options:
- tlsAllowInvalidHostnames: "{{ jms_asset.spec_info.allow_invalid_cert}}"
db: "{{ jms_asset.spec_info.db_name }}"
name: "{{ account.username }}"
password: "{{ account.secret }}"
ignore_errors: true
when: db_info is succeeded
- name: Verify password
mongodb_ping:
login_user: "{{ account.username }}"
login_password: "{{ account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_database: "{{ jms_asset.spec_info.db_name }}"
ssl: "{{ jms_asset.spec_info.use_ssl }}"
ssl_ca_certs: "{{ jms_asset.secret_info.ca_cert }}"
ssl_certfile: "{{ jms_asset.secret_info.client_key }}"
connection_options:
- tlsAllowInvalidHostnames: "{{ jms_asset.spec_info.allow_invalid_cert}}"

View File

@@ -0,0 +1,12 @@
id: push_account_mongodb
name: "{{ 'MongoDB account push' | trans }}"
category: database
type:
- mongodb
method: push_account
i18n:
MongoDB account push:
zh: 使用 Ansible 模块 mongodb 执行 MongoDB 账号推送
ja: Ansible mongodb モジュールを使用してアカウントをプッシュする
en: Using Ansible module mongodb to push account

View File

@@ -0,0 +1,40 @@
- hosts: mysql
gather_facts: no
vars:
ansible_python_interpreter: /usr/local/bin/python
db_name: "{{ jms_asset.spec_info.db_name }}"
tasks:
- name: Test MySQL connection
community.mysql.mysql_info:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
filter: version
register: db_info
- name: MySQL version
debug:
var: db_info.version.full
- name: Change MySQL password
community.mysql.mysql_user:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
name: "{{ account.username }}"
password: "{{ account.secret }}"
host: "%"
priv: "{{ account.username + '.*:USAGE' if db_name == '' else db_name + '.*:ALL' }}"
ignore_errors: true
when: db_info is succeeded
- name: Verify password
community.mysql.mysql_info:
login_user: "{{ account.username }}"
login_password: "{{ account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
filter: version

View File

@@ -0,0 +1,13 @@
id: push_account_mysql
name: "{{ 'MySQL account push' | trans }}"
category: database
type:
- mysql
- mariadb
method: push_account
i18n:
MySQL account push:
zh: 使用 Ansible 模块 mysql 执行 MySQL 账号推送
ja: Ansible mysql モジュールを使用してアカウントをプッシュする
en: Using Ansible module mysql to push account

View File

@@ -0,0 +1,41 @@
- hosts: oracle
gather_facts: no
vars:
ansible_python_interpreter: /usr/local/bin/python
tasks:
- name: Test Oracle connection
oracle_ping:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_database: "{{ jms_asset.spec_info.db_name }}"
mode: "{{ jms_account.mode }}"
register: db_info
- name: Display Oracle version
debug:
var: db_info.server_version
when: db_info is succeeded
- name: Change Oracle password
oracle_user:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_database: "{{ jms_asset.spec_info.db_name }}"
mode: "{{ jms_account.mode }}"
name: "{{ account.username }}"
password: "{{ account.secret }}"
ignore_errors: true
when: db_info is succeeded
- name: Verify password
oracle_ping:
login_user: "{{ account.username }}"
login_password: "{{ account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_database: "{{ jms_asset.spec_info.db_name }}"

View File

@@ -0,0 +1,12 @@
id: push_account_oracle
name: "{{ 'Oracle account push' | trans }}"
category: database
type:
- oracle
method: push_account
i18n:
Oracle account push:
zh: 使用 Python 模块 oracledb 执行 Oracle 账号推送
ja: Python oracledb モジュールを使用してアカウントをプッシュする
en: Using Python module oracledb to push account

View File

@@ -0,0 +1,44 @@
- hosts: postgre
gather_facts: no
vars:
ansible_python_interpreter: /usr/local/bin/python
tasks:
- name: Test PostgreSQL connection
community.postgresql.postgresql_ping:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_db: "{{ jms_asset.spec_info.db_name }}"
register: result
failed_when: not result.is_available
- name: Display PostgreSQL version
debug:
var: result.server_version.full
when: result is succeeded
- name: Change PostgreSQL password
community.postgresql.postgresql_user:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
db: "{{ jms_asset.spec_info.db_name }}"
name: "{{ account.username }}"
password: "{{ account.secret }}"
role_attr_flags: LOGIN
ignore_errors: true
when: result is succeeded
- name: Verify password
community.postgresql.postgresql_ping:
login_user: "{{ account.username }}"
login_password: "{{ account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
db: "{{ jms_asset.spec_info.db_name }}"
when:
- result is succeeded
- change_info is succeeded

View File

@@ -0,0 +1,12 @@
id: push_account_postgresql
name: "{{ 'PostgreSQL account push' | trans }}"
category: database
type:
- postgresql
method: push_account
i18n:
PostgreSQL account push:
zh: 使用 Ansible 模块 postgresql 执行 PostgreSQL 账号推送
ja: Ansible postgresql モジュールを使用してアカウントをプッシュする
en: Using Ansible module postgresql to push account

View File

@@ -0,0 +1,68 @@
- hosts: sqlserver
gather_facts: no
vars:
ansible_python_interpreter: /usr/local/bin/python
tasks:
- name: Test SQLServer connection
community.general.mssql_script:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
name: '{{ jms_asset.spec_info.db_name }}'
script: |
SELECT @@version
register: db_info
- name: SQLServer version
set_fact:
info:
version: "{{ db_info.query_results[0][0][0][0].splitlines()[0] }}"
- debug:
var: info
- name: Check whether SQLServer User exist
community.general.mssql_script:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
name: '{{ jms_asset.spec_info.db_name }}'
script: "SELECT 1 from sys.sql_logins WHERE name='{{ account.username }}';"
when: db_info is succeeded
register: user_exist
- name: Change SQLServer password
community.general.mssql_script:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
name: '{{ jms_asset.spec_info.db_name }}'
script: "ALTER LOGIN {{ account.username }} WITH PASSWORD = '{{ account.secret }}'; select @@version"
ignore_errors: true
when: user_exist.query_results[0] | length != 0
register: change_info
- name: Add SQLServer user
community.general.mssql_script:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
name: '{{ jms_asset.spec_info.db_name }}'
script: "CREATE LOGIN {{ account.username }} WITH PASSWORD = '{{ account.secret }}'; select @@version"
ignore_errors: true
when: user_exist.query_results[0] | length == 0
register: change_info
- name: Verify password
community.general.mssql_script:
login_user: "{{ account.username }}"
login_password: "{{ account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
name: '{{ jms_asset.spec_info.db_name }}'
script: |
SELECT @@version

View File

@@ -0,0 +1,12 @@
id: push_account_sqlserver
name: "{{ 'SQLServer account push' | trans }}"
category: database
type:
- sqlserver
method: push_account
i18n:
SQLServer account push:
zh: 使用 Ansible 模块 mssql 执行 SQLServer 账号推送
ja: Ansible mssql モジュールを使用してアカウントをプッシュする
en: Using Ansible module mssql to push account

View File

@@ -0,0 +1,80 @@
- hosts: demo
gather_facts: no
tasks:
- name: Test privileged account
ansible.builtin.ping:
- name: Push user
ansible.builtin.user:
name: "{{ account.username }}"
shell: "{{ params.shell }}"
home: "{{ params.home | default('/home/' + account.username, true) }}"
groups: "{{ params.groups }}"
expires: -1
state: present
- name: "Add {{ account.username }} group"
ansible.builtin.group:
name: "{{ account.username }}"
state: present
- name: Add user groups
ansible.builtin.user:
name: "{{ account.username }}"
groups: "{{ params.groups }}"
when: params.groups
- name: Push user password
ansible.builtin.user:
name: "{{ account.username }}"
password: "{{ account.secret | password_hash('sha512') }}"
update_password: always
ignore_errors: true
when: account.secret_type == "password"
- name: remove jumpserver ssh key
ansible.builtin.lineinfile:
dest: "{{ ssh_params.dest }}"
regexp: "{{ ssh_params.regexp }}"
state: absent
when:
- account.secret_type == "ssh_key"
- ssh_params.strategy == "set_jms"
- name: Push SSH key
ansible.builtin.authorized_key:
user: "{{ account.username }}"
key: "{{ account.secret }}"
exclusive: "{{ ssh_params.exclusive }}"
when: account.secret_type == "ssh_key"
- name: Set sudo setting
ansible.builtin.lineinfile:
dest: /etc/sudoers
state: present
regexp: "^{{ account.username }} ALL="
line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}"
validate: visudo -cf %s
when:
- params.sudo
- name: Refresh connection
ansible.builtin.meta: reset_connection
- name: Verify password
ansible.builtin.ping:
become: no
vars:
ansible_user: "{{ account.username }}"
ansible_password: "{{ account.secret }}"
ansible_become: no
when: account.secret_type == "password"
- name: Verify SSH key
ansible.builtin.ping:
become: no
vars:
ansible_user: "{{ account.username }}"
ansible_ssh_private_key_file: "{{ account.private_key_path }}"
ansible_become: no
when: account.secret_type == "ssh_key"

View File

@@ -0,0 +1,36 @@
id: push_account_aix
name: "{{ 'Aix account push' | trans }}"
category: host
type:
- AIX
method: push_account
params:
- name: sudo
type: str
label: 'Sudo'
default: '/bin/whoami'
help_text: '使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig'
- name: shell
type: str
label: 'Shell'
default: '/bin/bash'
- name: home
type: str
label: '家目录'
default: ''
help_text: '默认家目录 /home/系统用户名: /home/username'
- name: groups
type: str
label: '用户组'
default: ''
help_text: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)'
i18n:
Aix account push:
zh: 使用 Ansible 模块 user 执行 Aix 账号推送 (DES)
ja: Ansible user モジュールを使用して Aix アカウントをプッシュする (DES)
en: Using Ansible module user to push account (DES)

View File

@@ -0,0 +1,80 @@
- hosts: demo
gather_facts: no
tasks:
- name: Test privileged account
ansible.builtin.ping:
- name: Push user
ansible.builtin.user:
name: "{{ account.username }}"
shell: "{{ params.shell }}"
home: "{{ params.home | default('/home/' + account.username, true) }}"
groups: "{{ params.groups }}"
expires: -1
state: present
- name: "Add {{ account.username }} group"
ansible.builtin.group:
name: "{{ account.username }}"
state: present
- name: Add user groups
ansible.builtin.user:
name: "{{ account.username }}"
groups: "{{ params.groups }}"
when: params.groups
- name: Push user password
ansible.builtin.user:
name: "{{ account.username }}"
password: "{{ account.secret | password_hash('sha512') }}"
update_password: always
ignore_errors: true
when: account.secret_type == "password"
- name: remove jumpserver ssh key
ansible.builtin.lineinfile:
dest: "{{ ssh_params.dest }}"
regexp: "{{ ssh_params.regexp }}"
state: absent
when:
- account.secret_type == "ssh_key"
- ssh_params.strategy == "set_jms"
- name: Push SSH key
ansible.builtin.authorized_key:
user: "{{ account.username }}"
key: "{{ account.secret }}"
exclusive: "{{ ssh_params.exclusive }}"
when: account.secret_type == "ssh_key"
- name: Set sudo setting
ansible.builtin.lineinfile:
dest: /etc/sudoers
state: present
regexp: "^{{ account.username }} ALL="
line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}"
validate: visudo -cf %s
when:
- params.sudo
- name: Refresh connection
ansible.builtin.meta: reset_connection
- name: Verify password
ansible.builtin.ping:
become: no
vars:
ansible_user: "{{ account.username }}"
ansible_password: "{{ account.secret }}"
ansible_become: no
when: account.secret_type == "password"
- name: Verify SSH key
ansible.builtin.ping:
become: no
vars:
ansible_user: "{{ account.username }}"
ansible_ssh_private_key_file: "{{ account.private_key_path }}"
ansible_become: no
when: account.secret_type == "ssh_key"

View File

@@ -0,0 +1,37 @@
id: push_account_posix
name: "{{ 'Posix account push' | trans }}"
category: host
type:
- unix
- linux
method: push_account
params:
- name: sudo
type: str
label: 'Sudo'
default: '/bin/whoami'
help_text: '使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig'
- name: shell
type: str
label: 'Shell'
default: '/bin/bash'
help_text: ''
- name: home
type: str
label: '家目录'
default: ''
help_text: '默认家目录 /home/系统用户名: /home/username'
- name: groups
type: str
label: '用户组'
default: ''
help_text: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)'
i18n:
Posix account push:
zh: 使用 Ansible 模块 user 执行账号推送 (sha512)
ja: Ansible user モジュールを使用してアカウントをプッシュする (sha512)
en: Using Ansible module user to push account (sha512)

View File

@@ -0,0 +1,31 @@
- hosts: demo
gather_facts: no
tasks:
- name: Test privileged account
ansible.windows.win_ping:
# - name: Print variables
# debug:
# msg: "Username: {{ account.username }}, Password: {{ account.secret }}"
- name: Push user password
ansible.windows.win_user:
fullname: "{{ account.username}}"
name: "{{ account.username }}"
password: "{{ account.secret }}"
password_never_expires: yes
groups: "{{ params.groups }}"
groups_action: add
update_password: always
ignore_errors: true
when: account.secret_type == "password"
- name: Refresh connection
ansible.builtin.meta: reset_connection
- name: Verify password
ansible.windows.win_ping:
vars:
ansible_user: "{{ account.username }}"
ansible_password: "{{ account.secret }}"
when: account.secret_type == "password"

View File

@@ -0,0 +1,19 @@
id: push_account_local_windows
name: "{{ 'Windows account push' | trans }}"
version: 1
method: push_account
category: host
type:
- windows
params:
- name: groups
type: str
label: '用户组'
default: 'Users,Remote Desktop Users'
help_text: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)'
i18n:
Windows account push:
zh: 使用 Ansible 模块 win_user 执行 Windows 账号推送
ja: Ansible win_user モジュールを使用して Windows アカウントをプッシュする
en: Using Ansible module win_user to push account

View File

@@ -1,9 +1,6 @@
from copy import deepcopy
from django.db.models import QuerySet
from accounts.const import AutomationTypes, SecretType
from accounts.models import Account
from accounts.const import AutomationTypes, SecretType, Connectivity
from assets.const import HostTypes
from common.utils import get_logger
from ..base.manager import AccountBasePlaybookManager
@@ -19,36 +16,6 @@ class PushAccountManager(ChangeSecretManager, AccountBasePlaybookManager):
def method_type(cls):
return AutomationTypes.push_account
def create_nonlocal_accounts(self, accounts, snapshot_account_usernames, asset):
secret_type = self.secret_type
usernames = accounts.filter(secret_type=secret_type).values_list(
'username', flat=True
)
create_usernames = set(snapshot_account_usernames) - set(usernames)
create_account_objs = [
Account(
name=f'{username}-{secret_type}', username=username,
secret_type=secret_type, asset=asset,
)
for username in create_usernames
]
Account.objects.bulk_create(create_account_objs)
def get_accounts(self, privilege_account, accounts: QuerySet):
if not privilege_account:
print(f'not privilege account')
return []
snapshot_account_usernames = self.execution.snapshot['accounts']
if '*' in snapshot_account_usernames:
return accounts.exclude(username=privilege_account.username)
asset = privilege_account.asset
self.create_nonlocal_accounts(accounts, snapshot_account_usernames, asset)
accounts = asset.accounts.exclude(username=privilege_account.username).filter(
username__in=snapshot_account_usernames, secret_type=self.secret_type
)
return accounts
def host_callback(self, host, asset=None, account=None, automation=None, path_dir=None, **kwargs):
host = super(ChangeSecretManager, self).host_callback(
host, asset=asset, account=account, automation=automation,
@@ -57,34 +24,37 @@ class PushAccountManager(ChangeSecretManager, AccountBasePlaybookManager):
if host.get('error'):
return host
accounts = asset.accounts.all()
accounts = self.get_accounts(account, accounts)
accounts = self.get_accounts(account)
inventory_hosts = []
host['secret_type'] = self.secret_type
if asset.type == HostTypes.WINDOWS and self.secret_type == SecretType.SSH_KEY:
msg = f'Windows {asset} does not support ssh key push \n'
msg = f'Windows {asset} does not support ssh key push'
print(msg)
return inventory_hosts
host['ssh_params'] = {}
for account in accounts:
h = deepcopy(host)
secret_type = account.secret_type
h['name'] += '(' + account.username + ')'
new_secret = self.get_secret()
if self.secret_type is None:
new_secret = account.secret
else:
new_secret = self.get_secret(secret_type)
self.name_recorder_mapper[h['name']] = {
'account': account, 'new_secret': new_secret,
}
private_key_path = None
if self.secret_type == SecretType.SSH_KEY:
if secret_type == SecretType.SSH_KEY:
private_key_path = self.generate_private_key_path(new_secret, path_dir)
new_secret = self.generate_public_key(new_secret)
h['kwargs'] = self.get_kwargs(account, new_secret)
h['ssh_params'].update(self.get_ssh_params(account, new_secret, secret_type))
h['account'] = {
'name': account.name,
'username': account.username,
'secret_type': account.secret_type,
'secret_type': secret_type,
'secret': new_secret,
'private_key_path': private_key_path
}
@@ -104,6 +74,7 @@ class PushAccountManager(ChangeSecretManager, AccountBasePlaybookManager):
return
account.secret = new_secret
account.save(update_fields=['secret'])
account.set_connectivity(Connectivity.OK)
def on_host_error(self, host, error, result):
pass
@@ -112,9 +83,9 @@ class PushAccountManager(ChangeSecretManager, AccountBasePlaybookManager):
logger.error("Pust account error: ", e)
def run(self, *args, **kwargs):
if not self.check_secret():
if self.secret_type and not self.check_secret():
return
super().run(*args, **kwargs)
super(ChangeSecretManager, self).run(*args, **kwargs)
# @classmethod
# def trigger_by_asset_create(cls, asset):

View File

@@ -0,0 +1,15 @@
- hosts: custom
gather_facts: no
vars:
ansible_shell_type: sh
ansible_connection: local
tasks:
- name: Verify account (pyfreerdp)
rdp_ping:
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_user: "{{ account.username }}"
login_password: "{{ account.secret }}"
login_secret_type: "{{ account.secret_type }}"
login_private_key_path: "{{ account.private_key_path }}"

View File

@@ -0,0 +1,13 @@
id: verify_account_by_rdp
name: "{{ 'Windows rdp account verify' | trans }}"
category:
- host
type:
- windows
method: verify_account
i18n:
Windows rdp account verify:
zh: 使用 Python 模块 pyfreerdp 验证账号
ja: Python モジュール pyfreerdp を使用してアカウントを検証する
en: Using Python module pyfreerdp to verify account

View File

@@ -0,0 +1,14 @@
- hosts: custom
gather_facts: no
vars:
ansible_connection: local
tasks:
- name: Verify account (paramiko)
ssh_ping:
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
login_user: "{{ account.username }}"
login_password: "{{ account.secret }}"
login_secret_type: "{{ account.secret_type }}"
login_private_key_path: "{{ account.private_key_path }}"

View File

@@ -0,0 +1,14 @@
id: verify_account_by_ssh
name: "{{ 'SSH account verify' | trans }}"
category:
- device
- host
type:
- all
method: verify_account
i18n:
SSH account verify:
zh: 使用 Python 模块 paramiko 验证账号
ja: Python モジュール paramiko を使用してアカウントを検証する
en: Using Python module paramiko to verify account

View File

@@ -1,6 +1,12 @@
id: verify_account_mongodb
name: Verify account from MongoDB
name: "{{ 'MongoDB account verify' | trans }}"
category: database
type:
- mongodb
method: verify_account
i18n:
MongoDB account verify:
zh: 使用 Ansible 模块 mongodb 验证账号
ja: Ansible mongodb モジュールを使用してアカウントを検証する
en: Using Ansible module mongodb to verify account

View File

@@ -1,7 +1,14 @@
id: verify_account_mysql
name: Verify account from MySQL
name: "{{ 'MySQL account verify' | trans }}"
category: database
type:
- mysql
- mariadb
method: verify_account
i18n:
MySQL account verify:
zh: 使用 Ansible 模块 mysql 验证账号
ja: Ansible mysql モジュールを使用してアカウントを検証する
en: Using Ansible module mysql to verify account

View File

@@ -1,6 +1,12 @@
id: verify_account_oracle
name: Verify account from Oracle
name: "{{ 'Oracle account verify' | trans }}"
category: database
type:
- oracle
method: verify_account
i18n:
Oracle account verify:
zh: 使用 Python 模块 oracledb 验证账号
ja: Python モジュール oracledb を使用してアカウントを検証する
en: Using Python module oracledb to verify account

View File

@@ -1,6 +1,12 @@
id: verify_account_postgresql
name: Verify account for PostgreSQL
name: "{{ 'PostgreSQL account verify' | trans }}"
category: database
type:
- postgresql
method: verify_account
i18n:
PostgreSQL account verify:
zh: 使用 Ansible 模块 postgresql 验证账号
ja: Ansible postgresql モジュールを使用してアカウントを検証する
en: Using Ansible module postgresql to verify account

View File

@@ -1,6 +1,12 @@
id: verify_account_sqlserver
name: Verify account from SQLServer
name: "{{ 'SQLServer account verify' | trans }}"
category: database
type:
- sqlserver
method: verify_account
i18n:
SQLServer account verify:
zh: 使用 Ansible 模块 mssql 验证账号
ja: Ansible mssql モジュールを使用してアカウントを検証する
en: Using Ansible module mssql to verify account

View File

@@ -1,7 +1,13 @@
id: verify_account_posix
name: Verify posix account
name: "{{ 'Posix account verify' | trans }}"
category: host
type:
- linux
- unix
method: verify_account
i18n:
Posix account verify:
zh: 使用 Ansible 模块 ping 验证账号
ja: Ansible ping モジュールを使用してアカウントを検証する
en: Using Ansible module ping to verify account

View File

@@ -1,6 +1,9 @@
- hosts: windows
gather_facts: no
tasks:
- name: Refresh connection
ansible.builtin.meta: reset_connection
- name: Verify account
ansible.windows.win_ping:
vars:

View File

@@ -1,7 +1,13 @@
id: verify_account_windows
name: Verify account windows
name: "{{ 'Windows account verify' | trans }}"
version: 1
method: verify_account
category: host
type:
- windows
i18n:
Windows account verify:
zh: 使用 Ansible 模块 win_ping 验证账号
ja: Ansible win_ping モジュールを使用してアカウントを検証する
en: Using Ansible module win_ping to verify account

View File

@@ -25,6 +25,15 @@ class VerifyAccountManager(AccountBasePlaybookManager):
f.write('ssh_args = -o ControlMaster=no -o ControlPersist=no\n')
return path
@classmethod
def method_type(cls):
return AutomationTypes.verify_account
def get_accounts(self, privilege_account, accounts: QuerySet):
account_ids = self.execution.snapshot['accounts']
accounts = accounts.filter(id__in=account_ids)
return accounts
def host_callback(self, host, asset=None, account=None, automation=None, path_dir=None, **kwargs):
host = super().host_callback(
host, asset=asset, account=account,
@@ -62,16 +71,6 @@ class VerifyAccountManager(AccountBasePlaybookManager):
inventory_hosts.append(h)
return inventory_hosts
@classmethod
def method_type(cls):
return AutomationTypes.verify_account
def get_accounts(self, privilege_account, accounts: QuerySet):
snapshot_account_usernames = self.execution.snapshot['accounts']
if '*' not in snapshot_account_usernames:
accounts = accounts.filter(username__in=snapshot_account_usernames)
return accounts
def on_host_success(self, host, result):
account = self.host_account_mapper.get(host)
account.set_connectivity(Connectivity.OK)

View File

@@ -1,6 +1,6 @@
from common.utils import get_logger
from accounts.const import AutomationTypes
from assets.automations.ping_gateway.manager import PingGatewayManager
from common.utils import get_logger
logger = get_logger(__name__)
@@ -16,6 +16,6 @@ class VerifyGatewayAccountManager(PingGatewayManager):
logger.info(">>> 开始执行测试网关账号可连接性任务")
def get_accounts(self, gateway):
usernames = self.execution.snapshot['accounts']
accounts = gateway.accounts.filter(username__in=usernames)
account_ids = self.execution.snapshot['accounts']
accounts = gateway.accounts.filter(id__in=account_ids)
return accounts

View File

@@ -7,14 +7,23 @@ class SecretType(TextChoices):
SSH_KEY = 'ssh_key', _('SSH key')
ACCESS_KEY = 'access_key', _('Access key')
TOKEN = 'token', _('Token')
API_KEY = 'api_key', _("API key")
class AliasAccount(TextChoices):
ALL = '@ALL', _('All')
INPUT = '@INPUT', _('Manual input')
USER = '@USER', _('Dynamic user')
ANON = '@ANON', _('Anonymous account')
class Source(TextChoices):
LOCAL = 'local', _('Local')
COLLECTED = 'collected', _('Collected')
TEMPLATE = 'template', _('Template')
class AccountInvalidPolicy(TextChoices):
SKIP = 'skip', _('Skip')
UPDATE = 'update', _('Update')
ERROR = 'error', _('Failed')

View File

@@ -48,7 +48,7 @@ class SecretStrategy(models.TextChoices):
class SSHKeyStrategy(models.TextChoices):
add = 'add', _('Append SSH KEY')
set = 'set', _('Empty and append SSH KEY')
set_jms = 'set_jms', _('Replace (The key generated by JumpServer) ')
set_jms = 'set_jms', _('Replace (Replace only keys pushed by JumpServer) ')
class TriggerChoice(models.TextChoices, TreeChoices):

View File

@@ -5,7 +5,6 @@ from django_filters import rest_framework as drf_filters
from assets.models import Node
from common.drf.filters import BaseFilterSet
from .models import Account, GatheredAccount
@@ -46,7 +45,7 @@ class AccountFilterSet(BaseFilterSet):
class Meta:
model = Account
fields = ['id', 'asset_id']
fields = ['id', 'asset_id', 'source_id', 'secret_type']
class GatheredAccountFilterSet(BaseFilterSet):

View File

@@ -1,12 +1,14 @@
# Generated by Django 3.2.14 on 2022-12-28 07:29
import uuid
import django.db.models.deletion
import simple_history.models
from django.conf import settings
from django.db import migrations, models
import common.db.encoder
import common.db.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models
import uuid
class Migration(migrations.Migration):
@@ -29,13 +31,16 @@ class Migration(migrations.Migration):
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
('org_id',
models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')),
('connectivity', models.CharField(choices=[('-', 'Unknown'), ('ok', 'Ok'), ('err', 'Error')], default='-', max_length=16, verbose_name='Connectivity')),
('connectivity',
models.CharField(choices=[('-', 'Unknown'), ('ok', 'Ok'), ('err', 'Error')], default='-',
max_length=16, verbose_name='Connectivity')),
('date_verified', models.DateTimeField(null=True, verbose_name='Date verified')),
('name', models.CharField(max_length=128, verbose_name='Name')),
('username', models.CharField(blank=True, db_index=True, max_length=128, verbose_name='Username')),
('secret_type', models.CharField(
choices=[('password', 'Password'), ('ssh_key', 'SSH key'), ('access_key', 'Access key'),
('token', 'Token')], default='password', max_length=16, verbose_name='Secret type')),
('token', 'Token'), ('api_key', 'API key')], default='password', max_length=16,
verbose_name='Secret type')),
('secret', common.db.fields.EncryptTextField(blank=True, null=True, verbose_name='Secret')),
('privileged', models.BooleanField(default=False, verbose_name='Privileged')),
('is_active', models.BooleanField(default=True, verbose_name='Is active')),
@@ -61,7 +66,8 @@ class Migration(migrations.Migration):
('id', models.UUIDField(db_index=True, default=uuid.uuid4)),
('secret_type', models.CharField(
choices=[('password', 'Password'), ('ssh_key', 'SSH key'), ('access_key', 'Access key'),
('token', 'Token')], default='password', max_length=16, verbose_name='Secret type')),
('token', 'Token'), ('api_key', 'API key')], default='password', max_length=16,
verbose_name='Secret type')),
('secret', common.db.fields.EncryptTextField(blank=True, null=True, verbose_name='Secret')),
('version', models.IntegerField(default=0, verbose_name='Version')),
('history_id', models.AutoField(primary_key=True, serialize=False)),
@@ -96,7 +102,8 @@ class Migration(migrations.Migration):
('username', models.CharField(blank=True, db_index=True, max_length=128, verbose_name='Username')),
('secret_type', models.CharField(
choices=[('password', 'Password'), ('ssh_key', 'SSH key'), ('access_key', 'Access key'),
('token', 'Token')], default='password', max_length=16, verbose_name='Secret type')),
('token', 'Token'), ('api_key', 'API key')], default='password', max_length=16,
verbose_name='Secret type')),
('secret', common.db.fields.EncryptTextField(blank=True, null=True, verbose_name='Secret')),
('privileged', models.BooleanField(default=False, verbose_name='Privileged')),
('is_active', models.BooleanField(default=True, verbose_name='Is active')),

View File

@@ -1,11 +1,13 @@
# Generated by Django 3.2.16 on 2022-12-30 08:08
import uuid
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import common.db.encoder
import common.db.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
@@ -53,7 +55,8 @@ class Migration(migrations.Migration):
primary_key=True, serialize=False, to='assets.baseautomation')),
('secret_type', models.CharField(
choices=[('password', 'Password'), ('ssh_key', 'SSH key'), ('access_key', 'Access key'),
('token', 'Token')], default='password', max_length=16, verbose_name='Secret type')),
('token', 'Token'), ('api_key', 'API key')], default='password', max_length=16,
verbose_name='Secret type')),
('secret_strategy', models.CharField(choices=[('specific', 'Specific password'),
('random_one', 'All assets use the same random password'),
('random_all',
@@ -156,7 +159,8 @@ class Migration(migrations.Migration):
primary_key=True, serialize=False, to='assets.baseautomation')),
('secret_type', models.CharField(
choices=[('password', 'Password'), ('ssh_key', 'SSH key'), ('access_key', 'Access key'),
('token', 'Token')], default='password', max_length=16, verbose_name='Secret type')),
('token', 'Token'), ('api_key', 'API key')], default='password', max_length=16,
verbose_name='Secret type')),
('secret_strategy', models.CharField(choices=[('specific', 'Specific password'),
('random_one', 'All assets use the same random password'),
('random_all',

View File

@@ -0,0 +1,69 @@
# Generated by Django 3.2.16 on 2023-03-07 07:36
from django.db import migrations
from django.db.models import Q
def get_nodes_all_assets(apps, *nodes):
node_model = apps.get_model('assets', 'Node')
asset_model = apps.get_model('assets', 'Asset')
node_ids = set()
descendant_node_query = Q()
for n in nodes:
node_ids.add(n.id)
descendant_node_query |= Q(key__istartswith=f'{n.key}:')
if descendant_node_query:
_ids = node_model.objects.order_by().filter(descendant_node_query).values_list('id', flat=True)
node_ids.update(_ids)
return asset_model.objects.order_by().filter(nodes__id__in=node_ids).distinct()
def get_all_assets(apps, snapshot):
node_model = apps.get_model('assets', 'Node')
asset_model = apps.get_model('assets', 'Asset')
asset_ids = snapshot.get('assets', [])
node_ids = snapshot.get('nodes', [])
nodes = node_model.objects.filter(id__in=node_ids)
node_asset_ids = get_nodes_all_assets(apps, *nodes).values_list('id', flat=True)
asset_ids = set(list(asset_ids) + list(node_asset_ids))
return asset_model.objects.filter(id__in=asset_ids)
def migrate_account_usernames_to_ids(apps, schema_editor):
db_alias = schema_editor.connection.alias
execution_model = apps.get_model('accounts', 'AutomationExecution')
account_model = apps.get_model('accounts', 'Account')
executions = execution_model.objects.using(db_alias).all()
executions_update = []
for execution in executions:
snapshot = execution.snapshot
accounts = account_model.objects.none()
account_usernames = snapshot.get('accounts', [])
for asset in get_all_assets(apps, snapshot):
accounts = accounts | asset.accounts.all()
secret_type = snapshot.get('secret_type')
if secret_type:
ids = accounts.filter(
username__in=account_usernames,
secret_type=secret_type
).values_list('id', flat=True)
else:
ids = accounts.filter(
username__in=account_usernames
).values_list('id', flat=True)
snapshot['accounts'] = [str(_id) for _id in ids]
execution.snapshot = snapshot
executions_update.append(execution)
execution_model.objects.bulk_update(executions_update, ['snapshot'])
class Migration(migrations.Migration):
dependencies = [
('accounts', '0008_alter_gatheredaccount_options'),
]
operations = [
migrations.RunPython(migrate_account_usernames_to_ids),
]

View File

@@ -0,0 +1,22 @@
# Generated by Django 3.2.16 on 2023-03-23 08:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0009_account_usernames_to_ids'),
]
operations = [
migrations.AddField(
model_name='gatheraccountsautomation',
name='is_sync_account',
field=models.BooleanField(blank=True, default=False, verbose_name='Is sync account'),
),
migrations.AddField(
model_name='account',
name='source_id',
field=models.CharField(max_length=128, null=True, blank=True, verbose_name='Source ID'),
),
]

View File

@@ -0,0 +1,29 @@
# Generated by Django 3.2.17 on 2023-05-06 06:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounts', '0010_gatheraccountsautomation_is_sync_account'),
]
operations = [
migrations.AddField(
model_name='accounttemplate',
name='su_from',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='su_to', to='accounts.accounttemplate', verbose_name='Su from'),
),
migrations.AlterField(
model_name='changesecretautomation',
name='ssh_key_change_strategy',
field=models.CharField(choices=[('add', 'Append SSH KEY'), ('set', 'Empty and append SSH KEY'), ('set_jms', 'Replace (Replace only keys pushed by JumpServer) ')], default='add', max_length=16, verbose_name='SSH key change strategy'),
),
migrations.AlterField(
model_name='pushaccountautomation',
name='ssh_key_change_strategy',
field=models.CharField(choices=[('add', 'Append SSH KEY'), ('set', 'Empty and append SSH KEY'), ('set_jms', 'Replace (Replace only keys pushed by JumpServer) ')], default='add', max_length=16, verbose_name='SSH key change strategy'),
),
]

View File

@@ -1,3 +1,3 @@
from .base import *
from .account import *
from .automations import *
from .base import *

View File

@@ -1,4 +1,6 @@
from django.db import models
from django.db.models import Count, Q
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from simple_history.models import HistoricalRecords
@@ -53,6 +55,7 @@ class Account(AbsConnectivity, BaseAccount):
version = models.IntegerField(default=0, verbose_name=_('Version'))
history = AccountHistoricalRecords(included_fields=['id', 'secret', 'secret_type', 'version'])
source = models.CharField(max_length=30, default=Source.LOCAL, verbose_name=_('Source'))
source_id = models.CharField(max_length=128, null=True, blank=True, verbose_name=_('Source ID'))
class Meta:
verbose_name = _('Account')
@@ -85,26 +88,44 @@ class Account(AbsConnectivity, BaseAccount):
def has_secret(self):
return bool(self.secret)
@classmethod
def get_special_account(cls, name):
if name == AliasAccount.INPUT.value:
return cls.get_manual_account()
elif name == AliasAccount.ANON.value:
return cls.get_anonymous_account()
else:
return cls(name=name, username=name, secret=None)
@classmethod
def get_manual_account(cls):
""" @INPUT 手动登录的账号(any) """
return cls(name=AliasAccount.INPUT.label, username=AliasAccount.INPUT.value, secret=None)
@lazyproperty
def versions(self):
return self.history.count()
@classmethod
def get_anonymous_account(cls):
return cls(name=AliasAccount.ANON.label, username=AliasAccount.ANON.value, secret=None)
@classmethod
def get_user_account(cls):
""" @USER 动态用户的账号(self) """
return cls(name=AliasAccount.USER.label, username=AliasAccount.USER.value, secret=None)
@lazyproperty
def versions(self):
return self.history.count()
def get_su_from_accounts(self):
""" 排除自己和以自己为 su-from 的账号 """
return self.asset.accounts.exclude(id=self.id).exclude(su_from=self)
class AccountTemplate(BaseAccount):
su_from = models.ForeignKey(
'self', related_name='su_to', null=True,
on_delete=models.SET_NULL, verbose_name=_("Su from")
)
class Meta:
verbose_name = _('Account template')
unique_together = (
@@ -115,5 +136,65 @@ class AccountTemplate(BaseAccount):
('change_accounttemplatesecret', _('Can change asset account template secret')),
]
@classmethod
def get_su_from_account_templates(cls, pk=None):
if pk is None:
return cls.objects.all()
return cls.objects.exclude(Q(id=pk) | Q(su_from_id=pk))
def __str__(self):
return f'{self.name}({self.username})'
def get_su_from_account(self, asset):
su_from = self.su_from
if su_from and asset.platform.su_enabled:
account = asset.accounts.filter(
username=su_from.username,
secret_type=su_from.secret_type
).first()
return account
def __str__(self):
return self.username
@staticmethod
def bulk_update_accounts(accounts, data):
history_model = Account.history.model
account_ids = accounts.values_list('id', flat=True)
history_accounts = history_model.objects.filter(id__in=account_ids)
account_id_count_map = {
str(i['id']): i['count']
for i in history_accounts.values('id').order_by('id')
.annotate(count=Count(1)).values('id', 'count')
}
for account in accounts:
account_id = str(account.id)
account.version = account_id_count_map.get(account_id) + 1
for k, v in data.items():
setattr(account, k, v)
Account.objects.bulk_update(accounts, ['version', 'secret'])
@staticmethod
def bulk_create_history_accounts(accounts, user_id):
history_model = Account.history.model
history_account_objs = []
for account in accounts:
history_account_objs.append(
history_model(
id=account.id,
version=account.version,
secret=account.secret,
secret_type=account.secret_type,
history_user_id=user_id,
history_date=timezone.now()
)
)
history_model.objects.bulk_create(history_account_objs)
def bulk_sync_account_secret(self, accounts, user_id):
""" 批量同步账号密码 """
if not accounts:
return
self.bulk_update_accounts(accounts, {'secret': self.secret})
self.bulk_create_history_accounts(accounts, user_id)

View File

@@ -1,11 +1,12 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
from common.db import fields
from common.db.models import JMSBaseModel
from accounts.const import (
AutomationTypes, SecretType, SecretStrategy, SSHKeyStrategy
)
from accounts.models import Account
from common.db import fields
from common.db.models import JMSBaseModel
from .base import AccountBaseAutomation
__all__ = ['ChangeSecretAutomation', 'ChangeSecretRecord', 'ChangeSecretMixin']
@@ -27,18 +28,34 @@ class ChangeSecretMixin(models.Model):
default=SSHKeyStrategy.add, verbose_name=_('SSH key change strategy')
)
get_all_assets: callable # get all assets
class Meta:
abstract = True
def create_nonlocal_accounts(self, usernames, asset):
pass
def get_account_ids(self):
usernames = self.accounts
accounts = Account.objects.none()
for asset in self.get_all_assets():
self.create_nonlocal_accounts(usernames, asset)
accounts = accounts | asset.accounts.all()
account_ids = accounts.filter(
username__in=usernames, secret_type=self.secret_type
).values_list('id', flat=True)
return [str(_id) for _id in account_ids]
def to_attr_json(self):
attr_json = super().to_attr_json()
attr_json.update({
'secret': self.secret,
'secret_type': self.secret_type,
'secret_strategy': self.secret_strategy,
'accounts': self.get_account_ids(),
'password_rules': self.password_rules,
'secret_strategy': self.secret_strategy,
'ssh_key_change_strategy': self.ssh_key_change_strategy,
})
return attr_json

View File

@@ -1,7 +1,9 @@
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from accounts.const import AutomationTypes
from accounts.const import AutomationTypes, Source
from accounts.models import Account
from orgs.mixins.models import JMSOrgBaseModel
from .base import AccountBaseAutomation
@@ -19,6 +21,25 @@ class GatheredAccount(JMSOrgBaseModel):
def address(self):
return self.asset.address
@staticmethod
def sync_accounts(gathered_accounts):
account_objs = []
for gathered_account in gathered_accounts:
asset_id = gathered_account.asset_id
username = gathered_account.username
accounts = Account.objects.filter(
Q(asset_id=asset_id, username=username) |
Q(asset_id=asset_id, name=username)
)
if accounts.exists():
continue
account = Account(
asset_id=asset_id, username=username,
name=username, source=Source.COLLECTED
)
account_objs.append(account)
Account.objects.bulk_create(account_objs)
class Meta:
verbose_name = _('Gather account automation')
unique_together = [
@@ -31,6 +52,17 @@ class GatheredAccount(JMSOrgBaseModel):
class GatherAccountsAutomation(AccountBaseAutomation):
is_sync_account = models.BooleanField(
default=False, blank=True, verbose_name=_("Is sync account")
)
def to_attr_json(self):
attr_json = super().to_attr_json()
attr_json.update({
'is_sync_account': self.is_sync_account,
})
return attr_json
def save(self, *args, **kwargs):
self.type = AutomationTypes.gather_accounts
super().save(*args, **kwargs)

View File

@@ -2,6 +2,8 @@ from django.db import models
from django.utils.translation import ugettext_lazy as _
from accounts.const import AutomationTypes
from accounts.models import Account
from jumpserver.utils import has_valid_xpack_license
from .base import AccountBaseAutomation
from .change_secret import ChangeSecretMixin
@@ -13,6 +15,21 @@ class PushAccountAutomation(ChangeSecretMixin, AccountBaseAutomation):
username = models.CharField(max_length=128, verbose_name=_('Username'))
action = models.CharField(max_length=16, verbose_name=_('Action'))
def create_nonlocal_accounts(self, usernames, asset):
secret_type = self.secret_type
account_usernames = asset.accounts.filter(secret_type=self.secret_type).values_list(
'username', flat=True
)
create_usernames = set(usernames) - set(account_usernames)
create_account_objs = [
Account(
name=f'{username}-{secret_type}', username=username,
secret_type=secret_type, asset=asset,
)
for username in create_usernames
]
Account.objects.bulk_create(create_account_objs)
def set_period_schedule(self):
pass
@@ -27,12 +44,15 @@ class PushAccountAutomation(ChangeSecretMixin, AccountBaseAutomation):
def save(self, *args, **kwargs):
self.type = AutomationTypes.push_account
if not has_valid_xpack_license():
self.is_periodic = False
super().save(*args, **kwargs)
def to_attr_json(self):
attr_json = super().to_attr_json()
attr_json.update({
'username': self.username
'username': self.username,
'params': self.params,
})
return attr_json

View File

@@ -12,7 +12,7 @@ from accounts.const import SecretType
from common.db import fields
from common.utils import (
ssh_key_string_to_obj, ssh_key_gen, get_logger,
random_string, lazyproperty, parse_ssh_public_key_str
random_string, lazyproperty, parse_ssh_public_key_str, is_openssh_format_key
)
from orgs.mixins.models import JMSOrgBaseModel, OrgManager
@@ -118,7 +118,13 @@ class BaseAccount(JMSOrgBaseModel):
key_name = '.' + md5(self.private_key.encode('utf-8')).hexdigest()
key_path = os.path.join(tmp_dir, key_name)
if not os.path.exists(key_path):
self.private_key_obj.write_private_key_file(key_path)
# https://github.com/ansible/ansible-runner/issues/544
# ssh requires OpenSSH format keys to have a full ending newline.
# It does not require this for old-style PEM keys.
with open(key_path, 'w') as f:
f.write(self.secret)
if is_openssh_format_key(self.secret.encode('utf-8')):
f.write("\n")
os.chmod(key_path, 0o400)
return key_path

View File

@@ -1,75 +1,180 @@
import uuid
from copy import deepcopy
from django.db import IntegrityError
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from rest_framework.generics import get_object_or_404
from rest_framework.validators import UniqueTogetherValidator
from accounts.const import SecretType, Source
from accounts.const import SecretType, Source, AccountInvalidPolicy
from accounts.models import Account, AccountTemplate
from accounts.tasks import push_accounts_to_assets_task
from assets.const import Category, AllTypes
from assets.models import Asset
from common.serializers import SecretReadableMixin, BulkModelSerializer
from common.serializers import SecretReadableMixin
from common.serializers.fields import ObjectRelatedField, LabeledChoiceField
from .base import BaseAccountSerializer
from common.utils import get_logger
from .base import BaseAccountSerializer, AuthValidateMixin
logger = get_logger(__name__)
class AccountSerializerCreateValidateMixin:
from_id: str
template: bool
push_now: bool
replace_attrs: callable
class AccountCreateUpdateSerializerMixin(serializers.Serializer):
template = serializers.PrimaryKeyRelatedField(
queryset=AccountTemplate.objects, required=False,
label=_("Template"), write_only=True, allow_null=True
)
push_now = serializers.BooleanField(
default=False, label=_("Push now"), write_only=True
)
params = serializers.JSONField(
decoder=None, encoder=None, required=False, style={'base_template': 'textarea.html'}
)
on_invalid = LabeledChoiceField(
choices=AccountInvalidPolicy.choices, default=AccountInvalidPolicy.ERROR,
write_only=True, allow_null=True, label=_('Exist policy'),
)
_template = None
clean_auth_fields: callable
def to_internal_value(self, data):
from_id = data.pop('id', None)
ret = super().to_internal_value(data)
self.from_id = from_id
return ret
class Meta:
fields = ['template', 'push_now', 'params', 'on_invalid']
def set_secret(self, attrs):
_id = self.from_id
template = attrs.pop('template', None)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.set_initial_value()
if _id and template:
account_template = AccountTemplate.objects.get(id=_id)
attrs['secret'] = account_template.secret
elif _id and not template:
account = Account.objects.get(id=_id)
attrs['secret'] = account.secret
return attrs
def set_initial_value(self):
if not getattr(self, 'initial_data', None):
return
if isinstance(self.initial_data, dict):
initial_data = [self.initial_data]
else:
initial_data = self.initial_data
def validate(self, attrs):
attrs = super().validate(attrs)
return self.set_secret(attrs)
for data in initial_data:
if not data.get('asset') and not self.instance:
raise serializers.ValidationError({'asset': UniqueTogetherValidator.missing_message})
asset = data.get('asset') or self.instance.asset
self.from_template_if_need(data)
self.set_uniq_name_if_need(data, asset)
def set_uniq_name_if_need(self, initial_data, asset):
name = initial_data.get('name')
if name is not None:
return
if not name:
name = initial_data.get('username')
if self.instance and self.instance.name == name:
return
if Account.objects.filter(name=name, asset=asset).exists():
name = name + '_' + uuid.uuid4().hex[:4]
initial_data['name'] = name
def from_template_if_need(self, initial_data):
if isinstance(initial_data, str):
return
template_id = initial_data.pop('template', None)
if not template_id:
return
if isinstance(template_id, (str, uuid.UUID)):
template = AccountTemplate.objects.filter(id=template_id).first()
else:
template = template_id
if not template:
raise serializers.ValidationError({'template': 'Template not found'})
self._template = template
# Set initial data from template
ignore_fields = ['id', 'date_created', 'date_updated', 'su_from', 'org_id']
field_names = [
field.name for field in template._meta.fields
if field.name not in ignore_fields
]
attrs = {}
for name in field_names:
value = getattr(template, name, None)
if value is None:
continue
attrs[name] = value
initial_data.update(attrs)
initial_data.update({
'source': Source.TEMPLATE,
'source_id': str(template.id)
})
asset_id = initial_data.get('asset')
if isinstance(asset_id, list) or not asset_id:
return
asset = get_object_or_404(Asset, pk=asset_id)
initial_data['su_from'] = template.get_su_from_account(asset)
@staticmethod
def push_account(instance, push_now):
if not push_now:
def push_account_if_need(instance, push_now, params, stat):
if not push_now or stat not in ['created', 'updated']:
return
push_accounts_to_assets_task.delay([str(instance.id)])
push_accounts_to_assets_task.delay([str(instance.id)], params)
def get_validators(self):
_validators = super().get_validators()
if getattr(self, 'initial_data', None) is None:
return _validators
on_invalid = self.initial_data.get('on_invalid')
if on_invalid == AccountInvalidPolicy.ERROR and not self.parent:
return _validators
_validators = [v for v in _validators if not isinstance(v, UniqueTogetherValidator)]
return _validators
@staticmethod
def do_create(vd):
on_invalid = vd.pop('on_invalid', None)
q = Q()
if vd.get('name'):
q |= Q(name=vd['name'])
if vd.get('username'):
q |= Q(username=vd['username'], secret_type=vd.get('secret_type'))
instance = Account.objects.filter(asset=vd['asset']).filter(q).first()
# 不存在这个资产,不用关系策略
if not instance:
instance = Account.objects.create(**vd)
return instance, 'created'
if on_invalid == AccountInvalidPolicy.SKIP:
return instance, 'skipped'
elif on_invalid == AccountInvalidPolicy.UPDATE:
for k, v in vd.items():
setattr(instance, k, v)
instance.save()
return instance, 'updated'
else:
raise serializers.ValidationError('Account already exists')
def create(self, validated_data):
push_now = validated_data.pop('push_now', None)
instance = super().create(validated_data)
self.push_account(instance, push_now)
params = validated_data.pop('params', None)
self.clean_auth_fields(validated_data)
instance, stat = self.do_create(validated_data)
self.push_account_if_need(instance, push_now, params, stat)
return instance
def update(self, instance, validated_data):
# account cannot be modified
validated_data.pop('username', None)
validated_data.pop('on_invalid', None)
push_now = validated_data.pop('push_now', None)
params = validated_data.pop('params', None)
validated_data['source_id'] = None
instance = super().update(instance, validated_data)
self.push_account(instance, push_now)
self.push_account_if_need(instance, push_now, params, 'updated')
return instance
class AccountSerializerCreateMixin(AccountSerializerCreateValidateMixin, BulkModelSerializer):
template = serializers.BooleanField(
default=False, label=_("Template"), write_only=True
)
push_now = serializers.BooleanField(
default=False, label=_("Push now"), write_only=True
)
has_secret = serializers.BooleanField(label=_("Has secret"), read_only=True)
class AccountAssetSerializer(serializers.ModelSerializer):
platform = ObjectRelatedField(read_only=True)
category = LabeledChoiceField(choices=Category.choices, read_only=True, label=_('Category'))
@@ -77,11 +182,11 @@ class AccountAssetSerializer(serializers.ModelSerializer):
class Meta:
model = Asset
fields = ['id', 'name', 'address', 'type', 'category', 'platform', 'auto_info']
fields = ['id', 'name', 'address', 'type', 'category', 'platform', 'auto_config']
def to_internal_value(self, data):
if isinstance(data, dict):
i = data.get('id')
i = data.get('id') or data.get('pk')
else:
i = data
@@ -91,9 +196,13 @@ class AccountAssetSerializer(serializers.ModelSerializer):
raise serializers.ValidationError(_('Asset not found'))
class AccountSerializer(AccountSerializerCreateMixin, BaseAccountSerializer):
class AccountSerializer(AccountCreateUpdateSerializerMixin, BaseAccountSerializer):
asset = AccountAssetSerializer(label=_('Asset'))
source = LabeledChoiceField(choices=Source.choices, label=_("Source"), read_only=True)
has_secret = serializers.BooleanField(label=_("Has secret"), read_only=True)
source = LabeledChoiceField(
choices=Source.choices, label=_("Source"), required=False,
allow_null=True, default=Source.LOCAL
)
su_from = ObjectRelatedField(
required=False, queryset=Account.objects, allow_null=True, allow_empty=True,
label=_('Su from'), attrs=('id', 'name', 'username')
@@ -102,27 +211,203 @@ class AccountSerializer(AccountSerializerCreateMixin, BaseAccountSerializer):
class Meta(BaseAccountSerializer.Meta):
model = Account
fields = BaseAccountSerializer.Meta.fields + [
'su_from', 'asset', 'template', 'version',
'push_now', 'source', 'connectivity',
'su_from', 'asset', 'version',
'source', 'source_id', 'connectivity',
] + AccountCreateUpdateSerializerMixin.Meta.fields
read_only_fields = BaseAccountSerializer.Meta.read_only_fields + [
'connectivity'
]
extra_kwargs = {
**BaseAccountSerializer.Meta.extra_kwargs,
'name': {'required': False, 'allow_null': True},
'name': {'required': False},
'source_id': {'required': False, 'allow_null': True},
}
def validate_name(self, value):
if not value:
value = self.initial_data.get('username')
return value
@classmethod
def setup_eager_loading(cls, queryset):
""" Perform necessary eager loading of data. """
queryset = queryset \
.prefetch_related('asset', 'asset__platform', 'asset__platform__automation')
queryset = queryset.prefetch_related(
'asset', 'asset__platform',
'asset__platform__automation'
)
return queryset
class AssetAccountBulkSerializerResultSerializer(serializers.Serializer):
asset = serializers.CharField(read_only=True, label=_('Asset'))
state = serializers.CharField(read_only=True, label=_('State'))
error = serializers.CharField(read_only=True, label=_('Error'))
changed = serializers.BooleanField(read_only=True, label=_('Changed'))
class AssetAccountBulkSerializer(
AccountCreateUpdateSerializerMixin, AuthValidateMixin, serializers.ModelSerializer
):
su_from_username = serializers.CharField(
max_length=128, required=False, write_only=True, allow_null=True, label=_("Su from"),
allow_blank=True,
)
assets = serializers.PrimaryKeyRelatedField(queryset=Asset.objects, many=True, label=_('Assets'))
class Meta:
model = Account
fields = [
'name', 'username', 'secret', 'secret_type', 'passphrase',
'privileged', 'is_active', 'comment', 'template',
'on_invalid', 'push_now', 'assets', 'su_from_username',
'source', 'source_id',
]
extra_kwargs = {
'name': {'required': False},
'secret_type': {'required': False},
'source': {'required': False, 'allow_null': True},
'source_id': {'required': False, 'allow_null': True},
}
def set_initial_value(self):
if not getattr(self, 'initial_data', None):
return
initial_data = self.initial_data
self.from_template_if_need(initial_data)
@staticmethod
def get_filter_lookup(vd):
return {
'username': vd['username'],
'secret_type': vd['secret_type'],
'asset': vd['asset'],
}
@staticmethod
def get_uniq_name(vd):
return vd['name'] + '-' + uuid.uuid4().hex[:4]
@staticmethod
def _handle_update_create(vd, lookup):
ori = Account.objects.filter(**lookup).first()
if ori and ori.secret == vd.get('secret'):
return ori, False, 'skipped'
instance, value = Account.objects.update_or_create(defaults=vd, **lookup)
state = 'created' if value else 'updated'
return instance, True, state
@staticmethod
def _handle_skip_create(vd, lookup):
instance, value = Account.objects.get_or_create(defaults=vd, **lookup)
state = 'created' if value else 'skipped'
return instance, value, state
@staticmethod
def _handle_err_create(vd, lookup):
instance, value = Account.objects.get_or_create(defaults=vd, **lookup)
if not value:
raise serializers.ValidationError(_('Account already exists'))
return instance, True, 'created'
def generate_su_from_data(self, validated_data):
template = self._template
asset = validated_data['asset']
su_from = validated_data.get('su_from')
su_from_username = validated_data.pop('su_from_username', None)
if template:
su_from = template.get_su_from_account(asset)
elif su_from_username:
su_from = asset.accounts.filter(username=su_from_username).first()
validated_data['su_from'] = su_from
def perform_create(self, vd, handler):
lookup = self.get_filter_lookup(vd)
vd = deepcopy(vd)
self.generate_su_from_data(vd)
try:
instance, changed, state = handler(vd, lookup)
except IntegrityError:
vd['name'] = self.get_uniq_name(vd)
instance, changed, state = handler(vd, lookup)
return instance, changed, state
def get_create_handler(self, on_invalid):
if on_invalid == 'update':
handler = self._handle_update_create
elif on_invalid == 'skip':
handler = self._handle_skip_create
else:
handler = self._handle_err_create
return handler
def perform_bulk_create(self, vd):
assets = vd.pop('assets')
on_invalid = vd.pop('on_invalid', 'skip')
secret_type = vd.get('secret_type', 'password')
if not vd.get('name'):
vd['name'] = vd.get('username')
create_handler = self.get_create_handler(on_invalid)
asset_ids = [asset.id for asset in assets]
secret_type_supports = Asset.get_secret_type_assets(asset_ids, secret_type)
_results = {}
for asset in assets:
if asset not in secret_type_supports:
_results[asset] = {
'error': _('Asset does not support this secret type: %s') % secret_type,
'state': 'error',
}
continue
vd = vd.copy()
vd['asset'] = asset
try:
self.clean_auth_fields(vd)
instance, changed, state = self.perform_create(vd, create_handler)
_results[asset] = {
'changed': changed, 'instance': instance.id, 'state': state
}
except serializers.ValidationError as e:
_results[asset] = {'error': e.detail[0], 'state': 'error'}
except Exception as e:
logger.exception(e)
_results[asset] = {'error': str(e), 'state': 'error'}
results = [{'asset': asset, **result} for asset, result in _results.items()]
state_score = {'created': 3, 'updated': 2, 'skipped': 1, 'error': 0}
results = sorted(results, key=lambda x: state_score.get(x['state'], 4))
if on_invalid != 'error':
return results
errors = []
errors.extend([result for result in results if result['state'] == 'error'])
for result in results:
if result['state'] != 'skipped':
continue
errors.append({
'error': _('Account has exist'),
'state': 'error',
'asset': str(result['asset'])
})
if errors:
raise serializers.ValidationError(errors)
return results
@staticmethod
def push_accounts_if_need(results, push_now):
if not push_now:
return
accounts = [str(v['instance']) for v in results if v.get('instance')]
push_accounts_to_assets_task.delay(accounts)
def create(self, validated_data):
push_now = validated_data.pop('push_now', False)
results = self.perform_bulk_create(validated_data)
self.push_accounts_if_need(results, push_now)
for res in results:
res['asset'] = str(res['asset'])
return results
class AccountSecretSerializer(SecretReadableMixin, AccountSerializer):
class Meta(AccountSerializer.Meta):
extra_kwargs = {
@@ -132,11 +417,19 @@ class AccountSecretSerializer(SecretReadableMixin, AccountSerializer):
class AccountHistorySerializer(serializers.ModelSerializer):
secret_type = LabeledChoiceField(choices=SecretType.choices, label=_('Secret type'))
id = serializers.IntegerField(label=_('ID'), source='history_id', read_only=True)
class Meta:
model = Account.history.model
fields = ['id', 'secret', 'secret_type', 'version', 'history_date', 'history_user']
fields = [
'id', 'secret', 'secret_type', 'version', 'history_date',
'history_user'
]
read_only_fields = fields
extra_kwargs = {
'history_user': {'label': _('User')},
'history_date': {'label': _('Date')},
}
class AccountTaskSerializer(serializers.Serializer):
@@ -150,3 +443,7 @@ class AccountTaskSerializer(serializers.Serializer):
queryset=Account.objects, required=False, allow_empty=True, many=True
)
task = serializers.CharField(read_only=True)
params = serializers.JSONField(
decoder=None, encoder=None, required=False,
style={'base_template': 'textarea.html'}
)

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from accounts.models import AccountBackupAutomation, AccountBackupExecution

View File

@@ -13,10 +13,10 @@ __all__ = ['AuthValidateMixin', 'BaseAccountSerializer']
class AuthValidateMixin(serializers.Serializer):
secret_type = LabeledChoiceField(
choices=SecretType.choices, required=True, label=_('Secret type')
choices=SecretType.choices, label=_('Secret type'), default='password'
)
secret = EncryptedField(
label=_('Secret/Password'), required=False, max_length=40960, allow_blank=True,
label=_('Secret'), required=False, max_length=40960, allow_blank=True,
allow_null=True, write_only=True,
)
passphrase = serializers.CharField(
@@ -33,7 +33,8 @@ class AuthValidateMixin(serializers.Serializer):
return secret
elif secret_type == SecretType.SSH_KEY:
passphrase = passphrase if passphrase else None
return validate_ssh_key(secret, passphrase)
secret = validate_ssh_key(secret, passphrase)
return secret
else:
return secret
@@ -41,8 +42,9 @@ class AuthValidateMixin(serializers.Serializer):
secret_type = validated_data.get('secret_type')
passphrase = validated_data.get('passphrase')
secret = validated_data.pop('secret', None)
self.handle_secret(secret, secret_type, passphrase)
validated_data['secret'] = secret
validated_data['secret'] = self.handle_secret(
secret, secret_type, passphrase
)
for field in ('secret',):
value = validated_data.get(field)
if not value:
@@ -75,6 +77,9 @@ class BaseAccountSerializer(AuthValidateMixin, BulkOrgResourceModelSerializer):
'date_verified', 'created_by', 'date_created',
]
extra_kwargs = {
'name': {'required': True},
'spec_info': {'label': _('Spec info')},
'username': {'help_text': _(
"Tip: If no username is required for authentication, fill in `null`, "
"If AD account, like `username@domain`"
)},
}

View File

@@ -1,23 +1,52 @@
from accounts.models import AccountTemplate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from accounts.models import AccountTemplate, Account
from common.serializers import SecretReadableMixin
from common.serializers.fields import ObjectRelatedField
from .base import BaseAccountSerializer
class AccountTemplateSerializer(BaseAccountSerializer):
is_sync_account = serializers.BooleanField(default=False, write_only=True)
_is_sync_account = False
su_from = ObjectRelatedField(
required=False, queryset=AccountTemplate.objects, allow_null=True,
allow_empty=True, label=_('Su from'), attrs=('id', 'name', 'username')
)
class Meta(BaseAccountSerializer.Meta):
model = AccountTemplate
fields = BaseAccountSerializer.Meta.fields + ['is_sync_account', 'su_from']
# @classmethod
# def validate_required(cls, attrs):
# # TODO 选择模版后检查一些必填项
# required_field_dict = {}
# error = _('This field is required.')
# for k, v in cls().fields.items():
# if v.required and k not in attrs:
# required_field_dict[k] = error
# if not required_field_dict:
# return
# raise serializers.ValidationError(required_field_dict)
def sync_accounts_secret(self, instance, diff):
if not self._is_sync_account or 'secret' not in diff:
return
query_data = {
'source_id': instance.id,
'username': instance.username,
'secret_type': instance.secret_type
}
accounts = Account.objects.filter(**query_data)
instance.bulk_sync_account_secret(accounts, self.context['request'].user.id)
def validate(self, attrs):
self._is_sync_account = attrs.pop('is_sync_account', None)
attrs = super().validate(attrs)
return attrs
def update(self, instance, validated_data):
diff = {
k: v for k, v in validated_data.items()
if getattr(instance, k, None) != v
}
instance = super().update(instance, validated_data)
if {'username', 'secret_type'} & set(diff.keys()):
Account.objects.filter(source_id=instance.id).update(source_id=None)
else:
self.sync_accounts_secret(instance, diff)
return instance
class AccountTemplateSecretSerializer(SecretReadableMixin, AccountTemplateSerializer):

View File

@@ -1,4 +1,4 @@
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from accounts.models import AutomationExecution
@@ -63,15 +63,17 @@ class AutomationExecutionSerializer(serializers.ModelSerializer):
@staticmethod
def get_snapshot(obj):
tp = obj.snapshot['type']
tp = obj.snapshot.get('type', '')
type_display = tp if not hasattr(AutomationTypes, tp) \
else getattr(AutomationTypes, tp).label
snapshot = {
'type': tp,
'name': obj.snapshot['name'],
'comment': obj.snapshot['comment'],
'accounts': obj.snapshot['accounts'],
'node_amount': len(obj.snapshot['nodes']),
'asset_amount': len(obj.snapshot['assets']),
'type_display': getattr(AutomationTypes, tp).label,
'name': obj.snapshot.get('name'),
'comment': obj.snapshot.get('comment'),
'accounts': obj.snapshot.get('accounts'),
'node_amount': len(obj.snapshot.get('nodes', [])),
'asset_amount': len(obj.snapshot.get('assets', [])),
'type_display': type_display,
}
return snapshot

View File

@@ -50,7 +50,7 @@ class ChangeSecretAutomationSerializer(AuthValidateMixin, BaseAutomationSerializ
read_only_fields = BaseAutomationSerializer.Meta.read_only_fields
fields = BaseAutomationSerializer.Meta.fields + read_only_fields + [
'secret_type', 'secret_strategy', 'secret', 'password_rules',
'ssh_key_change_strategy', 'passphrase', 'recipients',
'ssh_key_change_strategy', 'passphrase', 'recipients', 'params'
]
extra_kwargs = {**BaseAutomationSerializer.Meta.extra_kwargs, **{
'accounts': {'required': True},
@@ -58,6 +58,7 @@ class ChangeSecretAutomationSerializer(AuthValidateMixin, BaseAutomationSerializ
"Currently only mail sending is supported"
)},
}}
@property
def model_type(self):
return AutomationTypes.change_secret

View File

@@ -17,7 +17,8 @@ class GatherAccountAutomationSerializer(BaseAutomationSerializer):
class Meta:
model = GatherAccountsAutomation
read_only_fields = BaseAutomationSerializer.Meta.read_only_fields
fields = BaseAutomationSerializer.Meta.fields + read_only_fields
fields = BaseAutomationSerializer.Meta.fields \
+ ['is_sync_account'] + read_only_fields
extra_kwargs = BaseAutomationSerializer.Meta.extra_kwargs

View File

@@ -7,6 +7,7 @@ from .change_secret import (
class PushAccountAutomationSerializer(ChangeSecretAutomationSerializer):
class Meta(ChangeSecretAutomationSerializer.Meta):
model = PushAccountAutomation
fields = [

View File

@@ -8,8 +8,8 @@ logger = get_logger(__name__)
@receiver(pre_save, sender=Account)
def on_account_pre_save(sender, instance, created=False, **kwargs):
if created:
def on_account_pre_save(sender, instance, **kwargs):
if instance.version == 0:
instance.version = 1
else:
instance.version = instance.history.count()

Some files were not shown because too many files have changed in this diff Show More