Live data from Hacker News

Sudo for Windows

devblogs.microsoft.com

431–439 of 439 posts

Re: Sudo for Windows

#431
post #103

Earlier quoted context omitted.

If you’re running as local admin you just get the dialog, but you’re not using a local admin as your daily driver user acct, right? ..Right? :) If you’re logged in as a standard user, UAC prompts you for new username and password to authenticate and authorize the privileged operation.

Seems like a horribly convoluted way to manage permissions. Also I have never heard anyone suggest you shouldn't use a local admin account. That's the exact problem UAC was meant to solve. Having used an unprivileged Windows account, all I can say is no thanks. It's a huge burden if you do anything even slightly more complex than Facebook and email. As a blanket policy at work, all programmers are admins, everyone el…

> Also I have never heard anyone suggest you shouldn't use a local admin account.

Only every security audit under the sun. If you work for a sufficiently large organization subject to industrial or governmental regulation, or even carry particular insurance policies, third party audits will flag these practices as liabilities, because its boilerplate recommendation for how a managed windows environment is deployed.

You may work for a large organization where you get local windows admin. Exceptions can be made if a good story can be told about compensating systemic and detective controls that sufficiently mitigate the risk.

However I promise you that someone in that organization closer to security strategy and compliance gets grief over the posture at least annually. Those people shelter you from worrying more about it.

Re: Sudo for Windows

#432

Earlier quoted context omitted.

PowerShell options are all single dash, tab completable, case insensitive, will match on the shortest unique prefix, and can be aliased with shorter ones like `-EA` is `-ErrorAction, and are consistent because the shell parses them not the cmdlet.

I always laugh when people from the unix side try to shit on powershell when powershells pretty fucking amazing and has a solid UX for just how many things ... work

Given what it replaces, sure.

Re: Sudo for Windows

#433

Earlier quoted context omitted.

What else would the operators be? They can't use `>` because that does IO redirection, they can't use `|` for OR because that's piping. They could use `==` for equality but then what symbols would -ceq and -ieq be? What symbols or what else would work for `-match` and `-in` and `-cmatch`? If they were just `eq` or did use `==` how would that work for when they are actually options to a cmdlet such as `| where-object…

They didn't need to copy any awful shell syntax. We have decades of programming language development but Powershell cribs from oldest and most cobbled together environment. Give up on the old syntax for IO redirection and piping. I also don't even like their verb-noun philosophy because it's impossible to figure out what the commands are and there are so many. It's still all objects and methods underneath but you can…

> "Give up on the old syntax for IO redirection and piping."

Handwaving away decades of muscle memory and expectations for > and | seems bad, but those are the easy cases, and you've avoided dealing with the operators which are not symbols and the case sensitive/insensitive variants of common operators. What do you suggest for syntax instead which handles all, or most, of the cases PowerShell handles?

We have had "decades of programming language development" but I'm not aware of any which do what PowerShell does. I haven't spent any time on OilShell or NuShell or other Unix-shell-modernised systems, but Python syntax and behaviour does not make for a good shell, nor do any other programming-language-with-REPL that I've used. What language are you thinking of which makes a good compromise of both shell and pipeline and programming language, which would also work in the Windows world where things aren't text (PowerShell design priority)?

> "I also don't even like their verb-noun philosophy because it's impossible to figure out what the commands are and there are so many."

On a computer system where many thousands of things are possible, specifying what to do by command line is going to require typing one thing for every option you need to specify. Whether that's in the command name, in the command options, in the arguments to the options, or externalised in some ENV variable or /sys/ namespace or some /proc/ data source or some /etc or .dotfile config option, or hiding in some JSON structure, it's only shuffling the complexity around. At least with many commands they are organised into modules, searchable, and can have associated help.

> "you can't auto-complete anything."

*date* cycles through all commands with 'date' in their name. Cmdlets and binaries and functions.

hyper-v\*failover* cycles through all cmdlets in the Hyper-V module which have 'failover' in their name.

Get-Command -Noun VHD searches for commands with VHD as the noun part of Verb-Noun.

Get-Command -Parameter VlanId searches for commands which take -VlanId as a parameter (e.g. Hyper-V\Set-VMNetworkAdapterVlan).

Re: Sudo for Windows

#434
post #331
post #196

Earlier quoted context omitted.

To answer the original question: I've been at MSFT like, 8 years now? And this is probably the third serious attempt my team has made at Sudo for Windows. (I think I heard of a couple other attempts in my tenure as well). After the last attempt, my mantra had always been "this is impossible to actually ship". It's a tricky feature to ship, cause it is ultimately something that can be used as an escalation of privileg…

You must feel like you just shipped Duke Nukem Forever.

Let's hope people actually use Sudo for windows though.

Re: Sudo for Windows

#435
post #281

Earlier quoted context omitted.

The real question is, where will incidents be reported to if you're not in the sudoers file?

I still to this day feel like I'm being snitched on, even if I own the hardware directly. Probably some MS server =|

They collect and send the filenames on your disk, and other arbitrary stuff. Why not?!

Re: Sudo for Windows

#436
post #75

Earlier quoted context omitted.

I have been continually disappointed that Microsoft has not released a seamless Windows virtualization system. WindowsX would run the new, redesigned APIs, but all of the legacy could run inside a sandboxed system to give the world the required decades to finally transition.

This! I won't buy a Windows OS to run stuff because rebooting is annoying and I end up rarely ever actually dual booting. But I'd pay good money for a Windows Classic library on Linux.

Imagine if they could sell a copy of Windows for each legacy app or game you want to run, instead of the one copy running the hardware...

Re: Sudo for Windows

#437

Earlier quoted context omitted.

Superseding in compatibility. I’m not talking about business segments. They don’t have to adopt it, they will probably fork it.

> Superseding in compatibility. It's going to be more compatible with Word than Word is?

Yes: https://news.ycombinator.com/item?id=38906331

Re: Sudo for Windows

#438
post #262

Earlier quoted context omitted.

You're right, but on my work environment I have two accounts - "me" and "me with elevated permissions". (I don't say "admin" because there's still a bunch of stuff I can't do, like run netsh). I assumed that was the normal pattern in Windows-land?

It is something of the normal pattern, it always seems like companies love it. It always seems like UAC with extra steps to me. It's not that much more secure than taking UAC as-is and dialing up the security settings on UAC prompts to require a password every time. It's often amusing to me that everywhere I've seen require "secondary accounts" for admin permissions has dialed down the overall security settings of UA…

Hacker accesses some legacy application that verifies the user's credentials against LDAP. Maybe it's payroll or something. Hacker logs passwords until someone who happens to be a org-wide local admin (or worse yet DA) wants their paystub. Hacker now has admin privileges.

(Also, if UAC settings are turned down, that might mean the UAC prompt isn't on the secure desktop, and any malware can thus trivially elevate itself if your everyday account is an admin... etc.)

Re: Sudo for Windows

#439

Earlier quoted context omitted.

That has nothing to do with sudo; you could do the same with su -c long before sudo existed...

If you know the root password

Defaults targetpw

The point of sudo is not which password is used, whatsoever.

Post reply on HN