<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE FL_Course SYSTEM "https://www.flane.de/dtd/fl_course095.dtd"><?xml-stylesheet type="text/xsl" href="https://portal.flane.ch/css/xml-course.xsl"?><course productid="24034" language="en" source="https://portal.flane.ch/swisscom/en/xml-course/cydrill-dasec-py" lastchanged="2026-01-12T11:33:09+01:00" parent="https://portal.flane.ch/swisscom/en/xml-courses"><title>Desktop Application Security in Python</title><productcode>DASEC-PY</productcode><vendorcode>CY</vendorcode><vendorname>Cydrill</vendorname><fullproductcode>CY-DASEC-PY</fullproductcode><version>1.0</version><objective>&lt;ul&gt;
&lt;li&gt;Getting familiar with essential cyber security concepts&lt;/li&gt;&lt;li&gt;Identify vulnerabilities and their consequences&lt;/li&gt;&lt;li&gt;Learn the security best practices in Python&lt;/li&gt;&lt;li&gt;Input validation approaches and principles&lt;/li&gt;&lt;li&gt;Managing vulnerabilities in third party components&lt;/li&gt;&lt;li&gt;Understanding how cryptography can support appplication security&lt;/li&gt;&lt;li&gt;Learning how to use cryptographic APIs correctly in Python&lt;/li&gt;&lt;/ul&gt;</objective><essentials>&lt;p&gt;General Python development&lt;/p&gt;</essentials><audience>&lt;p&gt;Python developers working on desktop applications&lt;/p&gt;</audience><contents>&lt;ul&gt;
&lt;li&gt;Cyber security basics&lt;/li&gt;&lt;li&gt;Input validation&lt;/li&gt;&lt;li&gt;Security features&lt;/li&gt;&lt;li&gt;Using vulnerable components&lt;/li&gt;&lt;li&gt;Cryptography for developers&lt;/li&gt;&lt;li&gt;Common software security weaknesses&lt;/li&gt;&lt;li&gt;Wrap up&lt;/li&gt;&lt;/ul&gt;</contents><outline>&lt;p&gt;&lt;strong&gt;DAY 1 &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cyber security basics&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What is security?&lt;/li&gt;&lt;li&gt;Threat and risk&lt;/li&gt;&lt;li&gt;Cyber security threat types&lt;/li&gt;&lt;li&gt;Consequences of insecure software
&lt;ul&gt;
&lt;li&gt;Constraints and the market&lt;/li&gt;&lt;li&gt;The dark side&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Input validation&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Input validation principles
&lt;ul&gt;
&lt;li&gt;Blacklists and whitelists&lt;/li&gt;&lt;li&gt;Data validation techniques&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Input validation&lt;/li&gt;&lt;li&gt;What to validate &amp;ndash; the attack surface&lt;/li&gt;&lt;li&gt;Where to validate &amp;ndash; defense in depth&lt;/li&gt;&lt;li&gt;How to validate &amp;ndash; validation vs transformations&lt;/li&gt;&lt;li&gt;Output sanitization&lt;/li&gt;&lt;li&gt;Encoding challenges&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Encoding challenges&lt;/li&gt;&lt;li&gt;Validation with regex&lt;/li&gt;&lt;li&gt;Regular expression denial of service (ReDoS)&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Regular expression denial of service (ReDoS)&lt;/li&gt;&lt;li&gt;Dealing with ReDoS&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Injection
&lt;ul&gt;
&lt;li&gt;Injection principles&lt;/li&gt;&lt;li&gt;Injection attacks&lt;/li&gt;&lt;li&gt;SQL injection
&lt;ul&gt;
&lt;li&gt;SQL injection basics&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; SQL injection&lt;/li&gt;&lt;li&gt;Attack techniques&lt;/li&gt;&lt;li&gt;Content-based blind SQL injection&lt;/li&gt;&lt;li&gt;Time-based blind SQL injection&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;SQL injection best practices
&lt;ul&gt;
&lt;li&gt;Input validation&lt;/li&gt;&lt;li&gt;Parameterized queries&lt;/li&gt;&lt;li&gt;Additional considerations&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; SQL injection best practices&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Hacking Fortnite accounts&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Code injection
&lt;ul&gt;
&lt;li&gt;Code injection via input()&lt;/li&gt;&lt;li&gt;OS command injection
&lt;ul&gt;
&lt;li&gt;Lab &amp;ndash; Command injection&lt;/li&gt;&lt;li&gt;OS command injection best practices&lt;/li&gt;&lt;li&gt;Avoiding command injection with the right APIs&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Command injection best practices&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Shellshock&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Shellshock&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Command injection via ping&lt;/li&gt;&lt;li&gt;Python module hijacking&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Module hijacking&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;General protection best practices&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;DAY 2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Input validation&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Integer handling problems
&lt;ul&gt;
&lt;li&gt;Representing signed numbers&lt;/li&gt;&lt;li&gt;Integer visualization&lt;/li&gt;&lt;li&gt;Integers in Python&lt;/li&gt;&lt;li&gt;Integer overflow&lt;/li&gt;&lt;li&gt;Integer overflow with ctypes and numpy&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Integer problems in Python&lt;/li&gt;&lt;li&gt;Other numeric problems
&lt;ul&gt;
&lt;li&gt;Division by zero&lt;/li&gt;&lt;li&gt;Other numeric problems in Python&lt;/li&gt;&lt;li&gt;Working with floating-point numbers&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Files and streams
&lt;ul&gt;
&lt;li&gt;Path traversal&lt;/li&gt;&lt;li&gt;Path traversal-related examples&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Path traversal&lt;/li&gt;&lt;li&gt;Additional challenges in Windows&lt;/li&gt;&lt;li&gt;Virtual resources&lt;/li&gt;&lt;li&gt;Path traversal best practices&lt;/li&gt;&lt;li&gt;Format string issues&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Unsafe native code
&lt;ul&gt;
&lt;li&gt;Native code dependence&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Unsafe native code&lt;/li&gt;&lt;li&gt;Best practices for dealing with native code&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Security features&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Authentication
&lt;ul&gt;
&lt;li&gt;Authentication basics&lt;/li&gt;&lt;li&gt;Multi-factor authentication&lt;/li&gt;&lt;li&gt;Authentication weaknesses &amp;ndash; spoofing&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; PayPal 2FA bypass&lt;/li&gt;&lt;li&gt;Password management
&lt;ul&gt;
&lt;li&gt;Inbound password management
&lt;ul&gt;
&lt;li&gt;Storing account passwords&lt;/li&gt;&lt;li&gt;Password in transit&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Is just hashing passwords enough?&lt;/li&gt;&lt;li&gt;Dictionary attacks and brute forcing&lt;/li&gt;&lt;li&gt;Salting&lt;/li&gt;&lt;li&gt;Adaptive hash functions for password storage&lt;/li&gt;&lt;li&gt;Password policy
&lt;ul&gt;
&lt;li&gt;NIST authenticator requirements for memorized secrets&lt;/li&gt;&lt;li&gt;Password length&lt;/li&gt;&lt;li&gt;Password hardening&lt;/li&gt;&lt;li&gt;Using passphrases&lt;/li&gt;&lt;li&gt;Password change&lt;/li&gt;&lt;li&gt;Forgotten passwords&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Password reset weakness&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; The Ashley Madison data breach
&lt;ul&gt;
&lt;li&gt;The dictionary attack&lt;/li&gt;&lt;li&gt;The ultimate crack&lt;/li&gt;&lt;li&gt;Exploitation and the lessons learned&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Password database migration&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Outbound password management
&lt;ul&gt;
&lt;li&gt;Hard coded passwords&lt;/li&gt;&lt;li&gt;Best practices&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Hardcoded password&lt;/li&gt;&lt;li&gt;Protecting sensitive information in memory
&lt;ul&gt;
&lt;li&gt;Challenges in protecting memory&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Information exposure
&lt;ul&gt;
&lt;li&gt;Exposure through extracted data and aggregation&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Strava data exposure&lt;/li&gt;&lt;li&gt;System information leakage
&lt;ul&gt;
&lt;li&gt;Leaking system information&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Information exposure best practices&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Python platform security
&lt;ul&gt;
&lt;li&gt;The Python ecosystem and its attack surface&lt;/li&gt;&lt;li&gt;Python bytecode and security&lt;/li&gt;&lt;li&gt;Security features offered by the Python runtime&lt;/li&gt;&lt;li&gt;PEP 578 and audit hooks&lt;/li&gt;&lt;li&gt;Sandboxing Python&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Using vulnerable components&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Assessing the environment&lt;/li&gt;&lt;li&gt;Hardening&lt;/li&gt;&lt;li&gt;Malicious packages in Python&lt;/li&gt;&lt;li&gt;Vulnerability management
&lt;ul&gt;
&lt;li&gt;Patch management&lt;/li&gt;&lt;li&gt;Bug bounty programs&lt;/li&gt;&lt;li&gt;Vulnerability databases&lt;/li&gt;&lt;li&gt;Vulnerability rating &amp;ndash; CVSS&lt;/li&gt;&lt;li&gt;DevOps, the build process and CI / CD&lt;/li&gt;&lt;li&gt;Dependency checking in Python&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Detecting vulnerable components&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;DAY 3&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cryptography for developers&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cryptography basics&lt;/li&gt;&lt;li&gt;Cryptography in Python&lt;/li&gt;&lt;li&gt;Elementary algorithms
&lt;ul&gt;
&lt;li&gt;Random number generation
&lt;ul&gt;
&lt;li&gt;Pseudo random number generators (PRNGs)&lt;/li&gt;&lt;li&gt;Cryptographically strong PRNGs&lt;/li&gt;&lt;li&gt;Using virtual random streams&lt;/li&gt;&lt;li&gt;Weak and strong PRNGs&lt;/li&gt;&lt;li&gt;Using random numbers in Python&lt;/li&gt;&lt;li&gt;Case study &amp;ndash; Equifax credit account freeze&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Using random numbers in Python&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Hashing
&lt;ul&gt;
&lt;li&gt;Hashing basics&lt;/li&gt;&lt;li&gt;Common hashing mistakes&lt;/li&gt;&lt;li&gt;Hashing in Python&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Hashing in Python&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Confidentiality protection
&lt;ul&gt;
&lt;li&gt;Symmetric encryption
&lt;ul&gt;
&lt;li&gt;Block ciphers&lt;/li&gt;&lt;li&gt;Modes of operation&lt;/li&gt;&lt;li&gt;Modes of operation and IV &amp;ndash; best practices&lt;/li&gt;&lt;li&gt;Symmetric encryption in Python&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Symmetric encryption in Python&lt;/li&gt;&lt;li&gt;Asymmetric encryption
&lt;ul&gt;
&lt;li&gt;The RSA algorithm
&lt;ul&gt;
&lt;li&gt;Using RSA &amp;ndash; best practices&lt;/li&gt;&lt;li&gt;RSA in Python&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Elliptic Curve Cryptography
&lt;ul&gt;
&lt;li&gt;The ECC algorithm&lt;/li&gt;&lt;li&gt;Using ECC &amp;ndash; best practices&lt;/li&gt;&lt;li&gt;ECC in Python&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Combining symmetric and asymmetric algorithms
&lt;ul&gt;
&lt;li&gt;Key exchange&lt;/li&gt;&lt;li&gt;Diffie-Hellman key agreement algorithm&lt;/li&gt;&lt;li&gt;Key exchange pitfalls and best practices&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Integrity protection
&lt;ul&gt;
&lt;li&gt;Authenticity and non-repudiation&lt;/li&gt;&lt;li&gt;Message Authentication Code (MAC)
&lt;ul&gt;
&lt;li&gt;MAC in Python&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Calculating MAC in Python&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Digital signature
&lt;ul&gt;
&lt;li&gt;Digital signature with RSA&lt;/li&gt;&lt;li&gt;Digital signature with ECC&lt;/li&gt;&lt;li&gt;Digital signature in Python&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Public Key Infrastructure (PKI)
&lt;ul&gt;
&lt;li&gt;Some further key management challenges&lt;/li&gt;&lt;li&gt;Certificates
&lt;ul&gt;
&lt;li&gt;Chain of trust&lt;/li&gt;&lt;li&gt;PGP &amp;ndash; Web of Trust&lt;/li&gt;&lt;li&gt;Certificate management &amp;ndash; best practices&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Common software security weaknesses&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Time and state
&lt;ul&gt;
&lt;li&gt;Race conditions
&lt;ul&gt;
&lt;li&gt;File race condition
&lt;ul&gt;
&lt;li&gt;Time of check to time of usage &amp;ndash; TOCTTOU&lt;/li&gt;&lt;li&gt;Insecure temporary file&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Avoiding race conditions in Python
&lt;ul&gt;
&lt;li&gt;Thread safety and the Global Interpreter Lock (GIL)&lt;/li&gt;&lt;li&gt;Case study: TOCTTOU in Calamares&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Errors
&lt;ul&gt;
&lt;li&gt;Error and exception handling principles&lt;/li&gt;&lt;li&gt;Error handling
&lt;ul&gt;
&lt;li&gt;Returning a misleading status code&lt;/li&gt;&lt;li&gt;Information exposure through error reporting&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Exception handling
&lt;ul&gt;
&lt;li&gt;In the except,catch block. And now what?&lt;/li&gt;&lt;li&gt;Empty catch block&lt;/li&gt;&lt;li&gt;The danger of assert statements&lt;/li&gt;&lt;li&gt;Lab &amp;ndash; Exception handling mess&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Code quality
&lt;ul&gt;
&lt;li&gt;Language elements
&lt;ul&gt;
&lt;li&gt;Using dangerous language elements&lt;/li&gt;&lt;li&gt;Using obsolete language elements&lt;/li&gt;&lt;li&gt;Portability flaw&lt;/li&gt;&lt;li&gt;Module injection and monkey patching&lt;/li&gt;&lt;li&gt;Dangers of compile(), exec() and eval()&lt;/li&gt;&lt;li&gt;Sandboxing Python&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Denial of service
&lt;ul&gt;
&lt;li&gt;Denial of Service&lt;/li&gt;&lt;li&gt;Resource exhaustion&lt;/li&gt;&lt;li&gt;Cash overflow&lt;/li&gt;&lt;li&gt;Flooding&lt;/li&gt;&lt;li&gt;Algorithm complexity issues&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Wrap up&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Secure coding principles
&lt;ul&gt;
&lt;li&gt;Principles of robust programming by Matt Bishop&lt;/li&gt;&lt;li&gt;Secure design principles of Saltzer and Schr&amp;ouml;der&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;And now what?
&lt;ul&gt;
&lt;li&gt;Software security sources and further reading&lt;/li&gt;&lt;li&gt;Python resources&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;</outline><objective_plain>- Getting familiar with essential cyber security concepts
- Identify vulnerabilities and their consequences
- Learn the security best practices in Python
- Input validation approaches and principles
- Managing vulnerabilities in third party components
- Understanding how cryptography can support appplication security
- Learning how to use cryptographic APIs correctly in Python</objective_plain><essentials_plain>General Python development</essentials_plain><audience_plain>Python developers working on desktop applications</audience_plain><contents_plain>- Cyber security basics
- Input validation
- Security features
- Using vulnerable components
- Cryptography for developers
- Common software security weaknesses
- Wrap up</contents_plain><outline_plain>DAY 1 

