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

Advertise Domainless gMSA capability on Windows #3668

Merged

Conversation

arun-annamalai
Copy link
Contributor

@arun-annamalai arun-annamalai commented May 1, 2023

Summary

This PR is advertises the new domainless gmsa capability on the Windows ECS agent. The Linux agent will be coming in a followup PR.

Implementation details

The Windows agent will advertise the gmsa capability only under the following 3 conditions

  1. Environment variable is set
  2. The windows instance must not be 2016
  3. The domainless gMSA plugin must be installed

Testing

This change was unit tested as well as tested on a Windows EC2 instance and describe-container-instance was called to ensure that the capability was correctly advertised. It was also run on an old Windows EC2 instance to ensure the capability was not advertised.

New tests cover the changes: yes

Description for the changelog

Advertise gmsa domainless capability on Windows Agent

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@arun-annamalai arun-annamalai force-pushed the capability branch 3 times, most recently from 0dae86a to 06c88f7 Compare May 1, 2023 20:08
@arun-annamalai arun-annamalai marked this pull request as ready for review May 1, 2023 20:18
@arun-annamalai arun-annamalai requested a review from a team as a code owner May 1, 2023 20:18
@arun-annamalai arun-annamalai assigned yinyic and arun-annamalai and unassigned yinyic May 1, 2023
@arun-annamalai arun-annamalai requested review from saikiranakula-amzn, fierlion, yinyic and a team and removed request for a team May 1, 2023 20:24
yinyic
yinyic previously approved these changes May 2, 2023
@@ -114,3 +141,42 @@ var IsWindows2016 = func() (bool, error) {

return isWS2016, nil
}

var queryDomainlessGmsaPluginSubKeys = func() ([]string, error) {
k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SYSTEM\CurrentControlSet\Control\CCG\COMClasses\`, registry.READ)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should make the registry keys as constants.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I do this as a followup in a future cleanup PR? Sai is blocked on this work presently

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah okay works for me


// This function queries all gmsa plugin subkeys to check whether the Amazon ECS Plugin GUID is present.
func isDomainlessGmsaPluginInstalled() (bool, error) {
subKeys, err := fnQueryDomainlessGmsaPluginSubKeys()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also check for the presence of GMSA binary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had asked Justin about this, and he had only wanted to check for the presence of registry key (which would imply plugin is installed)

@arun-annamalai arun-annamalai merged commit bef6ee8 into aws:feature/ecs-domainless-gmsa May 3, 2023
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.

5 participants