PowerShell Security

SANS Institute has started offering PowerShell security classes. I guess this means PowerShell is clearly getting traction. This also got me thinking of PowerShell security features in general.

PowerShell has been obviously designed with much more security in mind than VBScript or cmd.exe:

  1. By default .ps1 script files are associated with Notepad. Double-clicking a script does not start it.
  2. To reference a script in PowerShell you have to specify file path, so even if a script is called dir.ps1 typing in dir will not start it. The shortest way to reference it is .\dir.ps1.
  3. And finally execution policies by default won’t allow you to run any scripts at all. You can lift the limitation up a bit by allowing to run scripts signed by trusted authorities.

(Anything else I am missing?)

There are a few things I personally would like to see added in next releases:

  1. Make execution policies more granular to specify that scripts need to be signed by a specific certificate (the one my company’s IT is using) and not just any trusted one.
  2. Add built-in protection against code-injection. Right now each script creator needs to handle that him-/herself. Once the protection is in the platform everything is going to be much more secure!
  3. Fix the ability to retrieve clear text password from credentials prompt (issue found by Martin):

PS C:\> $creds = get-credential
PS C:\> $creds.GetNetworkCredential()

UserName                                Password--------                                --------

Admin                                   Qwerty!

(Anything else? Comments are welcome!)

There are some additional security features which are already available commercially from companies like Quest and SAPIEN (sorry if there are more which I have not referenced – please add in the comments) like:

  1. Impersonating scripts/command-line for helpdesk and other limited rights scenarios.
  2. Auditing.
  3. Approval workflows.

So I think that the summary would be that PowerShell has gone a long way to become a much more secure command-line and scripting environment than we used to have before. There is room for improvements but this is only v1, right? I am sure there’s more to come!

Dmitry

Tags: ,

About these ads

9 Responses to “PowerShell Security”


  1. 1 /\/\o\/\/ July 27, 2007 at 10:02 am

    Hiya, Dmitry

    About point 3 (GetNetWorkCredentials )

    this is by design, what use does it have to store a secret if you can not get to it after, as this is using DPAPI only the user who did put it there can get it out ;

    See also http://mow001.blogspot.com/2005/11/get-credential-and-decrypting.html

    you can also use ryndael encreption as you want :
    http://mow001.blogspot.com/2005/11/more-on-cryptograpy-and-msh.html

    Greetings /\/\o\/\/

  2. 2 Lee July 27, 2007 at 5:33 pm

    Thanks for the comments, Dmitry.

    These are good suggestions, and topics we are thinking about. As MoW mentions, accessing your own protected data is not a security vulnerability, although it may be a surprise. I wrote a bit more about it here: http://www.leeholmes.com/blog/PowerShellCredentialsAndGetNetworkCredential.aspx

  3. 3 Rod Trent July 27, 2007 at 9:47 pm

    Its still a long road. Check out the results from the recent scripting poll:

    http://www.myitforum.com/absolutepm/Polls/Scripting.asp

  4. 4 James Pogran August 2, 2007 at 1:10 pm

    I wouldn’t call 135 respondants statistically significant enough to postulate that its “still a long road”

    How about the download count for Powershell, over a million unique users in 6 months? A self reporting metric like that seems more accurate (more or less) than one survey on one site that (seems to me) focus on Vbscript (not a bad thing).

    James Pogran

  5. 5 dmitrysotnikov August 3, 2007 at 10:50 am

    I think both James and Rod are right here.

    I agree that it is hard to call it statistically significant, however, I think there’s no doubt that at the moment VBScript is far more popular. Just Google for VBScript and PowerShell and compare the number of pages you get.

    A million downloads is a great indicator of the interest the technology is getting – but this does not mean a million users. One of the issues hindering widespread use is lack of platform support out of the box. Get-Process and Get-System don’t cover all administrative tasks, and most Exchange folks are still on 2000 and 2003.

    However, I think this is starting to change. AD cmdlets are a great application of PowerShell, Exchange 2007 will get SP1 pretty soon and will start to get traction, etc., etc.


  1. 1 “PowerShell credentials in clear text” follow-up « Dmitry’s PowerBlog: PowerShell and beyond Trackback on August 2, 2007 at 8:09 am
  2. 2 PowerShell vs VBScript Survey « Dmitry’s PowerBlog: PowerShell and beyond Trackback on August 3, 2007 at 8:05 am
  3. 3 Mark’s (we)Blog » How Windows PowerShell exposes passwords in clear text Trackback on August 22, 2007 at 10:24 pm
  4. 4 Unintuitive expression behavior in pipelines « Dmitry’s PowerBlog: PowerShell and beyond Trackback on September 13, 2007 at 8:16 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




My Recent Tweets

RSS My company’s blog

  • Fun at HostingCon 2013
    The smell of the hosting industry’s finest is in the air, and of course we sent some of the Jelastic team to attend and proudly exhibit at HostingCon 2013 this week in Austin, Texas.  From what I have been reading, there are more than 50 scheduled sessions from Sales and Marketing, Technology, Issues and Trends and [...]The post Fun at HostingCon 2013 appear […]
  • Secure Access to Your Jetty Web Application
    Today’s post focuses on the web application security related features of Jetty app server. After reading this article you should be able to configure security realms to provide authentication and access control for your Jetty web application, as well as to grant access to your app for dedicated IP-addresses only. Before we start let’s examine what Jetty real […]
  • Software Stacks Market Share: May 2013
    We are back to update you with the latest trends in software stacks popularity for May 2013. This time we decided to collect the numbers in a different way to get more accurate statistics. As you remember previously we counted the number of the environments, where each software stack was used. We’ve changed the reporting [...]The post Software Stacks Market […]
  • Setting Up a Cronjob in Jelastic Cloud
    Cronjob allows you to configure regularly scheduled tasks so that the jobs can be run automatically at a pre-set point of time. It repeats itself and does not need any regular manual instructions. Cron automates your system and can be used for quite different purposes. This wonderful tool is a standard part of all sysadmins toolkit. Also cronjob has a [...]T […]
  • How to Deploy Joget Cluster into the Cloud
    Joget Workflow is an open source platform that allows you to build enterprise web applications easily, due to its rich set of tools. It is also a rapid application development platform that provides complete agile development capabilities, including consisting of processes, forms, lists, CRUD and UI; not just back-end EAI/orchestration/integration or the tas […]
  • Liferay Cluster in the Cloud
    Liferay Portal is one of the most popular Java CMSs in the world due to its impressive ease-of-use. Since we published the tutorial on Liferay deployment to the cloud we have seen an extremely positive reaction from its community. Also we have received multiple requests from Liferay fans asking about clustering, replication and fail-over capabilities in the […]
  • Mark Zbikowski Veteran Microsoft Architect Joins Jelastic
    Jelastic already has an impressive team of advisers including Serguei Beloussov, the founder of Parallels. We also have technical geniuses who endorse and use Jelastic including the father of Java James Gosling, David Blevins who founded the TomEE project, and Michael “Monty” Widenius, the author of the original version of the open-source MySQL database and […]

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my former employer - Quest Software, or my current employer - Jelastic or anyone else for that matter. All trademarks acknowledged.

© 2007-2013 Dmitry Sotnikov

Pages

July 2007
M T W T F S S
« Jun   Aug »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Follow

Get every new post delivered to your Inbox.

Join 67 other followers

%d bloggers like this: