☼
⌃
☰

Open Source

Table of Contents

Software whose source code is publicly available — anyone can inspect, modify, and distribute it, subject to the terms of the licence. Dominant in security tooling: virtually every tool in the knowledge base is open source.

Related: DevOps Version Control Git SDLC

Licences

Licence choice determines what others can do with your code. Two main families:

Permissive

Few restrictions — use, modify, and redistribute freely, including in proprietary software.

Licence Key terms
MIT Do anything, keep the copyright notice
Apache 2.0 MIT-like, plus explicit patent grant
BSD 2/3-Clause Similar to MIT, minor variations

Most security tools (Nmap, Metasploit modules, most Python libraries) use permissive licences.

Copyleft

Derivative works must be distributed under the same licence — ensures the code remains open.

Licence Key terms
GPL v2/v3 Derivatives must be GPL; source must be provided
LGPL Like GPL but allows linking from proprietary code
AGPL Like GPL plus covers network use (SaaS)

AGPL specifically targets SaaS — a company cannot run AGPL software as a service without open-sourcing their modifications.

Compatibility

Mixing licences has constraints — GPL code cannot be included in a permissive or proprietary project without the whole becoming GPL. Most organisations have a policy on which licences are acceptable.

Security Implications

Supply chain risk

Open source dependencies are a common attack vector — malicious code injected into popular packages affects every downstream project that depends on them.

TEXT
Notable incidents:
— event-stream (npm, 2018) — malicious code injected via package transfer
— xz-utils (2024) — backdoor in SSH dependency on Linux distros
— SolarWinds (2020) — supply chain attack on proprietary software

Dependency auditing

SHELL
# Python — check for known-vulnerable dependencies
pip audit
pipenv check
safety check

# Node.js
npm audit

# GitHub Dependabot / Snyk — automated scanning in CI

Transparency and trust

Open source code can be audited — vulnerabilities are found by anyone with time and interest, not just the vendor's internal team. This cuts both ways: bugs may persist unnoticed, or may be found and fixed faster than in proprietary software.

Forking and modification

If a dependency is abandoned or compromised, open source allows forking and maintaining your own patched version — not possible with proprietary dependencies.

Common Platforms

  • GitHub — dominant for public and private repositories
  • GitLab — alternative with built-in CI/CD, self-hostable
  • Sourcehut — minimal, privacy-focused alternative
  • PyPI, npm, crates.io — language-specific package registries where open source libraries are published and distributed

Tips

  • Read the licence before using a library in a commercial or distributed product — MIT and Apache 2.0 are the safest for broad compatibility; GPL requires more care
  • Audit your dependencies and their licences as part of the project setup, not as an afterthought
  • Pin dependency versions in production (requirements.txt with exact versions, package-lock.json) — floating dependencies are a supply chain risk
  • Treat any unverified open source package as potentially hostile — check download counts, contributor activity, and recent commit history before adding a dependency