loopbackio / loopbackio/security

Replace Secvisogram with `csaf-validator-lib`

Offen
#35 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
4
Forks
1
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Overview

Secvisogram is a project for a React-powered, web-based Common Security Advisory Framework Version 2.0 (CSAF 2.0) validator.

https://github.com/loopbackio/security/pull/5 / https://github.com/loopbackio/security/commit/17f860ad6f885177033f809bc4fefb14782e0c53 added CSAF 2.0 validation with Secvisogram. When that change was merged, Secvisogram was bundled as a single solution, and the validation code was not distributed separately. Hence, we implemented a hacky solution to import the entire project and then to call only the validation logic. Notably, this includes:

  • Installing all of Secvisogram's depenencies
  • Re-constructing and executing relevant parts of Secvisogram's custom build pipeline

Since then, this validation code has been decoupled and Secvisogram has been updated to use the csaf-validator-lib Node.js module (https://github.com/BSI-Bund/secvisogram/pull/39 / https://github.com/BSI-Bund/secvisogram/commit/4487b6b0032348b487fe05e881da8f654b2f78ec).

Benefits of making the switch include:

  • A more stable interface for us to bootstrap and use the dependency.
  • Reduced build pipeline complexity
  • Removed need for frontend build pipeline knowledge
  • Reduced attack surface from unneeded web frontend packages.

Implementation remarks

The current approach involves:

  • git submodule-ing https://github.com/BSI-Bund/secvisogram.git
  • Installing Secvisogram's dependencies and calling Babel as part of the build pipeline
  • Manually copying some non-JavaScript resources to the distibution directory
  • Importing validation logic from dist/shared/Core

In contrast, the new approach would involve:

  • git submodule-ing https://github.com/secvisogram/csaf-validator-lib.git
    Although the csaf-validator-lib README indicates to use git subtree, git submodule is better for explicitly linking two Git repositories together. In contrast, git subtree copies the Git history without any coupling to the source Git repository.
  • Installing csaf-validator-lib's production dependencies

This switch would also bring in the latest features and validation tests such Test 6.3.8 ("Spell check", powered by the Hunspell spell checking library), of which the BSI-Bund Git repository is currently lacking.

Mitigating against NPM dependency confusion attacks

At time of writing, csaf-validator-lib is not published as an NPM package, hence the need to install this as a "local dependency". To mitigate against NPM dependency confusion attacks, it is important that the package.json dependency entry explicitly points to the local copy.

We can achieve this "explicit pointer" requirement by leveraging package aliases, which was introduced in

This issue is to track switching over to csaf-validator-lib

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das aktuelle Secvisogram-Submodul, die Dependency-Konfiguration von package.json, die Build-Pipeline und die Importe aus dist/shared/Core nachzuverfolgen. Ersetze diese Integration durch das csaf-validator-lib-Submodul und dessen Produktionsabhängigkeiten und überprüfe anschließend, dass die CSAF-Validierung und der bestehende Build weiterhin funktionieren, einschließlich der im Issue beschriebenen neueren Validierungsabdeckung.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
node.js, typescript
Bereich
build-system, security
Issue-Typ
Refactoring
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.