Cyber security basics



- What is security?
- Threat and risk
- Cyber security threat types
- Consequences of insecure software

- Constraints and the market
- The dark side
Input validation



- Input validation principles

- Blacklists and whitelists
- Data validation techniques
- Lab – Input validation
- What to validate – the attack surface
- Where to validate – defense in depth
- How to validate – validation vs transformations
- Output sanitization
- Encoding challenges
- Lab – Encoding challenges
- Validation with regex
- Regular expression denial of service (ReDoS)
- Lab – Regular expression denial of service (ReDoS)
- Dealing with ReDoS
- Injection

- Injection principles
- Injection attacks
- SQL injection

- SQL injection basics
- Lab – SQL injection
- Attack techniques
- Content-based blind SQL injection
- Time-based blind SQL injection
- SQL injection best practices

- Input validation
- Parameterized queries
- Additional considerations
- Lab – SQL injection best practices
- Case study – Hacking Fortnite accounts
- Code injection

- Code injection via input()
- OS command injection

- Lab – Command injection
- OS command injection best practices
- Avoiding command injection with the right APIs
- Lab – Command injection best practices
- Case study – Shellshock
- Lab – Shellshock
- Case study – Command injection via ping
- Python module hijacking
- Lab – Module hijacking
- General protection best practices
DAY 2

Input validation



- Integer handling problems

- Representing signed numbers
- Integer visualization
- Integers in Python
- Integer overflow
- Integer overflow with ctypes and numpy
- Lab – Integer problems in Python
- Other numeric problems

- Division by zero
- Other numeric problems in Python
- Working with floating-point numbers
- Files and streams

- Path traversal
- Path traversal-related examples
- Lab – Path traversal
- Additional challenges in Windows
- Virtual resources
- Path traversal best practices
- Format string issues
- Unsafe native code

- Native code dependence
- Lab – Unsafe native code
- Best practices for dealing with native code
Security features



- Authentication

- Authentication basics
- Multi-factor authentication
- Authentication weaknesses – spoofing
- Case study – PayPal 2FA bypass
- Password management

- Inbound password management

- Storing account passwords
- Password in transit
- Lab – Is just hashing passwords enough?
- Dictionary attacks and brute forcing
- Salting
- Adaptive hash functions for password storage
- Password policy

- NIST authenticator requirements for memorized secrets
- Password length
- Password hardening
- Using passphrases
- Password change
- Forgotten passwords
- Lab – Password reset weakness
- Case study – The Ashley Madison data breach

- The dictionary attack
- The ultimate crack
- Exploitation and the lessons learned
- Password database migration
- Outbound password management

