NCSC warns organisations to ditch Python 2 before it hits end of life
The National Cyber Security Centre (NCSC) has advised organisations still using Python 2 code to port it to Python 3 as soon as possible before it goes end of life at the turn of the new year.
The cyber security arm of GCHQ said that because Python's core developers will stop working on updates, vulnerabilities in the code will go unpatched and leave organisations vulnerable to cyber attacks.
Moreover, if an organisation is maintaining a library written in Python 2 that other people depend on, then those dependencies are being delayed in their own upgrades which, in turn, adversely affects their cyber security resilience.
"If you continue to use unsupported modules, you are risking the security of your organisation and data, as vulnerabilities will sooner or later appear which nobody is fixing," said the NCSC in a blog post.
Outlining the scale of the problem, the NCSC showed data from June 2019 of the ten most popular Python packages downloaded by millions every month. It showed the majority of the packages were still written predominantly in Python 2 and the ones like Flask which were written mainly in Python 3, still had around a third of their content in the soon-to-be EOL version.
"Even if only a portion of these downloads are being used in live projects, the Python 2 EOL could potentially affect the security of millions of systems," said the security body.
It's important for organisations to fully migrate over to Python 3 as the way to the two languages are structured could create code incompatibilities in their libraries.
For example, text strings are stored differently in the two languages as Python 2 stores in ASCII which uses 8-bit encoding whereas Python 3's Unicode uses variable bit encoding so it will support most written languages while ASCII won't.
"The impending end-of-life of Python 2 illustrates both the importance of managing a complex software supply chain of third-party components and platforms, as well as the critical need for updates," said Jonathan Knudsen, senior security strategist at Synopsys. "Customers will avoid or ignore updates that are not drop-dead simple, or automatic, which can result in stale deployments that are plagued by bugs that have already been fixed."
Python 3 is essentially a more intelligent language that comes bundled with lots of new features that makes coding easier and less convoluted. It irons out some annoying features of Python 2 such as integer division which would previously round down to the nearest whole number.
The NCSC recognises that porting all of an organisation's code to a new language can be a daunting task, but there are tools out there to help make it easier.
'Can I Use Python 3' is a program which will scan projects for dependencies that will prevent porting to Python 3, while '2to3' is a tool which will attempt to port Python 2 source code into 3.
The official Python website will also have documentation that organisations will find helpful and links to free resources to help further with the process.
Industry: Cyber Security
- Outside IR 35 CONTRACT SC CLEARED Cyber Security Operations Analyst SPLUNK ES- UK REMOTE- £500 a day.
6 month contract Outside IR35 Operational Cyber Security Analyst. Hands on Splunk Security Enterprise and Security clearance is required As is someone that holds SC clearance. SOC and Vulnerability management experience. Vulnerability Analysis / Management - Tenable
- SailPoint Consultant
- Upto €80,000
SailPoint Consultant is need for this rapidly expanding global business, The business is currently in the middle of a SailPoint Deployment, they require an experienced Consultant who is able to help them on this Journey You will be responsible for helping to configure and deploy SailPoint as well as on board applications onto the platform You will also work with the business to understand workflow and process to help align the way the business works to ensure that the business gets the most from the deployment We are looking for an experienced SailPoint consultant who has experience with both Deployment and BAU work and is interested in joining a business which is at the start of an interesting IAM Journey
- SOC Manager Security Operations. SIEM, Threat / Vulnerability, IR, SOC Service- Exclusive
- United Kingdom
SOC Manager- SIEM, Threat / Vulnerability, Incident response. Exclusive Project. Management and on growth growth of Security Operations Centre capability. Managing and maturing the team, technical services line and fronting client engagements where needed. An in-depth technical background is essential, experience across SOC SIEM/ Threat Hunting (IR) tools, processes, techniques, operational is a MUST. The role will include, but not limited to; evolving the technical process, building operational capability, managing and hiring team, involved at a high level overviewing policy/playbooks, fine turning of the go-to-market collateral etc.
- Contact 12 month- Security Operations- Tanium Engineer / Analyst.
- United Kingdom
- Dependent on experience
Security Operations engineer / Analyst with Tanium for a 12 month contract. Experience configuring using, managing, supporting troubleshooting Tanium's suite of end point solutions is essential. The opportunity is due to a client expanding its international capability to a follow the sun model. To be involved in spinning up a European capability. Based in the UK. English essential and ideally being fluent in French.