anistark / anistark/feluda

enhancement: read the rpm ndb database backend

Fermée
#263 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
difficulty: medium enhancement
Langage dominant
Rust
Étoiles
471
Forks
27
Merge moyen
22 h 46 min
PR mergées (30 j)
8

Description

Tracked by #247.

## Summary

The rpm cataloger reads only the sqlite backend. A filesystem whose rpm database uses ndb errors out rather than being scanned, which today means SUSE and openSUSE cannot be scanned natively at all. This is a current distribution, not a legacy format.

## Current state

- The three backends are recognised by filename, [src/filesystem/rpm/mod.rs#L38-L44](https://github.com/anistark/feluda/blob/83b4051/src/filesystem/rpm/mod.rs#L38-L44).
- Anything other than sqlite returns an error pointing at `syft` and `--sbom-input`, [src/filesystem/rpm/mod.rs#L61-L68](https://github.com/anistark/feluda/blob/83b4051/src/filesystem/rpm/mod.rs#L61-L68). The failure mode is right, it is still a failure.
- `src/filesystem/rpm/` holds `sqlite.rs` with no reader for the other two.

## Proposed change

- Add an ndb reader beside `sqlite.rs`, producing the same header blobs the existing [`header`](https://github.com/anistark/feluda/blob/83b4051/src/filesystem/rpm/header.rs) parser already consumes, so only the storage layer is new.
- Leave Berkeley DB unsupported and keep erroring on it. rpm uses it as a plain key value store of headers, so walking the hash pages is enough and linking libdb is not required, but it is a few hundred lines of format work for CentOS 7 and RHEL 8 era images that are going out of support. File it separately if someone asks by name.

## Acceptance criteria

- `feluda --filesystem ` catalogs installed packages instead of erroring.
- Berkeley DB still errors with a message naming the backend.
- Header parsing, license extraction and purl construction are shared with the sqlite path rather than duplicated.

## References

- rpm ndb format, https://github.com/rpm-software-management/rpm/blob/master/lib/backend/ndb/rpmpkg.c

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start with src/filesystem/rpm/mod.rs and sqlite.rs, then read src/filesystem/rpm/header.rs and the linked rpm ndb format reference. Use an openSUSE rootfs with feluda --filesystem to check that installed packages are cataloged, and verify Berkeley DB still errors with its backend named; shared header parsing, license extraction, and purl construction should remain intact.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
rust
Domaine
backend
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
52/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.