- Hard coded passwords
- Best practices
- Lab – Hardcoded password
- Protecting sensitive information in memory

- Challenges in protecting memory
- Information exposure

- Exposure through extracted data and aggregation
- Case study – Strava data exposure
- System information leakage

- Leaking system information
- Information exposure best practices
- Python platform security

- The Python ecosystem and its attack surface
- Python bytecode and security
- Security features offered by the Python runtime
- PEP 578 and audit hooks
- Sandboxing Python
Using vulnerable components



- Assessing the environment
- Hardening
- Malicious packages in Python
- Vulnerability management

- Patch management
- Bug bounty programs
- Vulnerability databases
- Vulnerability rating – CVSS
- DevOps, the build process and CI / CD
- Dependency checking in Python
- Lab – Detecting vulnerable components
DAY 3

Cryptography for developers



- Cryptography basics
- Cryptography in Python
- Elementary algorithms

- Random number generation

- Pseudo random number generators (PRNGs)
- Cryptographically strong PRNGs
- Using virtual random streams
- Weak and strong PRNGs
- Using random numbers in Python
- Case study – Equifax credit account freeze
- Lab – Using random numbers in Python
- Hashing

- Hashing basics
- Common hashing mistakes
- Hashing in Python
- Lab – Hashing in Python
- Confidentiality protection

