r/Python • u/RogueLegio • Jul 20 '26
Discussion Cyber Security wants us to use the latest version all the time
I have a question. Cybersecurity team wants us to use the latest python version each time. So if a new version comes out we are expected to upgrade to it ASAP. But from my past experience libraries do not always provide support and can also break while making use of new version without proper support. Did you ever encounter this? Any suggestions? This is just frustrating for the team as it’s not always possible to upgrade to the latest version without fully validating every component. I just want to hear your opinions on this?
FYI we mainly use each Python Version within the LTS timeline. And only upgrade when we need to and do not depend on a library that requires older version.
Update: they have a scheduled runner that deletes older versions of python when it finds
188
u/WJMazepas Jul 20 '26
Python has a "LTS" like versions.
We use 3.12 on my work, and is still receiving security updates, is relatively new and had support for all libs we use
I think right now its on 3.12.13
So you dont need to change to Python 3.14
But yeah, they will need to understand that and compromise
76
u/smichael_44 Jul 20 '26
I’m in a similar situation. It ultimately comes from the security teams being clueless about software development. Or at least mine is.
CVEs can pop up in any version of any software at any time. As long as there is active support for it, it can, and hopefully will, get patched.
All of software is full of tradeoffs, so just pick the security vulnerabilities you’re willing to accept. A default “latest” policy is just lazy.
17
u/ShelLuser42 It works on my machine Jul 20 '26
Sounds to me as if they either don't know what they're doing, or never bothered to check the Python release map.
First: going bleeding edge in development is never a good idea, even if the environment tries its best to remain backwards compatible. Especially with Python where the latest version (= 3.16 at the time of writing) still gets new features added; with all the possible involved risks.
But second, and more important, older versions still get security and bugfix updates. 3.12 for example is still getting security updates until the end of 2028, 3.13 lasts one year longer.
15
u/Justbehind Jul 20 '26 edited Jul 20 '26
Well, I guess you better built everything yourself, because that sounds like a nightmare, if you use a lot of external libraries...
4
u/DiscipleOfYeshua Jul 20 '26
Let them read some Debian vs Gentoo
460
u/BranchLatter4294 Jul 20 '26 •
Have the cybersecurity team validate every library.
2
u/Unlucky_Comment Jul 20 '26
You can install in gitlab/GitHub something to check latest vulnerabilities and prioritize upgrading those.
Dependabot can also create the pr for you, but you have to be careful, depending ont the package it sometimes can break, so testing those is always a good idea (like Langchain, Langgraph)
2
u/OakNinja Jul 20 '26
The early bird might get the worm, but it’s mouse number two that gets the cheese.
34
u/shibbypwn Jul 20 '26
As someone who works in Engineering Operations and typically enforces this kind of stuff... this is a bad policy.
They should be enforcing maintenance and upgrades of packages to address vulnerabilities - not enforcing full version upgrades unless you're on a deprecated version.
So they should enforce incremental upgrades to address vulnerabilities, package upgrades within your supported python version, etc. - but enforcing n-0 for everything is asking for headaches.
Are you using anything like dependabot in your environment? If not, I would push back for the DevSecOps team to implement proper tooling to identify which upgrades actually matter instead of blindly enforcing upgrades.
3
u/OhioDude Jul 21 '26
This is the dumbest thing I have ever heard. Are they trying to break shit? Do they even use Python? I've been a CISO for about 1yr+ and a director in Cyber Sec for about 10 years and have never once thought of limiting what versions of Python our IT partners should use. It sounds like your security team is full of security ppl telling IT how to do their job, instead of IT people working security partnering with their IT peers in securing the environment.
Security teams like the one you describe piss me off and give the rest of us a bad name.
12
u/cointoss3 Jul 20 '26
Part of why this feels insane is because how often we are seeing new supply chain attacks. They want you to update Python, which in turn may force you to update to a new version of a library and it may be compromised.
7
u/jpgoldberg Jul 20 '26
You should ask your cyber-security people if latest release of supported versions is ok. Point them to
https://devguide.python.org/versions/
And ask if you can use, for example, 3.11 as long as you are using the latest release of 3.11.
They really should be basing their policy around that, as should you. They are right to insist that you are using version that gets security updates and that those updates are being applied. But that just means latest release within a supported version. It shouldn’t mean latest version. Feel free to share what I’ve said here with them.
1
u/Trang0ul Jul 21 '26
Do they mean upgrading minor versions only (3.14.5 -> 3.14.6), or major as well (3.14 -> 3.15)?
The former should be safe, but the latter may indeed break the existing code.
3
u/Bibbitybobbityboof Jul 20 '26
That should really only be enforced if you’re behind in major versions and your current major version isn’t getting patched. Otherwise just put in a patch or minor version upgrade and call it good. No need to force an upgrade and scramble to maintain compatibility.
3
u/lolcrunchy Jul 20 '26
They should learn about Python's versioning system. Tell them that each minor version (3.12, 3.13, 3.14, ...) is a change in the set of features, and the micro versions (3.12.1, 3.12.2, ...) are bug fixes and security updates.
They should only delete Python version 3.X.Y if there is a version 3.X.Z where Z>Y.
And instead of deleting, they could just run the relevant pip or uv command instead of smashing stuff with their delete hammers.
3
u/replicant86 Jul 20 '26
Well, they are idiots.
3
u/ignatzami Jul 21 '26
Your security team is incorrect.
I’ve been in industry 18 years, in security for the last five, and GovSec the last two.
Barring issues with specific minor versions there’s absolutely no issue being on the LTS branch, until it reaches the end of life.
I’d be happy to offer consulting services to tell your current security team to pound sand. 😤
3
u/max_465 Jul 25 '26
Do they realize that security patches get back ported ? A properly patched 3.12 could be safer than a fresh 3.14 lacking the latest updates. I think that they don't understand how Python versioning works.
5
u/N3RO- Jul 20 '26 edited Jul 21 '26
I work in cyber for more than a decade and let me tell you: I'm sorry you have this SHIT and DUMB security team "securing" your company. These poor security teams who don't have a clue about programming gives us the bad rep and makes Eng teams hate us.
Anyone who works with IT knows you NEVER blindly and auto update to new versions. Unknown bugs, issues, incompatibility and more recently supply chain compromise make this a poor choice.
The "trend" (which is not new by the way) is actually to do delayed and phased updates. This saves everyone lots of headaches.
2
u/nickymarciano Jul 20 '26
Yeah, thats why its a pain to update too soon. Takes up a lot of resources and testing.
You make good arguments. Use them to gain leverage, ask maybe to consider staying in a newish version, as long as it is not risking deprecation.
2
u/tobidope Jul 20 '26
I would argue, that you use one of the latest supported versions. So currently 3.10 to 3.14 get security fixes. They are equivalent in the context of security. https://endoflife.date/python
2
u/Dillweed999 Jul 20 '26
I though security best practices were moving away from using the very latest versions of everything, what with all the supply chain attacks
2
u/MiroDerChort Jul 20 '26
Isolation is the key to compliance. You should already be using venv. But spin up a vm/container... Then make the business case about the impractical cadence.
2
u/kaanivore Jul 20 '26
I feel like the best practice is actually going the other way with all the supply chain attacks out there, and it’s now better to pin a version known to be safe
2
u/Orio_n Jul 20 '26
Just say no if you can't upgrade because of versioning conflicts. Otherwise upgrade ASAP it should be painless and easy if you have high test coverage. You do have test coverage right?
2
u/mister_obvious_2nd Jul 21 '26 edited Jul 21 '26
What do you mean by the latest version? The latest patch version of a minor version? Like when you use 3.12.x and 3.12.x+1 comes out? Or do they mean you need to upgrade from 3.16 to 3.17 when that comes out? That last one would be hare brained.
What you need is a version that gets timely security updates and that is what you are using. Running a stable, battle tested version that gets security updates is the sweet spot.
Python has a support matrix page with the support status of various version here : https://devguide.python.org/versions that can be used to determine and plan ahead what versions make sense for you to use and when to migrate.
Upgrading to a new minor version the moment comes out it often impossible because external modules don't support it yet. Running in that situation is in fact more risky than using an LTS python version since it may not work at all or have unexpected effects.
And automatically deleting software from production systems is utterly stupid.
What has helped me in the past is pointing out how much time, and therefore money, something costs. Constantly upgrading to every new major version that comes out and testing every project for correctness will be a fulltime job leaving no time for the actual development of features.
2
u/markus_b Jul 20 '26 edited Jul 20 '26
Every python version has a roughly five-year lifecycle. https://devguide.python.org/versions/
So, now (summer 26) you should be on Python 11 or Python 12.
Python 10 is going out of support (and security patching) this autumn, and Python 13 is still in the testing phase and may have production-breaking bugs.
If they have a scheduled runner who breaks production, then they have to take the blame. If you use 90% of your capacity for the futile attempt to always be on the latest version, then they have to take the blame as well.
But in the end this is your CIO's call. He has to decide the priorities. It is always a balancing act between security and functionality. The safest system is one which is shut down. But a shut-down server does not provide a service you can sell.
1
u/fgualdron Jul 20 '26
I would micro segment my servers and put an IPS/WAF in front of them so they could do virtual patching without require you to update every single time. Just make sure you have a dev / testing environment to check if their signature update breaks the app.
1
u/mugenbool Jul 20 '26
Our company eliminated python installs on workstations. Instead we have devcontainers with the specific python version you need installed.
1
u/Aisuhokke Jul 20 '26
If it's a minor version upgrade, that's one thing. But a major version upgrade is painful to switch over to frequently. I wouldn't do this unless there is a proper valid reason. This sounds like someone who doesn't actually engineer things just making a blanket rule without justification.
1
u/Solonotix Jul 20 '26
This can cut both ways. My company tends to lean towards oldest LTS, which has its own frustrations, because it's like trying to pull teeth to get people off EOL versions they didn't notice had lapsed. Same exact problem you have, except in reverse.
The ideal is somewhere in between. You want new enough to not be vulnerable but old enough to have widespread support. This kind of nuanced choice isn't the type of thing security teams or management are in the business of providing. They like to know as little as necessary about anything they aren't directly responsible for (can't blame them there), so you often end up with naïve guidance that can cause a lot of undue stress for everyone.
Ideally, there would be a collaboration, just like in government legislation. I don't expect someone sitting in Management to know that 12th-gen Intel Core processors had a microcode issue that caused their boost clocks to burn out processors way too fast. I do, however, expect them to consult an expert before making a massive hardware rollout using said equipment. Same policy should apply to security policy.
1
u/k0pernikus Jul 20 '26
It depends. You want to update for critical security patches, yet tou may want to wait to prevent your updates from breaking your stack
You can get attacked by falling behind and by staying too close to the bleeding edge.
This is where semantic versioning shines if your dependencies use that, as security patches should also arrive for each major version.
I try to stay as bleeding edge as I can, within reason.
The biggest gain is using proper package managers with lockfiles, I upgrade on a weekly basis trying to stay to the bleeding edge as I can.
1
u/Sniper666hell Jul 20 '26
If you’re using windows machines, I’d build everything into pyinstaller one file builds. When I do this my build scripts strictly require the version used for build is what was used to validate. This way development PCs are the only ones with varying versions of Python and the exe gets pushed to the PCs using the software and those never get Python installed.
1
u/jarofgreen Jul 20 '26
Find out why they want this.
Do they think it's the best policy themselves? Then it's a technical argument you need to have with them.
Do they think they need to do this to meet a external security programme or certification? Then it's an entirely different argument you'll need.
1
u/bcoder001 Jul 20 '26
Get business on your side and ask for a meeting with security and business. During the meeting make a case for using LTS releases as a saving without compromising security.
1
u/CevicheMixto Jul 20 '26
Pretty sure that you can get exceptions if you show them test failures with the new version, and a plan to address them. I'm guessing that the underlying problem here is lack of testing infrastructure and process.
1
u/Dijstraanon Jul 20 '26
That is what regression testing is all about. If they want you to upgrade, they have to regression test.
1
u/KronktheKronk Jul 21 '26
Regression test suite is the answer to your question.
If it passes, upgrade. If it doesn't, tell them you can't until the issues are resolved. If that starts to take up to much time, the business will stop prioritizing it
1
u/jbudemy Jul 21 '26
Then your customers will have to wait until major libraries that you use update their software to work with the new Python.
We don't update Python each time a new version comes out because of the "library lag". But eventually we will have to update Python and hopefully we won't have too many issues I need to fix in about 30 programs I have currently.
Also all our assets go through a VPN including all network drives where Python programs are stored. Would this make your IT happy?
1
u/spinwizard69 Jul 24 '26
In a sense they are right, each Python version does improve security. You can read through the release notes but in general there are improvements with every release. Frankly somebody has to set a standard because programmers have a habit of ignoring security.
Now you have legitimate concerns about libs and such. However you are not going to like this but one thing you have to do is to stop using bleeding edge libs. This is a huge security issue.
Now how do you address this, personally I see making use of a solid Linux distro as the best course of action and only use software supplied by the distro. That means installing and using only package manager supplied libs and associated updates. This of course means a distro that is designed for professional usage and actually updates each distro release with patched libs. This takes some of the security responsibility off the Cyber Security team. This rubs a lot of programmers the wrong way because they can't implement all those bleeding edge goodies, but that is precisely the behavior that needs to be managed. I Know you don't want to hear this but who is actually paying attention to security on the project development team?
Your best bet is to go to IBM/Fedora or similar and get a maintenance program for a distro setup and then lock down the computers such that the lock keeps garbage developer software off the machines. In other words force developers to all use the same Python version and libs. In other words every developer on the team is using the same distro and only the package managed libs for that distro.
1
u/No_Sea6113 Jul 20 '26
Cybersecurity has their priorities, you have yours, and you need to compromise on them. They are right that you should be trying to upgrade in general, but obviously its not always going to get done. In the last role I had where this was a serious issue, we tried to sit about 6 months behind the latest version. Gives libraries time to upgrade their stuff to work with new versions, generally moves fast enough to avoid massive problems, and gives you time to plan the upgrade work as part of your mid term plan. Part of the upgrading version work is checking what is going to not work anymore and finding alternatives or writing it yourself and bringing it into your control.
Generally I think once you are on top of it its not too bad, and looking forward at things that are going to change/ be deprecated you can be writing new code in a way that needs less maintaining later down the line, and usually changes happen for reasons that mean your code is probably better/faster/more secure.
-4
u/GraphicH Jul 20 '26
I'm sorry, I work in the security Industry as a software engineer, this is just where things are going. They've been going this way for 10+ years, but AI is now making it vastly more important. You cannot let yourself be even a few major versions behind on a critical 3rd party library. Now my teams don't use "latest" and we don't let libraries "float" (we pin / use locks) because that opens you up to supply chain attacks more easily. However you do need to be in a "ready" position to take an upstream update for a security vulnerability on your third party dependencies at any time. That means good test coverage, CICD processes, and having enough confidence that you're going to catch breakages at build time.