FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

PowerShell transcripts should include the configuration name in the transcript header by chunqingchen · Pull Request #2890 · PowerShell/PowerShell · GitHub

PowerShell transcripts should include the configuration name in the transcript header - #2890

Merged
Travis Plunk (TravisEz13) merged 2 commits into
PowerShell:masterfrom
chunqingchen:bugfix0
Mar 16, 2017
Merged

PowerShell transcripts should include the configuration name in the transcript header#2890
Travis Plunk (TravisEz13) merged 2 commits into
PowerShell:masterfrom
chunqingchen:bugfix0

Conversation

Chunqing Chen (chunqingchen) commented Dec 15, 2016
edited by joeyaiello
Loading

Copy link
Copy Markdown
Contributor

Steps to reproduce

New-PSSessionConfigurationFile -Path .\myJeaConfig.pssc -TranscriptDirectory 'C:\temp\transcripts' -SessionType RestrictedRemoteServer
Register-PSSessionConfiguration -Name JEA -Path .\myJeaconfig.pssc
Enter-PSSession -ComputerName Localhost -ConfigurationName JEA

exit

Expected behavior

PowerShell transcripts currently do not log the configuration name the user used to connect to and manage the machine. For JEA scenarios, this means an auditor trying to understand how someone was able to do a certain command will not know through which endpoint the user entered and was assigned those privileges.

Suggestion is to add a new line to the transcript header similar to the following:

ConfigurationName: MyJEA

[…]
RunAs User: WinRM Virtual Users\WinRM VA_10_PRIV_priv.demo
Configuration Name: JEA
Machine: DC (Microsoft Windows NT 10.0.14393.0)
[…]

Actual behavior

[…]
RunAs User: WinRM Virtual Users\WinRM VA_10_PRIV_priv.demo
Machine: DC (Microsoft Windows NT 10.0.14393.0)
[…]

Environment data

Name Value

PSVersion 5.1.14993.1000
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14993.1000
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Chunqing Chen (chunqingchen) changed the title PowerShell transcripts should include the configuration name in the ranscript header #2888 PowerShell transcripts should include the configuration name in the ranscript header Dec 15, 2016
PowerShellTeam added the Review - Needed The PR is being reviewed label Dec 15, 2016

Paul Higinbotham (PaulHigin) Dec 15, 2016
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This may be more efficient for extracting the configuration name from the Shell Uri since it only allocates one string instead of multiple string objects:

string shellPrefix = System.Management.Automation.Remoting.Client.WSManNativeApi.ResourceURIPrefix;
int index = shelluri.IndexOf(shellPrefix, StringComparison.OrdinalIgnoreCase);
return (index == 0) ? shelluri.Substring(shellPrefix.Length) : string.Empty;
``` #Resolved

Paul Higinbotham (PaulHigin) Dec 15, 2016
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It would be better to parse the configuration name from the shellUri (configurationProcviderId) here rather than parse it each time later when a transcript header is written. #Resolved

Jason Shirk (lzybkr) Dec 15, 2016
edited by PaulHigin
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You should prefer auto-properties where possible. #Resolved

Jason Shirk (lzybkr) changed the title PowerShell transcripts should include the configuration name in the ranscript header PowerShell transcripts should include the configuration name in the transcript header Dec 15, 2016

Chunqing Chen (chunqingchen) commented Dec 17, 2016
edited by PaulHigin
Loading

Copy link
Copy Markdown
Contributor Author

Thanks Jason Shirk (@lzybkr), Paul Higinbotham (@PaulHigin) ! I have incorporated the suggested change. #Resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

psConfigurationName [](start = 20, length = 19)

I believe that this cannot be null. Please make it default to empty string.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Paul Higinbotham (@PaulHigin) , I belive this is resolved.

Copy link
Copy Markdown
Contributor Author

Paul Higinbotham (@PaulHigin) the request has been addressed.

Copy link
Copy Markdown
Member

Chunqing Chen (@chunqingchen) Please include tests in this PR

Steve Lee (SteveL-MSFT) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

test needs to be added

Copy link
Copy Markdown
Member

Chunqing Chen (@chunqingchen) You need to add yourself to Microsoft on GitHub

Copy link
Copy Markdown
Contributor

Chunqing Chen (@chunqingchen) I suspect you're already in the orgs, you just need to do this (for both PowerShell and Microsoft, though doing Microsoft is what will fix the CLA bot): https://help.github.com/articles/publicizing-or-hiding-organization-membership/

Copy link
Copy Markdown
Member

There are open comments that still need to be addressed. See: #2890 (comment)

Travis Plunk (TravisEz13) commented Mar 6, 2017
edited
Loading

Copy link
Copy Markdown
Member

We have been waiting on author response to PR comments for over a week.

There are open comments that still need to be addressed. See: #2890 (comment)

Copy link
Copy Markdown
Contributor Author

working on the test now

Copy link
Copy Markdown
Member

Chunqing Chen (@chunqingchen) Please don't dismiss (delete) other people reviews. If you believe someone review is bad enough to be dismissed, please talk to a maintainer.

Copy link
Copy Markdown
Contributor Author

Travis Plunk (@TravisEz13) I meant the reviews are resolved. So dismiss is not the way to say it has been resolved. Got it.

Copy link
Copy Markdown
Contributor Author

Paul Higinbotham (@PaulHigin) Hi Paul, I talked with Travis and he agrees to merge the commit if you are fine. do you have any more comment about this change?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please use more informative title.
Sample - "Transcript header".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yes, please replace bug fix test with something more descriptive.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

corrected

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please add new line.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is recommended, but not required.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This was not fixed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please replace -force with -Force.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

corrected

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please replace aliases with full cmdlet names.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

corrected

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please use Should BeLike or Should BeLikeExactly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

corrected

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please replace -force with -Force.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

corrected

Copy link
Copy Markdown
Contributor

I agree with Ilya (@iSazonov) comments. Otherwise LGTM.

Travis Plunk (TravisEz13) dismissed their stale review March 15, 2017 19:05

I agree with @iSazonov comments. Otherwise LGTM.

Travis Plunk (TravisEz13) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I agree with Ilya (@iSazonov) comments. Otherwise LGTM.

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) Travis Plunk (@TravisEz13) comments are all resolved

Copy link
Copy Markdown
Collaborator

Thanks!
Tests LGTM.

Copy link
Copy Markdown
Contributor

Great change!

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
…der (PowerShell#2890)

* PowerShell transcripts should include the configuration name in the transcript header
* adding test case for PowerShell transcripts should include the configuration name in the transcript header PowerShell#2890
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.


Back | FazBrowse Home | New Git URL