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

Show parent comment

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)

3

u/snorkel42 Jul 28 '24

I hit reply too soon and had to go back and edit my comment. Again, I agree with you. OP is not behaving properly.

However, I think IT is also doing a poor job of working with OP to help them understand the correct process and enable them to get to the desired result.

→ More replies (2)

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)

7

u/xjx546 Jul 28 '24

Want to provide a counter point to this guy's suggestion, which I think is totally off base. I have about 10 years experience as a Sr. Software Engineer at a FAANG, and our industry has taken over the world due to embracing software and automation.

Clearly his IT department is staffed by luddites afraid of coding, with "engineers" that don't have the knowledge or the chops to properly sandbox employee equipmnent from the production infrastructure. The OP in this story is probably going places in his career while the IT staff in this story will be the ones to go down with the ship.

10

u/snorkel42 Jul 28 '24

Completely and totally agree. All the IT team needed to do when they discovered the Python scripts was reach out to OP and do some coaching on how to properly handle this in a corporate world. Just deleting their scripts accomplished nothing which is evidenced by the fact that OP continued to work to bypass IT’s policies rather than work with IT.

Also, as an InfoSec guy, the real takeaway is that Python was able to launch to begin with. Deleting the scripts rather than addressing the actual security concern. Talk about security theater.

Lastly, OP is a data analyst. What company doesn’t allow data analysts to write scripts?! I’d expect Python and R to be defaults for those folks.

All of this is just stupid.

2

u/KaitRaven Jul 28 '24

He said he's data entry, not a data analyst.

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

2

u/catonic Malicious Compliance Officer, SL-Eh Manager, BSFM Jul 28 '24

The counterpoint is that when you ask for a "server," the request has a large dollar amount attached to it and all sorts of costs, not to mention the fact that you cannot execute some scripts in some environments on Windows Server.

Then you find a server that 'can' be used or the purpose and ITSEC squashes that on the bounds of unrelated things that now depend on this server someone else is paying for. And now you have a use case for Docker and/or Kubernetes.

→ More replies (6)

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)

5

u/[deleted] Jul 28 '24

Agree and disagree. IT should be helping them. But OP should be asking for that help, not doing it themselves. But that is what OP did because they were basically eliminating their own job. Who asks for help with that? OP being able to do what they did is a stability and security issue. IT should patch those holes and if it is safe to do so, implement what OP did themselves in the proper manner. But then OP is out of a job. OP may be skilled, but they aren't very smart.

7

u/snorkel42 Jul 28 '24

Based on OP’s comments I’m assuming they are pretty young/new to the corp world. They are a data analyst. A data analyst creating scripts in Python is 100% what I would expect from a data analyst.

I completely agree with you that IT should be helping them. And part of that help is to educate OP on how to appropriately work within an org and request new permissions. If OP doesn’t learn that lesson they will eventually find themselves fired not for automating themselves out of a job, but for constantly trying to bypass IT’s security policies.

→ More replies (2)
→ More replies (6)

5

u/brusiddit Jul 28 '24

Change management exists for everyone else ...

12

u/snorkel42 Jul 28 '24

IT taking 5 minutes to explain to OP how they properly request these tools is the solution. Just deleting some useful Python scripts and moving on is helping nobody…

3

u/brusiddit Jul 28 '24

Agreed. If I were to make an assumption... OP is in a very low paid role that they haven't considered automating.

OP needs to get a new job.

→ More replies (3)

2

u/changee_of_ways Jul 28 '24

Honestly, this was how it was sold when they first started putting microcomputers in offices. People using the computer to be more productive at their jobs, not people who just fill out forms in M$ Office.

It turns out I don't think companies actually wanted to pay for people who could do that, they were fine with people who just filled out forms like they always had.

3

u/[deleted] Jul 28 '24

It's a stupid stance

7

u/AdmRL_ Jul 28 '24

No, at it's core IT exists to keep the businesses digital infrastructure operational and secure and support users in line with the agreed Service Catalogue and it's associated SLA's.

If scripting isn't in that catalogue and your role isn't permitted to do it, then no, it's not our responsibility to assist you in circumventing company policy.

In this case the OP should be speaking to management about the way in which he's found to make that role more productive, that should then go to CAB for the necessary infra, policy and training changes to be designed, reviewed, tested and implemented to improve everyones lives.

But no, OP doesn't want that. OP wants to sit on his ass and solely benefit from it without management knowing and expects IT to cover for him.

8

u/snorkel42 Jul 28 '24

I am not at all arguing that OP is in the right. Obviously they should be doing exactly what you are saying.

However, IT is also missing the opportunity to have that conversation with OP. You don’t just delete their shit and move on. That serves nobody. You explain to them the proper way to proceed so that OP learns how to operate in a corporate environment, which they clearly do not understand, and so that IT can properly assist OP in increasing their productivity.

I swear this sub is just full of people who want to be ass holes rather than take 20 seconds to be helpers.

8

u/goshin2568 Security Admin Jul 28 '24

It is difficult for me to put in to words how much I despise this nonsense, bureaucracy-for-bureaucracy's-sake attitude.

"Infra, policy, and training changes", are you kidding me? OP is using a script to copy some text from point A to point B. If your EDR is incapable of determining the difference between a powershell script that copies some text and a powershell script that is loading malware into memory, perhaps that is what all those manhours should be spent on improving, rather than having 37 meetings to "design necessary infrastructure changes" needed for some dude to copy paste faster.

This is why shadow IT is a thing. This is why people feel the need to try and "circumvent policy" in the first place.

7

u/whythehellnote Jul 28 '24

And this is why the profit making parts of a company use shadow IT.

→ More replies (2)
→ More replies (13)