Fingerprint inference of software artifacts
Fingerprint inference of software artifacts includes receiving a request including classes, generating request fingerprints from the classes, and querying at least one index with the request fingerprints to identify a matching set of artifact versions. Fingerprint inference further includes obtaining, for each matching artifact version in the matching set of artifact versions, a count of the request fingerprints matching a indexed fingerprint related, in the at least one index, to the artifact version, and selecting a subset of the matching set of artifact versions having a count that is maximal amongst the matching set of artifact versions. Fingerprint inference further includes returning the subset of the matching set of artifact versions.
1 . A method comprising:
receiving a first request comprising a first plurality of classes;
executing instructions, stored in memory, on a computer processor to generate a first plurality of request fingerprints from the first plurality of classes;
executing instructions, stored in memory, on a computer processor to query at least one index with the first plurality of request fingerprints to identify a first matching set of artifact versions;
obtaining, for each matching artifact version in the first matching set of artifact versions, a count of the first plurality of request fingerprints matching an indexed fingerprint related, in the at least one index, to the artifact version;
executing instructions, stored in memory, on a computer processor to select a subset of the first matching set of artifact versions having a count that is maximal amongst the first matching set of artifact versions; and
returning the subset of the first matching set of artifact versions.
2 . The method of claim 1 , further comprising:
receiving a second request comprising a second plurality of classes;
generating a second plurality of request fingerprints from the second plurality of classes;
querying the at least one index with the second plurality of request fingerprints to identify a second matching set of artifact versions and a matching set of artifacts;
making a determination that the second matching set of artifact versions is empty; and
returning the matching set of artifacts based on the determination.
3 . The method of claim 1 , further comprising:
obtaining, for a plurality of artifacts comprising a plurality of artifact versions, a third plurality of classes;
generating a plurality of fingerprints for the third plurality of classes; and
indexing the plurality of fingerprints in the at least one index to obtain a plurality of indexed fingerprints.
4 . The method of claim 3 , further comprising:
filtering the third plurality of classes based on a comparison, for each class in the third plurality of classes, a number of the plurality of artifacts having the class with a class threshold to obtain a plurality of filtered classes,
wherein generating the plurality of fingerprints using the third plurality of classes is performed for the plurality of filtered classes.
5 . The method of claim 4 , wherein the class threshold is one.
6 . The method of claim 3 , further comprising:
performing, for a class of the third plurality of classes, a comparison of a number of artifact versions having the class with a version threshold; and
adding the indexed fingerprint in the plurality of fingerprints to an artifact version level fingerprint index of the at least one index based on the comparison indicating that the number satisfies the version threshold,
wherein the indexed fingerprint is related to each artifact version having the class in the artifact version level fingerprint index.
7 . The method of claim 6 , further comprising:
adding the indexed fingerprint in the plurality of fingerprints to an artifact level fingerprint index of the at least one index based on the comparison indicating that the number fails to satisfy the version threshold,
wherein the indexed fingerprint is related to an artifact having the class in the artifact level fingerprint index.
8 . The method of claim 1 , further comprising:
detecting a set of vulnerabilities of the subset of the first matching set of artifact versions; and
responding to the first request with the set of vulnerabilities.
9 . A system comprising:
a fingerprint repository comprising at least one index; and
a software component analysis program executing on a computer processor comprising:
an interface for:
receiving a first request comprising a first plurality of classes, and
returning a subset of a first matching set of artifact versions,
a fingerprint generator for generating a first plurality of request fingerprints from the first plurality of classes, and
a component detector for:
querying at least one index in the fingerprint repository with the first plurality of request fingerprints to identify the first matching set of artifact versions,
obtaining, for each matching artifact version in the first matching set of artifact versions, a count of the first plurality of request fingerprints matching an indexed fingerprint related, in the at least one index, to the artifact version, and
selecting the subset of the first matching set of artifact versions having a count that is maximal amongst the first matching set of artifact versions.
10 . The system of claim 9 , wherein
the interface is further for:
receiving a second request comprising a second plurality of classes, and
returning a matching set of artifacts based on a determination,
the fingerprint generator is further for generating a second plurality of request fingerprints from the second plurality of classes,
the component detector is further for:
querying the at least one index in the fingerprint repository with the second plurality of request fingerprints to identify a second matching set of artifact versions and a matching set of artifacts, and
making the determination that the second matching set of artifact versions is empty.
11 . The system of claim 9 , further comprising:
a repository constructor for:
obtaining, for a plurality of artifacts comprising a plurality of artifact versions, a third plurality of classes,
wherein the fingerprint generator is further for generating a plurality of fingerprints for the third plurality of classes; and
the repository constructor comprising a fingerprint repository builder for indexing the plurality of fingerprints in the at least one index to obtain a plurality of indexed fingerprints.
12 . The system of claim 11 , wherein the repository constructor further comprises:
a filter for filtering the third plurality of classes based on a comparison, for each class in the third plurality of classes, a number of the plurality of artifacts having the class with a class threshold to obtain a plurality of filtered classes,
wherein generating the plurality of fingerprints using the third plurality of classes is performed for the plurality of filtered classes.
13 . The system of claim 12 , wherein the class threshold is one.
14 . The system of claim 11 , wherein the repository constructor further comprises:
a filter for performing, for a class of the third plurality of classes, a comparison of a number of artifact versions having the class with a version threshold,
wherein the fingerprint repository builder is further for adding the indexed fingerprint in the plurality of fingerprints to an artifact version level fingerprint index of the at least one index based on the comparison indicating that the number satisfies the version threshold, and
wherein the indexed fingerprint is related to each artifact version having the class in the artifact version level fingerprint index.
15 . The system of claim 14 , wherein the fingerprint repository builder is further for:
adding the indexed fingerprint in the plurality of fingerprints to an artifact level fingerprint index of the at least one index based on the comparison indicating that the number fails to satisfy the version threshold,
wherein the indexed fingerprint is related to an artifact having the class in the artifact level fingerprint index.
16 . The system of claim 9 , further comprising:
a software manager program for:
detecting a set of vulnerabilities of the subset of the first matching set of artifact versions; and
responding to the first request with the set of vulnerabilities.
17 . A non-transitory computer readable medium comprising computer readable program code for causing a computing system to perform operations comprising:
receiving a first request comprising a first plurality of classes;
generating a first plurality of request fingerprints from the first plurality of classes;
querying at least one index with the first plurality of request fingerprints to identify a first matching set of artifact versions;
obtaining, for each matching artifact version in the first matching set of artifact versions, a count of the first plurality of request fingerprints matching an indexed fingerprint related, in the at least one index, to the artifact version;
selecting a subset of the first matching set of artifact versions having a count that is maximal amongst the first matching set of artifact versions; and
returning the subset of the first matching set of artifact versions.
18 . The non-transitory computer readable medium of claim 17 , wherein the operations further comprise:
receiving a second request comprising a second plurality of classes;
generating a second plurality of request fingerprints from the second plurality of classes;
querying the at least one index with the second plurality of request fingerprints to identify a second matching set of artifact versions and a matching set of artifacts;
making a determination that the second matching set of artifact versions is empty; and
returning the matching set of artifacts based on the determination.
19 . The method of claim 1 , wherein the first plurality of classes is in binary code.
20 . The system of claim 9 , wherein the first plurality of classes is in binary code.