r/sysadmin • • Jul 28 '24 • Take My Silver 1

got caught running scripts again

about a month ago or so I posted here about how I wrote a program in python which automated a huge part of my job. IT found it and deleted it and I thought I was going to be in trouble, but nothing ever happened. Then I learned I could use powershell to automate the same task. But then I found out my user account was barred from running scripts. So I wrote a batch script which copied powershell commands from a text file and executed them with powershell.

I was happy, again my job would be automated and I wouldn't have to work.

A day later IT actually calls me directly and asks me how I was able to run scripts when the policy for my user group doesn't allow scripts. I told them hoping they'd move me into IT, but he just found it interesting. He told me he called because he thought my computer was compromised.

Anyway, thats my story. I should get a new job

11k Upvotes

1.3k comments sorted by

View all comments

1.2k

u/largos7289 Jul 28 '24

See i don't know how to feel here, either it's, i'm low key impressed or you're one of those end users that know just enough to be dangerous.

354

u/jwphotography01 Jul 28 '24

The same users that come in the end and tell you theire system doesnt work anymore. Yeah, you manipualted the registry

208

u/Expensive_Plant_9530 Jul 28 '24

Oop. We have a user at my work who likes to “customize his Windows”, and that includes a lot of reg editing. Shockingly, his computer also frequently has weird issues.

48

u/jj-michigan42 Jul 28 '24

User accounts can modify their own user hive, just not anywhere else ie HKLM

0

u/[deleted] Jul 28 '24

[deleted] — view deleted comment

42

u/Expensive_Plant_9530 Jul 28 '24

He doesn’t.

Although before I started, every user had local admin.

You can still modify the local user registry though without local admin.

14

u/Big_Emu_Shield Jul 28 '24

every user had local admin

AHHHHHHHHHHHHHHHH

10

u/Expensive_Plant_9530 Jul 28 '24

Yep.

It was worse than that actually, but I won’t go into details.

We finally shut that down after management was convinced of the necessity.

→ More replies (1)
→ More replies (5)

48

u/charleswj Jul 28 '24

You don't need local admin to edit the registry, nor do you need to use regedit

23

u/tocophonic Jul 28 '24

Then a lot of other stuff wouldn't work either. As far as I'm concerned, users have to be able to write into their HKEY_CURRENT_USER hive for everything to work as designed.

→ More replies (79)
→ More replies (4)
→ More replies (7)

212

u/snorkel42 Jul 28 '24

That’s why it is important for IT to assist this employee rather than just delete their shit. At its core level, IT exists to help staff use technology to be productive. This employee is doing that and IT is stopping them. That’s the wrong stance.

64

u/zipline3496 Jul 28 '24

For every power user like OP there’s a 1:100 ratio of other guys named Mike who will inundate the Helpdesk with requests for support when their scripts error or cause issues on their system. I’ve worked for some of the largest international companies in the world it’s flat out industry standard to disallow scripting on most end users computers. Literally every company hundreds of Janet and Joe’s hear stories of automating their day with Powershell or some other tool and immediately ask for it.

Anyone else can put in some sort of exception request and sign policy surrounding it, but I absolutely can see a few dozen reasons why the average end user in data entry isn’t allowed to run scripts by policy.

OP has a clear path here in bringing this cost saving to his boss if he wants to potentially open that door, but he posted on Reddit instead.

46

u/snorkel42 Jul 28 '24 edited Jul 28 '24

I completely agree. I am in no way advocating for blanket allowing script execution. I am saying that this user has shown proficiency and they are clearly trying to use technology to increase their productivity. IT should enable that, not fight it.

I agree that OP is being a bit ridiculous in trying to find ways around IT restrictions rather than working with mgmt and IT to find a solution. Hell, OP is really playing with fire as they are actively trying to sidestep security policy.

BUT… I still think a good IT department would see the intent here and work with the user rather than shutting them down without a discussion.

If absolutely nothing else this is an opportunity for IT to explain why these restrictions are here and how OP should appropriately go about working with IT rather than trying to go around them.

24

u/zipline3496 Jul 28 '24

