#
import samba.getopt as options
-from samba.netcmd import Command, CommandError, Option, SuperCommand
-from samba.domain.models import (AuthenticationPolicy,
- AuthenticationSilo, Group,
- MAX_TGT_LIFETIME, MIN_TGT_LIFETIME,
- StrongNTLMPolicy)
+from samba.domain.models import (MAX_TGT_LIFETIME, MIN_TGT_LIFETIME,
+ AuthenticationPolicy, AuthenticationSilo,
+ Group, StrongNTLMPolicy)
from samba.domain.models.exceptions import ModelError
+from samba.netcmd import Command, CommandError, Option, SuperCommand
from samba.netcmd.validators import Range
#
import samba.getopt as options
-from samba.netcmd import Command, CommandError, Option, SuperCommand
from samba.domain.models import AuthenticationPolicy, AuthenticationSilo
from samba.domain.models.exceptions import ModelError
+from samba.netcmd import Command, CommandError, Option, SuperCommand
from .silo_member import cmd_domain_auth_silo_member
#
import samba.getopt as options
-from samba.netcmd import Command, CommandError, Option, SuperCommand
from samba.domain.models import AuthenticationSilo, User
from samba.domain.models.exceptions import ModelError
+from samba.netcmd import Command, CommandError, Option, SuperCommand
class cmd_domain_auth_silo_member_grant(Command):
#
import samba.getopt as options
-from samba.netcmd import Command, CommandError, Option, SuperCommand
-from samba.domain.models import AttributeSchema, ClassSchema, ClaimType, ValueType
+from samba.domain.models import AttributeSchema, ClaimType, ClassSchema, ValueType
from samba.domain.models.exceptions import ModelError
+from samba.netcmd import Command, CommandError, Option, SuperCommand
class cmd_domain_claim_claim_type_create(Command):
#
import samba.getopt as options
-from samba.netcmd import Command, CommandError, Option, SuperCommand
from samba.domain.models import ValueType
from samba.domain.models.exceptions import ModelError
+from samba.netcmd import Command, CommandError, Option, SuperCommand
class cmd_domain_claim_value_type_list(Command):
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from samba.getopt import CredentialsOptions, HostOptions, Option, SambaOptions
-from samba.netcmd import Command, CommandError, SuperCommand
from samba.domain.models import Group, GroupManagedServiceAccount, Model, User
from samba.domain.models.exceptions import ModelError
+from samba.getopt import CredentialsOptions, HostOptions, Option, SambaOptions
+from samba.netcmd import Command, CommandError, SuperCommand
class cmd_service_account_group_msa_membership_show(Command):
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-from samba.getopt import CredentialsOptions, HostOptions, Option, SambaOptions
-from samba.netcmd import Command, CommandError
from samba.domain.models import (AccountType, Computer, Group,
GroupManagedServiceAccount,
SupportedEncryptionTypes, User)
from samba.domain.models.exceptions import ModelError
+from samba.getopt import CredentialsOptions, HostOptions, Option, SambaOptions
+from samba.netcmd import Command, CommandError
class cmd_service_account_list(Command):
import samba.getopt as options
from samba import version
-from samba.netcmd import Command
from samba.domain.models import MODELS
+from samba.netcmd import Command
class cmd_shell(Command):
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-from samba import sites, subnets
import samba.getopt as options
-from samba.netcmd import (
- Command,
- CommandError,
- SuperCommand,
- Option,
-)
+from samba import sites, subnets
from samba.domain.models import Site, Subnet
from samba.domain.models.exceptions import ModelError
+from samba.netcmd import Command, CommandError, Option, SuperCommand
class cmd_sites_list(Command):
#
import samba.getopt as options
-from samba.netcmd import Command, CommandError, Option, SuperCommand
from samba.domain.models import AuthenticationPolicy, User
from samba.domain.models.exceptions import ModelError
+from samba.netcmd import Command, CommandError, Option, SuperCommand
class cmd_user_auth_policy_assign(Command):
#
import samba.getopt as options
-from samba.netcmd import Command, CommandError, Option, SuperCommand
from samba.domain.models import AuthenticationSilo, User
from samba.domain.models.exceptions import ModelError
+from samba.netcmd import Command, CommandError, Option, SuperCommand
class cmd_user_auth_silo_assign(Command):
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-import sys
import os
+import sys
sys.path.insert(0, 'bin/python')
os.environ['PYTHONUNBUFFERED'] = '1'
-from datetime import datetime
-from enum import Enum
import random
import re
+from datetime import datetime
+from enum import Enum
import ldb
+import samba.tests
+import samba.tests.krb5.kcrypto as kcrypto
+import samba.tests.krb5.rfc4120_pyasn1 as krb5_asn1
from samba import dsdb, ntstatus
from samba.dcerpc import netlogon, security
from samba.dcerpc import windows_event_ids as win_event
-from samba.ndr import ndr_pack
from samba.domain.models import AuthenticationPolicy, AuthenticationSilo
-
-import samba.tests
-import samba.tests.krb5.kcrypto as kcrypto
from samba.hresult import HRES_SEC_E_INVALID_TOKEN, HRES_SEC_E_LOGON_DENIED
+from samba.ndr import ndr_pack
+from samba.tests.auth_log_base import AuthLogTestBase, NoMessageException
from samba.tests.krb5.kdc_base_test import GroupType
from samba.tests.krb5.kdc_tgs_tests import KdcTgsBaseTests
-from samba.tests.auth_log_base import AuthLogTestBase, NoMessageException
from samba.tests.krb5.raw_testcase import RawKerberosTest
from samba.tests.krb5.rfc4120_constants import (
FX_FAST_ARMOR_AP_REQUEST,
NT_SRV_INST,
PADATA_FX_FAST,
)
-import samba.tests.krb5.rfc4120_pyasn1 as krb5_asn1
SidType = RawKerberosTest.SidType
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-import sys
import os
+import sys
sys.path.insert(0, "bin/python")
os.environ["PYTHONUNBUFFERED"] = "1"
import binascii
import collections
-from datetime import datetime, timezone
-from enum import Enum
-from functools import partial
import numbers
import secrets
import tempfile
+from collections import namedtuple
+from datetime import datetime, timezone
+from enum import Enum
+from functools import partial
from typing import Optional
-from collections import namedtuple
import ldb
from ldb import SCOPE_BASE
+
from samba import (
NTSTATUSError,
arcfour_encrypt,
common,
generate_random_password,
+ net,
ntstatus,
)
from samba.auth import system_session
from samba.credentials import (
- Credentials,
DONT_USE_KERBEROS,
MUST_USE_KERBEROS,
SPECIFIED,
+ Credentials,
)
from samba.crypto import des_crypt_blob_16, md4_hash_blob
from samba.dcerpc import (
samr,
security,
)
+from samba.dcerpc.misc import SEC_CHAN_BDC, SEC_CHAN_NULL, SEC_CHAN_WKSTA
+from samba.domain.models import AuthenticationPolicy, AuthenticationSilo
from samba.drs_utils import drs_Replicate, drsuapi_connect
from samba.dsdb import (
- DSDB_SYNTAX_BINARY_DN,
DS_DOMAIN_FUNCTION_2000,
DS_DOMAIN_FUNCTION_2008,
DS_GUID_COMPUTERS_CONTAINER,
DS_GUID_DOMAIN_CONTROLLERS_CONTAINER,
DS_GUID_MANAGED_SERVICE_ACCOUNTS_CONTAINER,
DS_GUID_USERS_CONTAINER,
+ DSDB_SYNTAX_BINARY_DN,
GTYPE_SECURITY_DOMAIN_LOCAL_GROUP,
GTYPE_SECURITY_GLOBAL_GROUP,
GTYPE_SECURITY_UNIVERSAL_GROUP,
+ UF_NO_AUTH_DATA_REQUIRED,
UF_NORMAL_ACCOUNT,
UF_NOT_DELEGATED,
- UF_NO_AUTH_DATA_REQUIRED,
UF_PARTIAL_SECRETS_ACCOUNT,
UF_SERVER_TRUST_ACCOUNT,
UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION,
UF_WORKSTATION_TRUST_ACCOUNT,
)
-from samba.dcerpc.misc import (
- SEC_CHAN_BDC,
- SEC_CHAN_NULL,
- SEC_CHAN_WKSTA,
-)
from samba.join import DCJoinContext
from samba.ndr import ndr_pack, ndr_unpack
-from samba import net
-from samba.domain.models import AuthenticationPolicy, AuthenticationSilo
from samba.param import LoadParm
from samba.samdb import SamDB, dsdb_Dn
rc4_bit = security.KERB_ENCTYPE_RC4_HMAC_MD5
aes256_sk_bit = security.KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96_SK
-from samba.tests import TestCaseInTempDir, delete_force
import samba.tests.krb5.kcrypto as kcrypto
+import samba.tests.krb5.rfc4120_pyasn1 as krb5_asn1
+from samba.tests import TestCaseInTempDir, delete_force
from samba.tests.krb5.raw_testcase import (
KerberosCredentials,
KerberosTicketCreds,
RawKerberosTest,
)
-import samba.tests.krb5.rfc4120_pyasn1 as krb5_asn1
from samba.tests.krb5.rfc4120_constants import (
AD_IF_RELEVANT,
AD_WIN2K_PAC,
KU_TICKET,
NT_PRINCIPAL,
NT_SRV_INST,
- PADATA_ENCRYPTED_CHALLENGE,
PADATA_ENC_TIMESTAMP,
+ PADATA_ENCRYPTED_CHALLENGE,
PADATA_ETYPE_INFO2,
)
from unittest.mock import patch
from samba.dcerpc import security
-from samba.ndr import ndr_pack, ndr_unpack
from samba.domain.models.exceptions import ModelError
+from samba.ndr import ndr_pack, ndr_unpack
from samba.samdb import SamDB
from samba.sd_utils import SDUtils
from datetime import datetime, timezone
from xml.etree import ElementTree
-from ldb import FLAG_MOD_ADD, MessageElement, SCOPE_ONELEVEL
+from ldb import FLAG_MOD_ADD, SCOPE_ONELEVEL, MessageElement
+
from samba.dcerpc import security
from samba.dcerpc.misc import GUID
from samba.domain.models import (AccountType, Computer, Group, Site,
- User, StrongNTLMPolicy, fields)
+ StrongNTLMPolicy, User, fields)
from samba.ndr import ndr_pack, ndr_unpack
from .base import SambaToolCmdTest
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-import sys
import os
+import sys
sys.path.insert(0, "bin/python")
os.environ["PYTHONUNBUFFERED"] = "1"
from ldb import SCOPE_BASE
+
from samba import credentials
from samba.credentials import MUST_USE_KERBEROS
from samba.dcerpc import security
-from samba.dsdb import UF_WORKSTATION_TRUST_ACCOUNT, UF_NORMAL_ACCOUNT
from samba.domain.models import User
+from samba.dsdb import UF_NORMAL_ACCOUNT, UF_WORKSTATION_TRUST_ACCOUNT
from samba.ndr import ndr_pack, ndr_unpack
-from samba.tests import connect_samdb, delete_force
-
-from samba.tests import BlackboxTestCase, BlackboxProcessError
-
+from samba.tests import (BlackboxProcessError, BlackboxTestCase, connect_samdb,
+ delete_force)
# If not specified, this is None, meaning local sam.ldb
PW_READ_URL = os.environ.get("PW_READ_URL")
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-import sys
import os
+import sys
sys.path.insert(0, "bin/python")
os.environ["PYTHONUNBUFFERED"] = "1"
-import datetime, shlex
+import datetime
+import shlex
from ldb import SCOPE_BASE
from samba.credentials import MUST_USE_KERBEROS
-from samba.dcerpc import security, samr
-from samba.dsdb import UF_WORKSTATION_TRUST_ACCOUNT
+from samba.dcerpc import samr, security
from samba.domain.models import User
+from samba.dsdb import UF_WORKSTATION_TRUST_ACCOUNT
from samba.ndr import ndr_pack, ndr_unpack
from samba.nt_time import nt_time_from_datetime
-from samba.tests import connect_samdb, connect_samdb_env, delete_force
-
-from samba.tests import BlackboxTestCase
+from samba.tests import (BlackboxTestCase, connect_samdb, connect_samdb_env,
+ delete_force)
DC_SERVER = os.environ["SERVER"]
SERVER = os.environ["SERVER"]