diff --git a/apps/accounts/const/automation.py b/apps/accounts/const/automation.py index cb39703e0..b27080a6f 100644 --- a/apps/accounts/const/automation.py +++ b/apps/accounts/const/automation.py @@ -4,11 +4,13 @@ from django.utils.translation import gettext_lazy as _ from assets.const import Connectivity from common.db.fields import TreeChoices -string_punctuation = '!#$%&()*+,-.:;<=>?@[]^_~' DEFAULT_PASSWORD_LENGTH = 30 DEFAULT_PASSWORD_RULES = { 'length': DEFAULT_PASSWORD_LENGTH, - 'symbol_set': string_punctuation + 'uppercase': True, + 'lowercase': True, + 'digit': True, + 'symbol': True, } __all__ = [ @@ -41,8 +43,8 @@ class AutomationTypes(models.TextChoices): class SecretStrategy(models.TextChoices): - custom = 'specific', _('Specific password') - random = 'random', _('Random') + custom = 'specific', _('Specific secret') + random = 'random', _('Random generate') class SSHKeyStrategy(models.TextChoices): diff --git a/apps/accounts/migrations/0016_accounttemplate_password_rules.py b/apps/accounts/migrations/0016_accounttemplate_password_rules.py new file mode 100644 index 000000000..d036f90a4 --- /dev/null +++ b/apps/accounts/migrations/0016_accounttemplate_password_rules.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.10 on 2023-09-18 08:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounts', '0015_auto_20230825_1120'), + ] + + operations = [ + migrations.AddField( + model_name='accounttemplate', + name='password_rules', + field=models.JSONField(default=dict, verbose_name='Password rules'), + ), + ] diff --git a/apps/accounts/models/__init__.py b/apps/accounts/models/__init__.py index 9a3b780c8..5ec98bb68 100644 --- a/apps/accounts/models/__init__.py +++ b/apps/accounts/models/__init__.py @@ -1,5 +1,5 @@ -from .account import * -from .automations import * -from .base import * -from .template import * -from .virtual import * +from .account import * # noqa +from .base import * # noqa +from .automations import * # noqa +from .template import * # noqa +from .virtual import * # noqa diff --git a/apps/accounts/models/automations/base.py b/apps/accounts/models/automations/base.py index 98c513161..79f17614f 100644 --- a/apps/accounts/models/automations/base.py +++ b/apps/accounts/models/automations/base.py @@ -1,14 +1,13 @@ from django.db import models from django.utils.translation import gettext_lazy as _ -from accounts.const import SecretStrategy, SSHKeyStrategy, SecretType -from accounts.models import Account +from accounts.const import SSHKeyStrategy +from accounts.models import Account, SecretWithRandomMixin from accounts.tasks import execute_account_automation_task from assets.models.automations import ( BaseAutomation as AssetBaseAutomation, AutomationExecution as AssetAutomationExecution ) -from common.db import fields __all__ = ['AccountBaseAutomation', 'AutomationExecution', 'ChangeSecretMixin'] @@ -49,27 +48,11 @@ class AutomationExecution(AssetAutomationExecution): return manager.run() -class ChangeSecretRuleMixin(models.Model): - secret_strategy = models.CharField( - choices=SecretStrategy.choices, max_length=16, - default=SecretStrategy.custom, verbose_name=_('Secret strategy') - ) - password_rules = models.JSONField(default=dict, verbose_name=_('Password rules')) +class ChangeSecretMixin(SecretWithRandomMixin): ssh_key_change_strategy = models.CharField( choices=SSHKeyStrategy.choices, max_length=16, default=SSHKeyStrategy.add, verbose_name=_('SSH key change strategy') ) - - class Meta: - abstract = True - - -class ChangeSecretMixin(ChangeSecretRuleMixin): - secret_type = models.CharField( - choices=SecretType.choices, max_length=16, - default=SecretType.PASSWORD, verbose_name=_('Secret type') - ) - secret = fields.EncryptTextField(blank=True, null=True, verbose_name=_('Secret')) get_all_assets: callable # get all assets class Meta: diff --git a/apps/accounts/models/automations/push_account.py b/apps/accounts/models/automations/push_account.py index 8ebfe697b..84aa1bb6e 100644 --- a/apps/accounts/models/automations/push_account.py +++ b/apps/accounts/models/automations/push_account.py @@ -17,9 +17,9 @@ class PushAccountAutomation(ChangeSecretMixin, AccountBaseAutomation): 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 - ) + 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( diff --git a/apps/accounts/models/base.py b/apps/accounts/models/base.py index 37f5deaae..87cc14e2b 100644 --- a/apps/accounts/models/base.py +++ b/apps/accounts/models/base.py @@ -8,8 +8,10 @@ from django.conf import settings from django.db import models from django.utils.translation import gettext_lazy as _ -from accounts.const import SecretType +from accounts.const import SecretType, SecretStrategy from accounts.models.mixins import VaultModelMixin, VaultManagerMixin, VaultQuerySetMixin +from accounts.utils import SecretGenerator +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, is_openssh_format_key @@ -29,6 +31,35 @@ class BaseAccountManager(VaultManagerMixin, OrgManager): return self.get_queryset().active() +class SecretWithRandomMixin(models.Model): + secret_type = models.CharField( + choices=SecretType.choices, max_length=16, + default=SecretType.PASSWORD, verbose_name=_('Secret type') + ) + secret = fields.EncryptTextField(blank=True, null=True, verbose_name=_('Secret')) + secret_strategy = models.CharField( + choices=SecretStrategy.choices, max_length=16, + default=SecretStrategy.custom, verbose_name=_('Secret strategy') + ) + password_rules = models.JSONField(default=dict, verbose_name=_('Password rules')) + + class Meta: + abstract = True + + @lazyproperty + def secret_generator(self): + return SecretGenerator( + self.secret_strategy, self.secret_type, + self.password_rules, + ) + + def get_secret(self): + if self.secret_strategy == 'random': + return self.secret_generator.get_secret() + else: + return self.secret + + class BaseAccount(VaultModelMixin, JMSOrgBaseModel): name = models.CharField(max_length=128, verbose_name=_("Name")) username = models.CharField(max_length=128, blank=True, verbose_name=_('Username'), db_index=True) diff --git a/apps/accounts/models/template.py b/apps/accounts/models/template.py index a4b97362d..0834dcb03 100644 --- a/apps/accounts/models/template.py +++ b/apps/accounts/models/template.py @@ -4,22 +4,16 @@ from django.utils import timezone from django.utils.translation import gettext_lazy as _ from .account import Account -from .base import BaseAccount +from .base import BaseAccount, SecretWithRandomMixin __all__ = ['AccountTemplate', ] -from ..const import SecretStrategy - -class AccountTemplate(BaseAccount): +class AccountTemplate(BaseAccount, SecretWithRandomMixin): su_from = models.ForeignKey( 'self', related_name='su_to', null=True, on_delete=models.SET_NULL, verbose_name=_("Su from") ) - secret_strategy = models.CharField( - choices=SecretStrategy.choices, max_length=16, - default=SecretStrategy.custom, verbose_name=_('Secret strategy') - ) auto_push = models.BooleanField(default=False, verbose_name=_('Auto push')) platforms = models.ManyToManyField( 'assets.Platform', related_name='account_templates', diff --git a/apps/accounts/serializers/account/account.py b/apps/accounts/serializers/account/account.py index e3ec5923c..9d817e5aa 100644 --- a/apps/accounts/serializers/account/account.py +++ b/apps/accounts/serializers/account/account.py @@ -73,6 +73,22 @@ class AccountCreateUpdateSerializerMixin(serializers.Serializer): name = name + '_' + uuid.uuid4().hex[:4] initial_data['name'] = name + @staticmethod + def get_template_attr_for_account(template): + # Set initial data from template + field_names = [ + 'username', 'secret', 'secret_type', 'privileged', 'is_active' + ] + + attrs = {} + for name in field_names: + value = getattr(template, name, None) + if value is None: + continue + attrs[name] = value + attrs['secret'] = template.get_secret() + return attrs + def from_template_if_need(self, initial_data): if isinstance(initial_data, str): return @@ -89,20 +105,7 @@ class AccountCreateUpdateSerializerMixin(serializers.Serializer): 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 - ] - field_names = [name if name != '_secret' else 'secret' for name in field_names] - - attrs = {} - for name in field_names: - value = getattr(template, name, None) - if value is None: - continue - attrs[name] = value + attrs = self.get_template_attr_for_account(template) initial_data.update(attrs) initial_data.update({ 'source': Source.TEMPLATE, diff --git a/apps/accounts/serializers/account/template.py b/apps/accounts/serializers/account/template.py index 23f79350d..149760908 100644 --- a/apps/accounts/serializers/account/template.py +++ b/apps/accounts/serializers/account/template.py @@ -7,10 +7,19 @@ from common.serializers.fields import ObjectRelatedField from .base import BaseAccountSerializer +class PasswordRulesSerializer(serializers.Serializer): + length = serializers.IntegerField(min_value=8, max_value=30, default=16, label=_('Password length')) + lowercase = serializers.BooleanField(default=True, label=_('Lowercase')) + uppercase = serializers.BooleanField(default=True, label=_('Uppercase')) + digit = serializers.BooleanField(default=True, label=_('Digit')) + symbol = serializers.BooleanField(default=True, label=_('Special symbol')) + + class AccountTemplateSerializer(BaseAccountSerializer): is_sync_account = serializers.BooleanField(default=False, write_only=True) _is_sync_account = False + password_rules = PasswordRulesSerializer(required=False, label=_('Password rules')) su_from = ObjectRelatedField( required=False, queryset=AccountTemplate.objects, allow_null=True, allow_empty=True, label=_('Su from'), attrs=('id', 'name', 'username') @@ -19,17 +28,20 @@ class AccountTemplateSerializer(BaseAccountSerializer): class Meta(BaseAccountSerializer.Meta): model = AccountTemplate fields = BaseAccountSerializer.Meta.fields + [ - 'secret_strategy', + 'secret_strategy', 'password_rules', 'auto_push', 'push_params', 'platforms', 'is_sync_account', 'su_from' ] extra_kwargs = { 'secret_strategy': {'help_text': _('Secret generation strategy for account creation')}, 'auto_push': {'help_text': _('Whether to automatically push the account to the asset')}, - 'platforms': {'help_text': _( - 'Associated platform, you can configure push parameters. ' - 'If not associated, default parameters will be used' - )}, + 'platforms': { + 'help_text': _( + 'Associated platform, you can configure push parameters. ' + 'If not associated, default parameters will be used' + ), + 'required': False + }, } def sync_accounts_secret(self, instance, diff): diff --git a/apps/accounts/serializers/automations/change_secret.py b/apps/accounts/serializers/automations/change_secret.py index da8a1585c..cd7419fdc 100644 --- a/apps/accounts/serializers/automations/change_secret.py +++ b/apps/accounts/serializers/automations/change_secret.py @@ -4,14 +4,13 @@ from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from accounts.const import ( - AutomationTypes, DEFAULT_PASSWORD_RULES, - SecretType, SecretStrategy, SSHKeyStrategy + AutomationTypes, SecretType, SecretStrategy, SSHKeyStrategy ) from accounts.models import ( Account, ChangeSecretAutomation, ChangeSecretRecord, AutomationExecution ) -from accounts.serializers import AuthValidateMixin +from accounts.serializers import AuthValidateMixin, PasswordRulesSerializer from assets.models import Asset from common.serializers.fields import LabeledChoiceField, ObjectRelatedField from common.utils import get_logger @@ -42,7 +41,7 @@ class ChangeSecretAutomationSerializer(AuthValidateMixin, BaseAutomationSerializ ssh_key_change_strategy = LabeledChoiceField( choices=SSHKeyStrategy.choices, required=False, label=_('SSH Key strategy') ) - password_rules = serializers.DictField(default=DEFAULT_PASSWORD_RULES) + password_rules = PasswordRulesSerializer(required=False, label=_('Password rules')) secret_type = LabeledChoiceField(choices=get_secret_types(), required=True, label=_('Secret type')) class Meta: diff --git a/apps/accounts/utils.py b/apps/accounts/utils.py index cc467ecc0..fb3be63a7 100644 --- a/apps/accounts/utils.py +++ b/apps/accounts/utils.py @@ -1,3 +1,5 @@ +import copy + from django.utils.translation import gettext_lazy as _ from rest_framework import serializers @@ -18,9 +20,19 @@ class SecretGenerator: return private_key def generate_password(self): - length = int(self.password_rules.get('length', 0)) - length = length if length else DEFAULT_PASSWORD_RULES['length'] - return random_string(length, special_char=True) + password_rules = self.password_rules + if not password_rules or not isinstance(password_rules, dict): + password_rules = {} + rules = copy.deepcopy(DEFAULT_PASSWORD_RULES) + rules.update(password_rules) + rules = { + 'length': rules['length'], + 'lower': rules['lowercase'], + 'upper': rules['uppercase'], + 'digit': rules['digit'], + 'special_char': rules['symbol'] + } + return random_string(**rules) def get_secret(self): if self.secret_type == SecretType.SSH_KEY: diff --git a/apps/common/utils/random.py b/apps/common/utils/random.py index f75e7001b..53143e4db 100644 --- a/apps/common/utils/random.py +++ b/apps/common/utils/random.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- # -import struct import random import socket import string - +import struct string_punctuation = '!#$%&()*+,-.:;<=>?@[]^_~' @@ -18,35 +17,31 @@ def random_ip(): return socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) -def random_string(length: int, lower=True, upper=True, digit=True, special_char=False): - args_names = ['lower', 'upper', 'digit', 'special_char'] - args_values = [lower, upper, digit, special_char] - args_string = [string.ascii_lowercase, string.ascii_uppercase, string.digits, string_punctuation] +def random_string(length: int, lower=True, upper=True, digit=True, special_char=False, symbols=string_punctuation): + args_names = ['lower', 'upper', 'digit'] + args_values = [lower, upper, digit] + args_string = [string.ascii_lowercase, string.ascii_uppercase, string.digits] args_string_map = dict(zip(args_names, args_string)) kwargs = dict(zip(args_names, args_values)) kwargs_keys = list(kwargs.keys()) kwargs_values = list(kwargs.values()) args_true_count = len([i for i in kwargs_values if i]) + assert any(kwargs_values), f'Parameters {kwargs_keys} must have at least one `True`' assert length >= args_true_count, f'Expected length >= {args_true_count}, bug got {length}' - can_startswith_special_char = args_true_count == 1 and special_char - chars = ''.join([args_string_map[k] for k, v in kwargs.items() if v]) + password = list(random.choice(chars) for i in range(length)) - while True: - password = list(random.choice(chars) for i in range(length)) - for k, v in kwargs.items(): - if v and not (set(password) & set(args_string_map[k])): - # 没有包含指定的字符, retry - break - else: - if not can_startswith_special_char and password[0] in args_string_map['special_char']: - # 首位不能为特殊字符, retry - continue - else: - # 满足要求终止 while 循环 - break + if special_char: + special_num = length // 16 + 1 + special_index = [] + for i in range(special_num): + index = random.randint(1, length - 1) + if index not in special_index: + special_index.append(index) + for i in special_index: + password[i] = random.choice(symbols) password = ''.join(password) return password diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index 17c46046e..a172ed89b 100644 --- a/apps/locale/ja/LC_MESSAGES/django.mo +++ b/apps/locale/ja/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2282c0cd38dbf5b6a004f282b871d397fa060385dcb3ec0105d7bbdf2818d780 -size 160182 +oid sha256:e272cbf5e09c7c2c5e2ca3215dc57b7835de698d1f02092c893ce81de472d8ad +size 160195 diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index 7ac9d8fdb..6dad62243 100644 --- a/apps/locale/ja/LC_MESSAGES/django.po +++ b/apps/locale/ja/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-19 10:25+0800\n" +"POT-Creation-Date: 2023-09-19 10:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,7 +23,7 @@ msgid "The parameter 'action' must be [{}]" msgstr "パラメータ 'action' は [{}] でなければなりません。" #: accounts/const/account.py:6 -#: accounts/serializers/automations/change_secret.py:33 +#: accounts/serializers/automations/change_secret.py:32 #: assets/models/_user.py:24 audits/signal_handlers/login_log.py:35 #: authentication/confirm/password.py:9 authentication/forms.py:32 #: authentication/templates/authentication/login.html:286 @@ -36,7 +36,7 @@ msgid "Password" msgstr "パスワード" #: accounts/const/account.py:7 -#: accounts/serializers/automations/change_secret.py:34 +#: accounts/serializers/automations/change_secret.py:33 msgid "SSH key" msgstr "SSH キー" @@ -94,97 +94,97 @@ msgid "Update" msgstr "更新" #: accounts/const/account.py:33 -#: accounts/serializers/automations/change_secret.py:156 audits/const.py:55 +#: accounts/serializers/automations/change_secret.py:155 audits/const.py:55 #: audits/signal_handlers/activity_log.py:33 common/const/choices.py:19 #: ops/const.py:62 terminal/const.py:77 xpack/plugins/cloud/const.py:43 msgid "Failed" msgstr "失敗しました" -#: accounts/const/automation.py:22 rbac/tree.py:50 +#: accounts/const/automation.py:24 rbac/tree.py:50 msgid "Push account" msgstr "アカウントプッシュ" -#: accounts/const/automation.py:23 +#: accounts/const/automation.py:25 msgid "Change secret" msgstr "パスワードを変更する" -#: accounts/const/automation.py:24 +#: accounts/const/automation.py:26 msgid "Verify account" msgstr "アカウントを確認" -#: accounts/const/automation.py:25 +#: accounts/const/automation.py:27 msgid "Gather accounts" msgstr "アカウントのコレクション" -#: accounts/const/automation.py:26 +#: accounts/const/automation.py:28 msgid "Verify gateway account" msgstr "ゲートウェイ アカウントを確認する" -#: accounts/const/automation.py:44 -msgid "Specific password" +#: accounts/const/automation.py:46 +msgid "Specific secret" msgstr "特定" -#: accounts/const/automation.py:45 -msgid "Random" -msgstr "ランダム" +#: accounts/const/automation.py:47 +msgid "Random generate" +msgstr "ランダム生成" -#: accounts/const/automation.py:49 ops/const.py:13 +#: accounts/const/automation.py:51 ops/const.py:13 msgid "Append SSH KEY" msgstr "追加" -#: accounts/const/automation.py:50 ops/const.py:14 +#: accounts/const/automation.py:52 ops/const.py:14 msgid "Empty and append SSH KEY" msgstr "すべてクリアして追加" -#: accounts/const/automation.py:51 ops/const.py:15 +#: accounts/const/automation.py:53 ops/const.py:15 msgid "Replace (Replace only keys pushed by JumpServer) " msgstr "置換(JumpServer によってプッシュされたキーのみを置換)" -#: accounts/const/automation.py:56 +#: accounts/const/automation.py:58 msgid "On asset create" msgstr "アセットが作成されたとき" -#: accounts/const/automation.py:59 +#: accounts/const/automation.py:61 msgid "On perm add user" msgstr "承認が変更されたときにユーザーを追加する" -#: accounts/const/automation.py:61 +#: accounts/const/automation.py:63 msgid "On perm add user group" msgstr "権限変更時にユーザーグループを追加" -#: accounts/const/automation.py:63 +#: accounts/const/automation.py:65 msgid "On perm add asset" msgstr "変更の承認時にアセットを追加する" -#: accounts/const/automation.py:65 +#: accounts/const/automation.py:67 msgid "On perm add node" msgstr "承認変更時のノードの追加" -#: accounts/const/automation.py:67 +#: accounts/const/automation.py:69 msgid "On perm add account" msgstr "承認が変更されたときにアカウントを追加する" -#: accounts/const/automation.py:69 +#: accounts/const/automation.py:71 msgid "On asset join node" msgstr "アセットの変更時にノードに追加" -#: accounts/const/automation.py:71 +#: accounts/const/automation.py:73 msgid "On user join group" msgstr "ユーザー変更時にユーザーグループに追加" -#: accounts/const/automation.py:79 +#: accounts/const/automation.py:81 msgid "On perm change" msgstr "権限が変更されたとき" -#: accounts/const/automation.py:86 +#: accounts/const/automation.py:88 msgid "Inherit from group or node" msgstr "ユーザーグループまたはアセットノードから継承" -#: accounts/const/automation.py:94 +#: accounts/const/automation.py:96 msgid "Create and push" msgstr "作成してプッシュ" -#: accounts/const/automation.py:95 +#: accounts/const/automation.py:97 msgid "Only create" msgstr "作成のみ" @@ -217,11 +217,11 @@ msgstr "ユーザー %s がパスワードを閲覧/導き出しました" #: accounts/models/account.py:48 #: accounts/models/automations/gather_account.py:16 -#: accounts/serializers/account/account.py:202 -#: accounts/serializers/account/account.py:247 +#: accounts/serializers/account/account.py:205 +#: accounts/serializers/account/account.py:250 #: accounts/serializers/account/gathered_account.py:10 -#: accounts/serializers/automations/change_secret.py:112 -#: accounts/serializers/automations/change_secret.py:132 +#: accounts/serializers/automations/change_secret.py:111 +#: accounts/serializers/automations/change_secret.py:131 #: acls/serializers/base.py:123 assets/models/asset/common.py:93 #: assets/models/asset/common.py:334 assets/models/cmd_filter.py:36 #: assets/serializers/domain.py:19 assets/serializers/label.py:27 @@ -236,10 +236,10 @@ msgstr "ユーザー %s がパスワードを閲覧/導き出しました" msgid "Asset" msgstr "資産" -#: accounts/models/account.py:52 accounts/models/template.py:17 -#: accounts/serializers/account/account.py:209 -#: accounts/serializers/account/account.py:257 -#: accounts/serializers/account/template.py:16 +#: accounts/models/account.py:52 accounts/models/template.py:15 +#: accounts/serializers/account/account.py:212 +#: accounts/serializers/account/account.py:260 +#: accounts/serializers/account/template.py:25 #: authentication/serializers/connect_token_secret.py:49 msgid "Su from" msgstr "から切り替え" @@ -250,7 +250,7 @@ msgstr "から切り替え" msgid "Version" msgstr "バージョン" -#: accounts/models/account.py:56 accounts/serializers/account/account.py:204 +#: accounts/models/account.py:56 accounts/serializers/account/account.py:207 #: users/models/user.py:846 msgid "Source" msgstr "ソース" @@ -260,8 +260,8 @@ msgid "Source ID" msgstr "ソース ID" #: accounts/models/account.py:60 -#: accounts/serializers/automations/change_secret.py:113 -#: accounts/serializers/automations/change_secret.py:133 +#: accounts/serializers/automations/change_secret.py:112 +#: accounts/serializers/automations/change_secret.py:132 #: acls/serializers/base.py:124 assets/serializers/asset/common.py:125 #: assets/serializers/gateway.py:28 audits/models.py:55 ops/models/base.py:18 #: perms/models/asset_permission.py:70 perms/serializers/permission.py:39 @@ -340,8 +340,8 @@ msgid "Reason" msgstr "理由" #: accounts/models/automations/backup_account.py:107 -#: accounts/serializers/automations/change_secret.py:111 -#: accounts/serializers/automations/change_secret.py:134 +#: accounts/serializers/automations/change_secret.py:110 +#: accounts/serializers/automations/change_secret.py:133 #: ops/serializers/job.py:56 terminal/serializers/session.py:46 msgid "Is success" msgstr "成功は" @@ -350,75 +350,49 @@ msgstr "成功は" msgid "Account backup execution" msgstr "アカウントバックアップの実行" -#: accounts/models/automations/base.py:19 +#: accounts/models/automations/base.py:18 msgid "Account automation task" msgstr "アカウント自動化タスク" -#: accounts/models/automations/base.py:33 +#: accounts/models/automations/base.py:32 msgid "Automation execution" msgstr "自動実行" -#: accounts/models/automations/base.py:34 +#: accounts/models/automations/base.py:33 msgid "Automation executions" msgstr "自動実行" -#: accounts/models/automations/base.py:36 +#: accounts/models/automations/base.py:35 msgid "Can view change secret execution" msgstr "改密実行の表示" -#: accounts/models/automations/base.py:37 +#: accounts/models/automations/base.py:36 msgid "Can add change secret execution" msgstr "改密実行の作成" -#: accounts/models/automations/base.py:39 +#: accounts/models/automations/base.py:38 msgid "Can view gather accounts execution" msgstr "コレクションアカウントの実行を表示" -#: accounts/models/automations/base.py:40 +#: accounts/models/automations/base.py:39 msgid "Can add gather accounts execution" msgstr "回収口座作成の実行" -#: accounts/models/automations/base.py:42 +#: accounts/models/automations/base.py:41 msgid "Can view push account execution" msgstr "プッシュ アカウントの実行を表示する" -#: accounts/models/automations/base.py:43 +#: accounts/models/automations/base.py:42 msgid "Can add push account execution" msgstr "プッシュ アカウントの作成の実行" -#: accounts/models/automations/base.py:55 accounts/models/template.py:21 -#: accounts/serializers/automations/change_secret.py:40 -msgid "Secret strategy" -msgstr "鍵ポリシー" - -#: accounts/models/automations/base.py:57 -msgid "Password rules" -msgstr "パスワードルール" - -#: accounts/models/automations/base.py:60 +#: accounts/models/automations/base.py:54 msgid "SSH key change strategy" msgstr "SSHキープッシュ方式" -#: accounts/models/automations/base.py:70 accounts/models/base.py:36 -#: accounts/serializers/account/account.py:429 -#: accounts/serializers/account/base.py:16 -#: accounts/serializers/automations/change_secret.py:46 -#: authentication/serializers/connect_token_secret.py:41 -#: authentication/serializers/connect_token_secret.py:50 -msgid "Secret type" -msgstr "鍵の種類" - -#: accounts/models/automations/base.py:72 accounts/models/mixins/vault.py:48 -#: accounts/serializers/account/base.py:19 -#: authentication/models/temp_token.py:10 -#: authentication/templates/authentication/_access_key_modal.html:31 -#: settings/serializers/auth/radius.py:19 -msgid "Secret" -msgstr "ひみつ" - #: accounts/models/automations/change_secret.py:15 #: accounts/serializers/account/backup.py:34 -#: accounts/serializers/automations/change_secret.py:57 +#: accounts/serializers/automations/change_secret.py:56 msgid "Recipient" msgstr "受信者" @@ -446,7 +420,7 @@ msgid "Date finished" msgstr "終了日" #: accounts/models/automations/change_secret.py:44 -#: accounts/serializers/account/account.py:249 assets/const/automation.py:8 +#: accounts/serializers/account/account.py:252 assets/const/automation.py:8 #: authentication/templates/authentication/passkey.html:173 #: authentication/views/base.py:26 authentication/views/base.py:27 #: authentication/views/base.py:28 common/const/choices.py:20 @@ -466,7 +440,7 @@ msgid "Date last login" msgstr "最終ログイン日" #: accounts/models/automations/gather_account.py:17 -#: accounts/models/automations/push_account.py:15 accounts/models/base.py:34 +#: accounts/models/automations/push_account.py:15 accounts/models/base.py:65 #: accounts/serializers/account/virtual.py:21 acls/serializers/base.py:19 #: acls/serializers/base.py:50 assets/models/_user.py:23 audits/models.py:180 #: authentication/forms.py:25 authentication/forms.py:27 @@ -516,7 +490,34 @@ msgstr "アカウントプッシュ" msgid "Verify asset account" msgstr "アカウントの確認" -#: accounts/models/base.py:33 accounts/serializers/account/virtual.py:20 +#: accounts/models/base.py:37 accounts/models/base.py:67 +#: accounts/serializers/account/account.py:432 +#: accounts/serializers/account/base.py:16 +#: accounts/serializers/automations/change_secret.py:45 +#: authentication/serializers/connect_token_secret.py:41 +#: authentication/serializers/connect_token_secret.py:50 +msgid "Secret type" +msgstr "鍵の種類" + +#: accounts/models/base.py:39 accounts/models/mixins/vault.py:48 +#: accounts/serializers/account/base.py:19 +#: authentication/models/temp_token.py:10 +#: authentication/templates/authentication/_access_key_modal.html:31 +#: settings/serializers/auth/radius.py:19 +msgid "Secret" +msgstr "ひみつ" + +#: accounts/models/base.py:42 +#: accounts/serializers/automations/change_secret.py:39 +msgid "Secret strategy" +msgstr "鍵ポリシー" + +#: accounts/models/base.py:44 accounts/serializers/account/template.py:22 +#: accounts/serializers/automations/change_secret.py:44 +msgid "Password rules" +msgstr "パスワードルール" + +#: accounts/models/base.py:64 accounts/serializers/account/virtual.py:20 #: acls/models/base.py:35 acls/models/base.py:96 acls/models/command_acl.py:21 #: acls/serializers/base.py:35 applications/models.py:9 #: assets/models/_user.py:22 assets/models/asset/common.py:91 @@ -541,11 +542,11 @@ msgstr "アカウントの確認" msgid "Name" msgstr "名前" -#: accounts/models/base.py:38 +#: accounts/models/base.py:69 msgid "Privileged" msgstr "特権アカウント" -#: accounts/models/base.py:39 assets/models/asset/common.py:156 +#: accounts/models/base.py:70 assets/models/asset/common.py:156 #: assets/models/automations/base.py:21 assets/models/cmd_filter.py:39 #: assets/models/label.py:22 #: authentication/serializers/connect_token_secret.py:114 @@ -554,27 +555,27 @@ msgstr "特権アカウント" msgid "Is active" msgstr "アクティブです。" -#: accounts/models/template.py:23 assets/models/_user.py:53 +#: accounts/models/template.py:17 assets/models/_user.py:53 msgid "Auto push" msgstr "オートプッシュ" -#: accounts/models/template.py:26 +#: accounts/models/template.py:20 msgid "Platforms" msgstr "プラットフォーム" -#: accounts/models/template.py:28 +#: accounts/models/template.py:22 msgid "Push params" msgstr "パラメータをプッシュする" -#: accounts/models/template.py:31 xpack/plugins/cloud/models.py:325 +#: accounts/models/template.py:25 xpack/plugins/cloud/models.py:325 msgid "Account template" msgstr "アカウント テンプレート" -#: accounts/models/template.py:36 +#: accounts/models/template.py:30 msgid "Can view asset account template secret" msgstr "アセット アカウント テンプレートのパスワードを表示できます" -#: accounts/models/template.py:37 +#: accounts/models/template.py:31 msgid "Can change asset account template secret" msgstr "アセット アカウント テンプレートのパスワードを変更できます" @@ -656,7 +657,7 @@ msgstr "今すぐプッシュ" msgid "Exist policy" msgstr "アカウントの存在ポリシー" -#: accounts/serializers/account/account.py:182 applications/models.py:11 +#: accounts/serializers/account/account.py:185 applications/models.py:11 #: assets/models/label.py:21 assets/models/platform.py:89 #: assets/serializers/asset/common.py:121 assets/serializers/cagegory.py:8 #: assets/serializers/platform.py:133 assets/serializers/platform.py:229 @@ -665,7 +666,7 @@ msgstr "アカウントの存在ポリシー" msgid "Category" msgstr "カテゴリ" -#: accounts/serializers/account/account.py:183 +#: accounts/serializers/account/account.py:186 #: accounts/serializers/automations/base.py:54 acls/models/command_acl.py:24 #: acls/serializers/command_acl.py:18 applications/models.py:14 #: assets/models/_user.py:50 assets/models/automations/base.py:20 @@ -685,26 +686,26 @@ msgstr "カテゴリ" msgid "Type" msgstr "タイプ" -#: accounts/serializers/account/account.py:198 +#: accounts/serializers/account/account.py:201 msgid "Asset not found" msgstr "資産が存在しません" -#: accounts/serializers/account/account.py:238 +#: accounts/serializers/account/account.py:241 msgid "Has secret" msgstr "エスクローされたパスワード" -#: accounts/serializers/account/account.py:248 ops/models/celery.py:60 +#: accounts/serializers/account/account.py:251 ops/models/celery.py:60 #: tickets/models/comment.py:13 tickets/models/ticket/general.py:45 #: tickets/models/ticket/general.py:279 tickets/serializers/super_ticket.py:14 #: tickets/serializers/ticket/ticket.py:21 msgid "State" msgstr "状態" -#: accounts/serializers/account/account.py:250 +#: accounts/serializers/account/account.py:253 msgid "Changed" msgstr "編集済み" -#: accounts/serializers/account/account.py:260 +#: accounts/serializers/account/account.py:263 #: accounts/serializers/automations/base.py:22 acls/models/base.py:97 #: assets/models/automations/base.py:19 #: assets/serializers/automations/base.py:20 ops/models/base.py:17 @@ -713,27 +714,27 @@ msgstr "編集済み" msgid "Assets" msgstr "資産" -#: accounts/serializers/account/account.py:315 +#: accounts/serializers/account/account.py:318 msgid "Account already exists" msgstr "アカウントはすでに存在しています" -#: accounts/serializers/account/account.py:365 +#: accounts/serializers/account/account.py:368 #, python-format msgid "Asset does not support this secret type: %s" msgstr "アセットはアカウント タイプをサポートしていません: %s" -#: accounts/serializers/account/account.py:397 +#: accounts/serializers/account/account.py:400 msgid "Account has exist" msgstr "アカウントはすでに存在しています" -#: accounts/serializers/account/account.py:430 +#: accounts/serializers/account/account.py:433 #: authentication/serializers/connect_token_secret.py:156 #: authentication/templates/authentication/_access_key_modal.html:30 #: perms/models/perm_node.py:21 users/serializers/group.py:31 msgid "ID" msgstr "ID" -#: accounts/serializers/account/account.py:437 acls/serializers/base.py:116 +#: accounts/serializers/account/account.py:440 acls/serializers/base.py:116 #: assets/models/cmd_filter.py:24 assets/models/label.py:16 audits/models.py:50 #: audits/models.py:86 audits/models.py:164 audits/models.py:262 #: audits/serializers.py:171 authentication/models/connection_token.py:32 @@ -752,7 +753,7 @@ msgstr "ID" msgid "User" msgstr "ユーザー" -#: accounts/serializers/account/account.py:438 +#: accounts/serializers/account/account.py:441 #: authentication/templates/authentication/_access_key_modal.html:33 #: terminal/notifications.py:158 terminal/notifications.py:207 msgid "Date" @@ -771,7 +772,7 @@ msgid "Executed amount" msgstr "実行回数" #: accounts/serializers/account/backup.py:35 -#: accounts/serializers/automations/change_secret.py:58 +#: accounts/serializers/automations/change_secret.py:57 msgid "Currently only mail sending is supported" msgstr "現在、メール送信のみがサポートされています" @@ -796,15 +797,39 @@ msgstr "" "ヒント: 認証にユーザー名が必要ない場合は、`null`を入力します。ADアカウントの" "場合は、`username@domain`のようになります。" -#: accounts/serializers/account/template.py:27 +#: accounts/serializers/account/template.py:11 +#, fuzzy +#| msgid "Password strength" +msgid "Password length" +msgstr "パスワードの強さ" + +#: accounts/serializers/account/template.py:12 +#, fuzzy +#| msgid "Powershell" +msgid "Lowercase" +msgstr "PowerShell" + +#: accounts/serializers/account/template.py:13 +msgid "Uppercase" +msgstr "" + +#: accounts/serializers/account/template.py:14 +msgid "Digit" +msgstr "" + +#: accounts/serializers/account/template.py:15 +msgid "Special symbol" +msgstr "" + +#: accounts/serializers/account/template.py:36 msgid "Secret generation strategy for account creation" msgstr "账号创建时,密文生成策略" -#: accounts/serializers/account/template.py:28 +#: accounts/serializers/account/template.py:37 msgid "Whether to automatically push the account to the asset" msgstr "是否自动推送账号到资产" -#: accounts/serializers/account/template.py:30 +#: accounts/serializers/account/template.py:40 msgid "" "Associated platform, you can configure push parameters. If not associated, " "default parameters will be used" @@ -852,24 +877,24 @@ msgstr "名前は既に存在します。" msgid "Automation snapshot" msgstr "自動スナップショット" -#: accounts/serializers/automations/change_secret.py:43 +#: accounts/serializers/automations/change_secret.py:42 msgid "SSH Key strategy" msgstr "SSHキー戦略" -#: accounts/serializers/automations/change_secret.py:81 +#: accounts/serializers/automations/change_secret.py:80 msgid "* Please enter the correct password length" msgstr "* 正しいパスワードの長さを入力してください" -#: accounts/serializers/automations/change_secret.py:85 +#: accounts/serializers/automations/change_secret.py:84 msgid "* Password length range 6-30 bits" msgstr "* パスワードの長さの範囲6-30ビット" -#: accounts/serializers/automations/change_secret.py:115 +#: accounts/serializers/automations/change_secret.py:114 #: assets/models/automations/base.py:127 msgid "Automation task execution" msgstr "自動タスク実行履歴" -#: accounts/serializers/automations/change_secret.py:155 audits/const.py:54 +#: accounts/serializers/automations/change_secret.py:154 audits/const.py:54 #: audits/models.py:60 audits/signal_handlers/activity_log.py:33 #: common/const/choices.py:18 ops/const.py:60 ops/serializers/celery.py:40 #: terminal/const.py:76 terminal/models/session/sharing.py:121 @@ -910,23 +935,23 @@ msgstr "アセット アカウントの可用性を確認する" msgid "Verify accounts connectivity" msgstr "アカウント接続のテスト" -#: accounts/utils.py:41 +#: accounts/utils.py:46 msgid "Password can not contains `{{` " msgstr "パスワードには '{{' を含まない" -#: accounts/utils.py:43 +#: accounts/utils.py:48 msgid "Password can not contains `{%` " msgstr "パスワードには '{%' を含まない" -#: accounts/utils.py:46 +#: accounts/utils.py:51 msgid "Password can not contains `'` " msgstr "パスワードには `'` を含まない" -#: accounts/utils.py:48 +#: accounts/utils.py:53 msgid "Password can not contains `\"` " msgstr "パスワードには `\"` を含まない" -#: accounts/utils.py:54 +#: accounts/utils.py:59 msgid "private key invalid or passphrase error" msgstr "秘密鍵が無効またはpassphraseエラー" @@ -8434,5 +8459,8 @@ msgstr "エンタープライズプロフェッショナル版" msgid "Ultimate edition" msgstr "エンタープライズ・フラッグシップ・エディション" +#~ msgid "Random" +#~ msgstr "ランダム" + #~ msgid "Enterprise edition" #~ msgstr "エンタープライズ基本版" diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index fe1f503bf..49ba1548d 100644 --- a/apps/locale/zh/LC_MESSAGES/django.mo +++ b/apps/locale/zh/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f07bd3ce99241c56762a54ed058913995775ba4fa019b7713dd74f5a3ef75d22 -size 130862 +oid sha256:2492fc51a9dfef6fbeccd0ee4a8612d1c4e8bf3897fe518a6500c6bda4828f1a +size 130875 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 9ef78f3e1..8e15244d7 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: JumpServer 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-19 10:33+0800\n" +"POT-Creation-Date: 2023-09-19 10:39+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -22,7 +22,7 @@ msgid "The parameter 'action' must be [{}]" msgstr "参数 'action' 必须是 [{}]" #: accounts/const/account.py:6 -#: accounts/serializers/automations/change_secret.py:33 +#: accounts/serializers/automations/change_secret.py:32 #: assets/models/_user.py:24 audits/signal_handlers/login_log.py:35 #: authentication/confirm/password.py:9 authentication/forms.py:32 #: authentication/templates/authentication/login.html:286 @@ -35,7 +35,7 @@ msgid "Password" msgstr "密码" #: accounts/const/account.py:7 -#: accounts/serializers/automations/change_secret.py:34 +#: accounts/serializers/automations/change_secret.py:33 msgid "SSH key" msgstr "SSH 密钥" @@ -93,97 +93,97 @@ msgid "Update" msgstr "更新" #: accounts/const/account.py:33 -#: accounts/serializers/automations/change_secret.py:156 audits/const.py:55 +#: accounts/serializers/automations/change_secret.py:155 audits/const.py:55 #: audits/signal_handlers/activity_log.py:33 common/const/choices.py:19 #: ops/const.py:62 terminal/const.py:77 xpack/plugins/cloud/const.py:43 msgid "Failed" msgstr "失败" -#: accounts/const/automation.py:22 rbac/tree.py:50 +#: accounts/const/automation.py:24 rbac/tree.py:50 msgid "Push account" msgstr "账号推送" -#: accounts/const/automation.py:23 +#: accounts/const/automation.py:25 msgid "Change secret" msgstr "更改密码" -#: accounts/const/automation.py:24 +#: accounts/const/automation.py:26 msgid "Verify account" msgstr "验证账号" -#: accounts/const/automation.py:25 +#: accounts/const/automation.py:27 msgid "Gather accounts" msgstr "收集账号" -#: accounts/const/automation.py:26 +#: accounts/const/automation.py:28 msgid "Verify gateway account" msgstr "验证网关账号" -#: accounts/const/automation.py:44 -msgid "Specific password" +#: accounts/const/automation.py:46 +msgid "Specific secret" msgstr "指定" -#: accounts/const/automation.py:45 -msgid "Random" -msgstr "随机" +#: accounts/const/automation.py:47 +msgid "Random generate" +msgstr "随机生成" -#: accounts/const/automation.py:49 ops/const.py:13 +#: accounts/const/automation.py:51 ops/const.py:13 msgid "Append SSH KEY" msgstr "追加" -#: accounts/const/automation.py:50 ops/const.py:14 +#: accounts/const/automation.py:52 ops/const.py:14 msgid "Empty and append SSH KEY" msgstr "清空所有并添加" -#: accounts/const/automation.py:51 ops/const.py:15 +#: accounts/const/automation.py:53 ops/const.py:15 msgid "Replace (Replace only keys pushed by JumpServer) " msgstr "替换 (只替换由 JumpServer 推送的密钥)" -#: accounts/const/automation.py:56 +#: accounts/const/automation.py:58 msgid "On asset create" msgstr "资产创建时" -#: accounts/const/automation.py:59 +#: accounts/const/automation.py:61 msgid "On perm add user" msgstr "授权变更时添加用户" -#: accounts/const/automation.py:61 +#: accounts/const/automation.py:63 msgid "On perm add user group" msgstr "授权变更时添加用户组" -#: accounts/const/automation.py:63 +#: accounts/const/automation.py:65 msgid "On perm add asset" msgstr "授权变更时添加资产" -#: accounts/const/automation.py:65 +#: accounts/const/automation.py:67 msgid "On perm add node" msgstr "授权变更时添加节点" -#: accounts/const/automation.py:67 +#: accounts/const/automation.py:69 msgid "On perm add account" msgstr "授权变更时添加账号" -#: accounts/const/automation.py:69 +#: accounts/const/automation.py:71 msgid "On asset join node" msgstr "资产变更时添加到节点" -#: accounts/const/automation.py:71 +#: accounts/const/automation.py:73 msgid "On user join group" msgstr "用户变更时添加到用户组" -#: accounts/const/automation.py:79 +#: accounts/const/automation.py:81 msgid "On perm change" msgstr "授权变更时" -#: accounts/const/automation.py:86 +#: accounts/const/automation.py:88 msgid "Inherit from group or node" msgstr "继承自用户组或资产节点" -#: accounts/const/automation.py:94 +#: accounts/const/automation.py:96 msgid "Create and push" msgstr "创建并推送" -#: accounts/const/automation.py:95 +#: accounts/const/automation.py:97 msgid "Only create" msgstr "仅创建" @@ -216,11 +216,11 @@ msgstr "用户 %s 查看/导出 了密码" #: accounts/models/account.py:48 #: accounts/models/automations/gather_account.py:16 -#: accounts/serializers/account/account.py:202 -#: accounts/serializers/account/account.py:247 +#: accounts/serializers/account/account.py:205 +#: accounts/serializers/account/account.py:250 #: accounts/serializers/account/gathered_account.py:10 -#: accounts/serializers/automations/change_secret.py:112 -#: accounts/serializers/automations/change_secret.py:132 +#: accounts/serializers/automations/change_secret.py:111 +#: accounts/serializers/automations/change_secret.py:131 #: acls/serializers/base.py:123 assets/models/asset/common.py:93 #: assets/models/asset/common.py:334 assets/models/cmd_filter.py:36 #: assets/serializers/domain.py:19 assets/serializers/label.py:27 @@ -235,10 +235,10 @@ msgstr "用户 %s 查看/导出 了密码" msgid "Asset" msgstr "资产" -#: accounts/models/account.py:52 accounts/models/template.py:17 -#: accounts/serializers/account/account.py:209 -#: accounts/serializers/account/account.py:257 -#: accounts/serializers/account/template.py:16 +#: accounts/models/account.py:52 accounts/models/template.py:15 +#: accounts/serializers/account/account.py:212 +#: accounts/serializers/account/account.py:260 +#: accounts/serializers/account/template.py:25 #: authentication/serializers/connect_token_secret.py:49 msgid "Su from" msgstr "切换自" @@ -249,7 +249,7 @@ msgstr "切换自" msgid "Version" msgstr "版本" -#: accounts/models/account.py:56 accounts/serializers/account/account.py:204 +#: accounts/models/account.py:56 accounts/serializers/account/account.py:207 #: users/models/user.py:846 msgid "Source" msgstr "来源" @@ -259,8 +259,8 @@ msgid "Source ID" msgstr "来源 ID" #: accounts/models/account.py:60 -#: accounts/serializers/automations/change_secret.py:113 -#: accounts/serializers/automations/change_secret.py:133 +#: accounts/serializers/automations/change_secret.py:112 +#: accounts/serializers/automations/change_secret.py:132 #: acls/serializers/base.py:124 assets/serializers/asset/common.py:125 #: assets/serializers/gateway.py:28 audits/models.py:55 ops/models/base.py:18 #: perms/models/asset_permission.py:70 perms/serializers/permission.py:39 @@ -339,8 +339,8 @@ msgid "Reason" msgstr "原因" #: accounts/models/automations/backup_account.py:107 -#: accounts/serializers/automations/change_secret.py:111 -#: accounts/serializers/automations/change_secret.py:134 +#: accounts/serializers/automations/change_secret.py:110 +#: accounts/serializers/automations/change_secret.py:133 #: ops/serializers/job.py:56 terminal/serializers/session.py:46 msgid "Is success" msgstr "是否成功" @@ -349,75 +349,49 @@ msgstr "是否成功" msgid "Account backup execution" msgstr "账号备份执行" -#: accounts/models/automations/base.py:19 +#: accounts/models/automations/base.py:18 msgid "Account automation task" msgstr "账号自动化任务" -#: accounts/models/automations/base.py:33 +#: accounts/models/automations/base.py:32 msgid "Automation execution" msgstr "自动化执行" -#: accounts/models/automations/base.py:34 +#: accounts/models/automations/base.py:33 msgid "Automation executions" msgstr "自动化执行" -#: accounts/models/automations/base.py:36 +#: accounts/models/automations/base.py:35 msgid "Can view change secret execution" msgstr "查看改密执行" -#: accounts/models/automations/base.py:37 +#: accounts/models/automations/base.py:36 msgid "Can add change secret execution" msgstr "创建改密执行" -#: accounts/models/automations/base.py:39 +#: accounts/models/automations/base.py:38 msgid "Can view gather accounts execution" msgstr "查看收集账号执行" -#: accounts/models/automations/base.py:40 +#: accounts/models/automations/base.py:39 msgid "Can add gather accounts execution" msgstr "创建收集账号执行" -#: accounts/models/automations/base.py:42 +#: accounts/models/automations/base.py:41 msgid "Can view push account execution" msgstr "查看推送账号执行" -#: accounts/models/automations/base.py:43 +#: accounts/models/automations/base.py:42 msgid "Can add push account execution" msgstr "创建推送账号执行" -#: accounts/models/automations/base.py:55 accounts/models/template.py:21 -#: accounts/serializers/automations/change_secret.py:40 -msgid "Secret strategy" -msgstr "密文策略" - -#: accounts/models/automations/base.py:57 -msgid "Password rules" -msgstr "密码规则" - -#: accounts/models/automations/base.py:60 +#: accounts/models/automations/base.py:54 msgid "SSH key change strategy" msgstr "SSH 密钥推送方式" -#: accounts/models/automations/base.py:70 accounts/models/base.py:36 -#: accounts/serializers/account/account.py:429 -#: accounts/serializers/account/base.py:16 -#: accounts/serializers/automations/change_secret.py:46 -#: authentication/serializers/connect_token_secret.py:41 -#: authentication/serializers/connect_token_secret.py:50 -msgid "Secret type" -msgstr "密文类型" - -#: accounts/models/automations/base.py:72 accounts/models/mixins/vault.py:48 -#: accounts/serializers/account/base.py:19 -#: authentication/models/temp_token.py:10 -#: authentication/templates/authentication/_access_key_modal.html:31 -#: settings/serializers/auth/radius.py:19 -msgid "Secret" -msgstr "密钥" - #: accounts/models/automations/change_secret.py:15 #: accounts/serializers/account/backup.py:34 -#: accounts/serializers/automations/change_secret.py:57 +#: accounts/serializers/automations/change_secret.py:56 msgid "Recipient" msgstr "收件人" @@ -445,7 +419,7 @@ msgid "Date finished" msgstr "结束日期" #: accounts/models/automations/change_secret.py:44 -#: accounts/serializers/account/account.py:249 assets/const/automation.py:8 +#: accounts/serializers/account/account.py:252 assets/const/automation.py:8 #: authentication/templates/authentication/passkey.html:173 #: authentication/views/base.py:26 authentication/views/base.py:27 #: authentication/views/base.py:28 common/const/choices.py:20 @@ -465,7 +439,7 @@ msgid "Date last login" msgstr "最后登录日期" #: accounts/models/automations/gather_account.py:17 -#: accounts/models/automations/push_account.py:15 accounts/models/base.py:34 +#: accounts/models/automations/push_account.py:15 accounts/models/base.py:65 #: accounts/serializers/account/virtual.py:21 acls/serializers/base.py:19 #: acls/serializers/base.py:50 assets/models/_user.py:23 audits/models.py:180 #: authentication/forms.py:25 authentication/forms.py:27 @@ -515,7 +489,34 @@ msgstr "账号推送" msgid "Verify asset account" msgstr "账号验证" -#: accounts/models/base.py:33 accounts/serializers/account/virtual.py:20 +#: accounts/models/base.py:37 accounts/models/base.py:67 +#: accounts/serializers/account/account.py:432 +#: accounts/serializers/account/base.py:16 +#: accounts/serializers/automations/change_secret.py:45 +#: authentication/serializers/connect_token_secret.py:41 +#: authentication/serializers/connect_token_secret.py:50 +msgid "Secret type" +msgstr "密文类型" + +#: accounts/models/base.py:39 accounts/models/mixins/vault.py:48 +#: accounts/serializers/account/base.py:19 +#: authentication/models/temp_token.py:10 +#: authentication/templates/authentication/_access_key_modal.html:31 +#: settings/serializers/auth/radius.py:19 +msgid "Secret" +msgstr "密钥" + +#: accounts/models/base.py:42 +#: accounts/serializers/automations/change_secret.py:39 +msgid "Secret strategy" +msgstr "密文策略" + +#: accounts/models/base.py:44 accounts/serializers/account/template.py:22 +#: accounts/serializers/automations/change_secret.py:44 +msgid "Password rules" +msgstr "密码规则" + +#: accounts/models/base.py:64 accounts/serializers/account/virtual.py:20 #: acls/models/base.py:35 acls/models/base.py:96 acls/models/command_acl.py:21 #: acls/serializers/base.py:35 applications/models.py:9 #: assets/models/_user.py:22 assets/models/asset/common.py:91 @@ -540,11 +541,11 @@ msgstr "账号验证" msgid "Name" msgstr "名称" -#: accounts/models/base.py:38 +#: accounts/models/base.py:69 msgid "Privileged" msgstr "特权账号" -#: accounts/models/base.py:39 assets/models/asset/common.py:156 +#: accounts/models/base.py:70 assets/models/asset/common.py:156 #: assets/models/automations/base.py:21 assets/models/cmd_filter.py:39 #: assets/models/label.py:22 #: authentication/serializers/connect_token_secret.py:114 @@ -553,27 +554,27 @@ msgstr "特权账号" msgid "Is active" msgstr "激活" -#: accounts/models/template.py:23 assets/models/_user.py:53 +#: accounts/models/template.py:17 assets/models/_user.py:53 msgid "Auto push" msgstr "自动推送" -#: accounts/models/template.py:26 +#: accounts/models/template.py:20 msgid "Platforms" msgstr "系统平台" -#: accounts/models/template.py:28 +#: accounts/models/template.py:22 msgid "Push params" msgstr "账号推送参数" -#: accounts/models/template.py:31 xpack/plugins/cloud/models.py:325 +#: accounts/models/template.py:25 xpack/plugins/cloud/models.py:325 msgid "Account template" msgstr "账号模版" -#: accounts/models/template.py:36 +#: accounts/models/template.py:30 msgid "Can view asset account template secret" msgstr "可以查看资产账号模版密码" -#: accounts/models/template.py:37 +#: accounts/models/template.py:31 msgid "Can change asset account template secret" msgstr "可以更改资产账号模版密码" @@ -654,7 +655,7 @@ msgstr "立即推送" msgid "Exist policy" msgstr "账号存在策略" -#: accounts/serializers/account/account.py:182 applications/models.py:11 +#: accounts/serializers/account/account.py:185 applications/models.py:11 #: assets/models/label.py:21 assets/models/platform.py:89 #: assets/serializers/asset/common.py:121 assets/serializers/cagegory.py:8 #: assets/serializers/platform.py:133 assets/serializers/platform.py:229 @@ -663,7 +664,7 @@ msgstr "账号存在策略" msgid "Category" msgstr "类别" -#: accounts/serializers/account/account.py:183 +#: accounts/serializers/account/account.py:186 #: accounts/serializers/automations/base.py:54 acls/models/command_acl.py:24 #: acls/serializers/command_acl.py:18 applications/models.py:14 #: assets/models/_user.py:50 assets/models/automations/base.py:20 @@ -683,26 +684,26 @@ msgstr "类别" msgid "Type" msgstr "类型" -#: accounts/serializers/account/account.py:198 +#: accounts/serializers/account/account.py:201 msgid "Asset not found" msgstr "资产不存在" -#: accounts/serializers/account/account.py:238 +#: accounts/serializers/account/account.py:241 msgid "Has secret" msgstr "已托管密码" -#: accounts/serializers/account/account.py:248 ops/models/celery.py:60 +#: accounts/serializers/account/account.py:251 ops/models/celery.py:60 #: tickets/models/comment.py:13 tickets/models/ticket/general.py:45 #: tickets/models/ticket/general.py:279 tickets/serializers/super_ticket.py:14 #: tickets/serializers/ticket/ticket.py:21 msgid "State" msgstr "状态" -#: accounts/serializers/account/account.py:250 +#: accounts/serializers/account/account.py:253 msgid "Changed" msgstr "已修改" -#: accounts/serializers/account/account.py:260 +#: accounts/serializers/account/account.py:263 #: accounts/serializers/automations/base.py:22 acls/models/base.py:97 #: assets/models/automations/base.py:19 #: assets/serializers/automations/base.py:20 ops/models/base.py:17 @@ -711,27 +712,27 @@ msgstr "已修改" msgid "Assets" msgstr "资产" -#: accounts/serializers/account/account.py:315 +#: accounts/serializers/account/account.py:318 msgid "Account already exists" msgstr "账号已存在" -#: accounts/serializers/account/account.py:365 +#: accounts/serializers/account/account.py:368 #, python-format msgid "Asset does not support this secret type: %s" msgstr "资产不支持账号类型: %s" -#: accounts/serializers/account/account.py:397 +#: accounts/serializers/account/account.py:400 msgid "Account has exist" msgstr "账号已存在" -#: accounts/serializers/account/account.py:430 +#: accounts/serializers/account/account.py:433 #: authentication/serializers/connect_token_secret.py:156 #: authentication/templates/authentication/_access_key_modal.html:30 #: perms/models/perm_node.py:21 users/serializers/group.py:31 msgid "ID" msgstr "ID" -#: accounts/serializers/account/account.py:437 acls/serializers/base.py:116 +#: accounts/serializers/account/account.py:440 acls/serializers/base.py:116 #: assets/models/cmd_filter.py:24 assets/models/label.py:16 audits/models.py:50 #: audits/models.py:86 audits/models.py:164 audits/models.py:262 #: audits/serializers.py:171 authentication/models/connection_token.py:32 @@ -750,7 +751,7 @@ msgstr "ID" msgid "User" msgstr "用户" -#: accounts/serializers/account/account.py:438 +#: accounts/serializers/account/account.py:441 #: authentication/templates/authentication/_access_key_modal.html:33 #: terminal/notifications.py:158 terminal/notifications.py:207 msgid "Date" @@ -769,7 +770,7 @@ msgid "Executed amount" msgstr "执行次数" #: accounts/serializers/account/backup.py:35 -#: accounts/serializers/automations/change_secret.py:58 +#: accounts/serializers/automations/change_secret.py:57 msgid "Currently only mail sending is supported" msgstr "当前只支持邮件发送" @@ -794,15 +795,39 @@ msgstr "" "提示: 如果认证时不需要用户名,可填写为 null, 如果是 AD 账号,格式为 " "username@domain" -#: accounts/serializers/account/template.py:27 +#: accounts/serializers/account/template.py:11 +#, fuzzy +#| msgid "Password strength" +msgid "Password length" +msgstr "密码强度:" + +#: accounts/serializers/account/template.py:12 +#, fuzzy +#| msgid "Powershell" +msgid "Lowercase" +msgstr "PowerShell" + +#: accounts/serializers/account/template.py:13 +msgid "Uppercase" +msgstr "" + +#: accounts/serializers/account/template.py:14 +msgid "Digit" +msgstr "" + +#: accounts/serializers/account/template.py:15 +msgid "Special symbol" +msgstr "" + +#: accounts/serializers/account/template.py:36 msgid "Secret generation strategy for account creation" msgstr "密码生成策略,用于账号创建时,设置密码" -#: accounts/serializers/account/template.py:28 +#: accounts/serializers/account/template.py:37 msgid "Whether to automatically push the account to the asset" msgstr "是否自动推送账号到资产" -#: accounts/serializers/account/template.py:30 +#: accounts/serializers/account/template.py:40 msgid "" "Associated platform, you can configure push parameters. If not associated, " "default parameters will be used" @@ -849,24 +874,24 @@ msgstr "名称已存在" msgid "Automation snapshot" msgstr "自动化快照" -#: accounts/serializers/automations/change_secret.py:43 +#: accounts/serializers/automations/change_secret.py:42 msgid "SSH Key strategy" msgstr "SSH 密钥更改方式" -#: accounts/serializers/automations/change_secret.py:81 +#: accounts/serializers/automations/change_secret.py:80 msgid "* Please enter the correct password length" msgstr "* 请输入正确的密码长度" -#: accounts/serializers/automations/change_secret.py:85 +#: accounts/serializers/automations/change_secret.py:84 msgid "* Password length range 6-30 bits" msgstr "* 密码长度范围 6-30 位" -#: accounts/serializers/automations/change_secret.py:115 +#: accounts/serializers/automations/change_secret.py:114 #: assets/models/automations/base.py:127 msgid "Automation task execution" msgstr "自动化任务执行历史" -#: accounts/serializers/automations/change_secret.py:155 audits/const.py:54 +#: accounts/serializers/automations/change_secret.py:154 audits/const.py:54 #: audits/models.py:60 audits/signal_handlers/activity_log.py:33 #: common/const/choices.py:18 ops/const.py:60 ops/serializers/celery.py:40 #: terminal/const.py:76 terminal/models/session/sharing.py:121 @@ -907,23 +932,23 @@ msgstr "验证资产账号可用性" msgid "Verify accounts connectivity" msgstr "测试账号可连接性" -#: accounts/utils.py:41 +#: accounts/utils.py:46 msgid "Password can not contains `{{` " msgstr "密码不能包含 `{{` 字符" -#: accounts/utils.py:43 +#: accounts/utils.py:48 msgid "Password can not contains `{%` " msgstr "密码不能包含 `{%` 字符" -#: accounts/utils.py:46 +#: accounts/utils.py:51 msgid "Password can not contains `'` " msgstr "密码不能包含 `'` 字符" -#: accounts/utils.py:48 +#: accounts/utils.py:53 msgid "Password can not contains `\"` " msgstr "密码不能包含 `\"` 字符" -#: accounts/utils.py:54 +#: accounts/utils.py:59 msgid "private key invalid or passphrase error" msgstr "密钥不合法或密钥密码错误" @@ -8318,3 +8343,7 @@ msgstr "企业专业版" #: xpack/plugins/license/models.py:86 msgid "Ultimate edition" msgstr "企业旗舰版" + + +#~ msgid "Random" +#~ msgstr "随机"