Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
This module provides a get_tree function to obtain an ANTLR parse-tree from a UVL-defined feature model
This is a small default library used to parse and print the Universal Variability Language (UVL).
Under the hood it uses ANTLR4 as the parsing library.
The grammar in EBNF form is located in uvl/UVL.g4
and the modifications for Java and Python
On a high level, each feature model in UVL consists of five optional separated elements:
include
keyword or be implicit.constraint
. If the value is a list of constraints the key must be constraints
The following snippet shows a simplified server architecture in UVL. We provide more examples (e.g., to show the composition mechanism) in https://github.com/Universal-Variability-Language/uvl-models/tree/main/Feature_Models.
namespace Server
features
Server {abstract}
mandatory
FileSystem
or // with cardinality: [1..*]
NTFS
APFS
EXT4
OperatingSystem {abstract}
alternative
Windows
macOS
Debian
optional
Logging {
default,
log_level "warn" // Feature Attribute
}
constraints
Windows => NTFS
macOS => APFS
In this snippet, we can recognize the following elements:
Server
is abstract (i.e., corresponds to no implementation artifact.Server
requires a FileSystem
and an OperatingSystem
denoted by the mandatory groupServer
may have Logging
denoted by the optional groupFileSystem
requires at least one type of NTFS
, APFS
, and Ext4
denoted by the or groupOperatingSystem
has exactly one type of Windows
, macOS
, and Debian
denoted by the alternative groupLogging
has the feature attribute log_level
attached which is set to "warn"Windows
requires NTFS
denoted by the first cross-tree constraintmacOS
requires APFS
The library is a maven project and can therefore be build with maven. To update the generated parser classes and create a jar with all necessary dependencies, use:
mvn clean compile assembly:single
The target/uvl-parser-1.0-SNAPSHOT-jar-with-dependencies.jar
includes all dependencies.
The class de.vill.main.UVLModelFactory
exposes the static method parse(String)
which will return an instance of a de.vill.model.FeatureModel
class. If there is something wrong, a de.vill.exception.ParseError
is thrown. The parser tries to parse the whole model, even if there are errors. If there are multiple errors, a de.vill.exception.ParseErrorList
is returned which contains all errors that occurred.
A model can be printed with the toString()
method of the de.vill.model.FeatureModel
object.
The following snippet shows a minimal example to read and write UVL models using the jar. More usage examples that also show how to use the acquired UVLModel object can be found in src/main/java/de/vill/main/Example.java
// Read
Path filePath = Paths.get(pathAsString);
String content = new String(Files.readAllBytes(filePath));
UVLModelFactory uvlModelFactory = new UVLModelFactory();
FeatureModel featureModel = uvlModelFactory.parse(content);
// Write
String uvlModel = featureModel.toString();
Path filePath = Paths.get(featureModel.getNamespace() + ".uvl");
Files.write(filePath, uvlModel.getBytes());
UVL models:
Other parsers:
Usage of UVL:
FAQs
This module provides a get_tree function to obtain an ANTLR parse-tree from a UVL-defined feature model
We found that uvlparser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.