- Symmetric encryption

- Block ciphers
- Modes of operation
- Modes of operation and IV – best practices
- Symmetric encryption in Python
- Lab – Symmetric encryption in Python
- Asymmetric encryption

- The RSA algorithm

- Using RSA – best practices
- RSA in Python
- Elliptic Curve Cryptography

- The ECC algorithm
- Using ECC – best practices
- ECC in Python
- Combining symmetric and asymmetric algorithms

- Key exchange
- Diffie-Hellman key agreement algorithm
- Key exchange pitfalls and best practices
- Integrity protection

- Authenticity and non-repudiation
- Message Authentication Code (MAC)

- MAC in Python
- Lab – Calculating MAC in Python
- Digital signature

- Digital signature with RSA
- Digital signature with ECC
- Digital signature in Python
- Public Key Infrastructure (PKI)

- Some further key management challenges
- Certificates

- Chain of trust
- PGP – Web of Trust
- Certificate management – best practices
Common software security weaknesses



- Time and state

- Race conditions

- File race condition

- Time of check to time of usage – TOCTTOU
- Insecure temporary file
- Avoiding race conditions in Python

- Thread safety and the Global Interpreter Lock (GIL)
- Case study: TOCTTOU in Calamares
- Errors

- Error and exception handling principles
- Error handling

- Returning a misleading status code
- Information exposure through error reporting
- Exception handling

- In the except,catch block. And now what?
- Empty catch block
- The danger of assert statements
- Lab – Exception handling mess
- Code quality

- Language elements

- Using dangerous language elements
- Using obsolete language elements
- Portability flaw
- Module injection and monkey patching
- Dangers of compile(), exec() and eval()
- Sandboxing Python
- Denial of service

- Denial of Service
- Resource exhaustion
- Cash overflow
- Flooding
- Algorithm complexity issues
Wrap up



- Secure coding principles

- Principles of robust programming by Matt Bishop
- Secure design principles of Saltzer and Schröder
- And now what?

- Software security sources and further reading
- Python resources</outline_plain><duration unit="d" days="3">3 days</duration><pricelist><price country="SI" currency="EUR">2250.00</price><price country="DE" currency="EUR">2250.00</price><price country="AT" currency="EUR">2250.00</price><price country="GB" currency="EUR">2250.00</price><price country="IT" currency="EUR">2250.00</price><price country="NL" currency="EUR">2250.00</price><price country="BE" currency="EUR">2250.00</price><price country="FR" currency="EUR">2250.00</price><price country="MK" currency="EUR">2250.00</price><price country="GR" currency="EUR">2250.00</price><price country="HU" currency="EUR">2250.00</price></pricelist><miles/></course>