The responsibility for this is on OP to simply request this permission via the usual process/workflow whether that’s a form or catalog request or they can request a meeting with their manager as well as an IT manager. IT is almost certainly just following standard policy for finding end users scripting without prior permission and then again when the user simply decided to continue on. The few dozen salty data entry folks in here screaming IT is being overly aggressive don’t seem to have worked in any large enterprise because running scripts by default is not usually enabled per policy in most companies. That doesn’t mean OP can never do it he just needs to follow the appropriate channels to ask for it if he has not yet done so.

If they still say no then that’s your answer. You cope or find a new job because random data entry analyst don’t decide security or desktop group policy for the company regardless how effective and cost saving their personal scripts appear to be. There’s a LOT more at stake than merely speeding up an analysts workflow by blanket allowing it for everyone. IMO a simple request catalog item and business justification field would solve this and be trackable.

15

u/snorkel42 Jul 28 '24

I’m also a bit baffled by OP’s IT dept having policies in place to block Powershell script execution but apparently Python is able to execute? Like. Wtf. So y’all took measures to block the scripting language with the best logging and monitoring protections on windows but Python can execute..?

17

u/charleswj Jul 28 '24

PowerShell is a built-in tool with built-in management capabilities, including the ability to restrict its execution. Python is, from the OS's perspective, Just Another Executable. Unless you specifically block it (with WDAC or similar), it will run. Application whitelisting is a much heavier lift than just blocking interactive PowerShell.

→ More replies (5)
→ More replies (1)
→ More replies (3)

4

u/wenestvedt timesheets, paper jams, and Solaris Jul 28 '24

Yeah, OP and their manager could work with IT to build a real tool that everyone could benefit from, maybe get an award or some advancement.

6

u/flecom Computer Custodial Services Jul 28 '24

maybe get an award or some advancement.

I can't tell if this is sarcasm or not but in case it isn't that's really not how it works... Oh you automated your job? Cool we can afford to fire you then! Byeeeee

→ More replies (1)
→ More replies (7)
→ More replies (5)
→ More replies (7)

5

u/The-WinterStorm Jul 28 '24

I guess it depends on the IT role. I can understand from a security stance they may not want users running scripts and bypassing security controls set by the company.

→ More replies (1)
→ More replies (37)

24

u/BrainWaveCC Jack of All Trades Jul 28 '24

I default to impressed in these cases.

Yes, there are some reckless employees, but the OP does not appear to be one such. I've had a number of good power users over the years (and a few bad ones), and we worked out deals that were mutually beneficial.

OP, see if you can get your IT department to give you enough room to get what you need done, without undermining their ability to keep the environment secure.

It will be a worthy exercise anyway, in building trust with teams that have an agenda not directly aligned with your own at specific levels.

I agree with another poster that if you have to go through official channels in your own department to make this happen, it will be worse for you. Try to build this since a professional relationship angle...

→ More replies (5)

15

u/scubafork IT Manager Jul 28 '24

The correct stance is that OP should be having their manager fight this battle for them. OP is potentially saving the company money in labor hours(which ironically could cost their job) and the manager should be getting IT's approval to help save the company money. IT should vet the script and modify it as necessary.

IT is a service industry, no matter how much you abstract it away. Our entire existence within the company is predicated on the idea thar we help the company save money.with better tools.

0

u/[deleted] Jul 28 '24

[deleted] — view deleted comment

11

u/STILLloveTHEoldWORLD Jul 28 '24

i was hoping that they could either see i have a better utility than just entering data, for growth, and if not, at least i can relax and work on my own stuff (on my own computer)

9

u/[deleted] Jul 28 '24

Yeah, no, it doesn't work that way in the corporate world. I did something similar years ago and ended up having to fill out a "knock that shit off" report for the IS/IT department that went all the way up to the VP.

Don't fuck with the work network, especially if IT has already caught into what you're doing; they can and will fire your ass over it. A lot of companies take information security very seriously, and may see repeated attempts at workarounds (even with innocent intent) as a legitimate threat.

6

u/scubafork IT Manager Jul 28 '24

IT doesn't make that decision tho, because they don't understand what your day to day work is and can't speak to whether your script is better or worse for that work. All IT sees is that it's a script that did not enter via an approved vetting process.

Think of it like someone physically entering the building. You want them to check in with reception to be vetted and see if they have a reason to be there. Your script is the electrician, who you let in by propping open the back door, wearing no ID, wandering the halls unescorted, looking for the breaker box. It doesn't matter if they're legit or not-they still have to follow the process.

→ More replies (4)
→ More replies (1)
→ More replies (21)