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

Adds better logging around SMB mapping for FSX #3240

Merged
merged 1 commit into from
Jun 9, 2022

Conversation

jterry75
Copy link
Contributor

@jterry75 jterry75 commented Jun 3, 2022

Summary

  1. Adds debug logging for SMB mapping for the command
    that is being executed. This command will not not log the
    creds used to attach the mapping.

  2. Logs the ps output stderr/stdout from the command on error.

Signed-off-by: Justin Terry jlterry@amazon.com

Implementation details

Added the logging around the PowerShell exec.

Testing

Have verified that in both the debug cmdline and the output it doesnt log the password.

Description for the changelog

Adds command and error logging for FSx file mapping when calling out to PowerShell.

Licensing

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

@jterry75
Copy link
Contributor Author

jterry75 commented Jun 3, 2022

@vsiddharth - Can you give me some feedback on this.

@jterry75 jterry75 changed the base branch from master to dev June 7, 2022 17:50
vsiddharth
vsiddharth previously approved these changes Jun 8, 2022
Copy link
Contributor

@vsiddharth vsiddharth left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

Thanks a lot for making these changes.

1. Adds debug logging for SMB mapping for the command
that is being executed. This command will not not log the
creds used to attach the mapping.

2. Logs the ps output stderr/stdout from the command on error.

Signed-off-by: Justin Terry <jlterry@amazon.com>
@jterry75 jterry75 marked this pull request as ready for review June 9, 2022 20:12
@jterry75
Copy link
Contributor Author

jterry75 commented Jun 9, 2022

New output:

level=debug time=2022-06-09T20:08:24Z msg="Executing mapping of fsxwindowsfileserver with cmd: New-SmbGlobalMapping -LocalPath \"Z:\" -RemotePath \"\\\\amznfsxricml6z3.sidvin.fsx.com\\share\" -Persistent $true -RequirePrivacy $true -ErrorAction Stop" module=fsxwindowsfileserver_windows.go
level=error time=2022-06-09T20:08:26Z msg="Failed to map fsxwindowsfileserver resource on the container instance error: exit status 1, out: New-SmbGlobalMapping : The password of this user has expired. \r\nAt line:1 char:1\r\n+ New-SmbGlobalMapping -LocalPath \"Z:\" -RemotePath \"\\\\amznfsxricml6z3.s ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : NotSpecified: (MSFT_SmbGlobalMapping:ROOT/Microsoft/...mbGlobalMapping) [New-SmbGlobalMa \r\n   pping], CimException\r\n    + FullyQualifiedErrorId : Windows System Error 2242,New-SmbGlobalMapping\r\n \r\n" module=fsxwindowsfileserver_windows.go

@singholt singholt merged commit acf0ba2 into aws:dev Jun 9, 2022
@jterry75 jterry75 deleted the add_fsx_windows_logging branch June 9, 2022 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants