Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(e2e): Configure AD before starting test suite #828

Merged
merged 6 commits into from
Nov 6, 2023

Conversation

GabrielNagy
Copy link
Contributor

The workflow is described in the Go/PowerShell scripts for the most part, but at a high level the new 02_provision_ad step achieves the following:

  • converts XML GPOs to POL
  • uploads GPO structure to the DC under a client-specific path
  • uploads and runs the PowerShell script responsible for creating client-specific OUs, GPOs and users

The PR contains more changes best reviewed commit by commit.

Fixes UDENG-1535

}

# Create users
$password = ConvertTo-SecureString -String 'supersecretpassword' -AsPlainText -Force
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to obfuscate this "secret" - we would need a separate env variable to store the user password and pass it to this script via CLI argument from Go.

As an alternative, to avoid password authentication altogether, we can use a global authorized key file to be able to SSH as any account using the same key (as described in https://serverfault.com/questions/434896/ssh-one-authorized-keys-for-multiple-service-accounts). I kind of prefer this solution.

@GabrielNagy GabrielNagy marked this pull request as ready for review October 27, 2023 14:59
@GabrielNagy GabrielNagy requested a review from a team as a code owner October 27, 2023 14:59
Copy link
Member

@denisonbarbosa denisonbarbosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work!

Integrate the empty MULTI_SZ parsing GPPolParser fix[1] by monkey
patching the affected method until the change trickles down to the next
release (probably next Ubuntu LTS...)

[1] https://gitlab.com/samba-team/samba/-/merge_requests/3290
Nesting the GPO directories will give us a hard time when it comes to
replicate the structure on the Windows machine, so opt for the
following approach:

- create assets/ directory which will store GPOs and other sysvol assets
- put all GPOs at top-level
- replicate User/Machine structure of GPOs
- create GPT.INI with version higher than 0 to ensure changes are picked up

With this approach we can iterate over all directories and recursively
copy their contents to SYSVOL/Policies.
In case it doesn't exist. This will help when recursively uploading the
GPO structure to the Windows machine.
The workflow is described in the Go/PowerShell scripts for the most
part, but at a high level the new 02_provision_ad step achieves the
following:

- converts XML GPOs to POL
- uploads GPO structure to the DC under a client-specific path
- uploads and runs the PowerShell script responsible for creating
  client-specific OUs, GPOs and users

Fixes UDENG-1535
Standardize on a path so we can rely on the default instead of
specifying the key via CLI.
These are generated on the fly from their XML counterparts before
configuring the domain controller.
@GabrielNagy GabrielNagy merged commit f974c78 into main Nov 6, 2023
6 checks passed
@GabrielNagy GabrielNagy deleted the e2e-configure-ad branch November 6, 2023 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants