diff --git a/command-line-tool/README.md b/command-line-tool/README.md deleted file mode 100644 index 0a40cd7..0000000 --- a/command-line-tool/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Command-line Generator and Validator - -A Python command-line tool to help maintainters, developers, and contributors to generate or validate the SECURITY INSIGHTS yaml file. - -## Usage - -Install the requirements using `pip` - -``` -pip install -r requirements.txt --user -``` - -If you want to validate a `SECURITY-INSIGHTS.yml`, launch the following command: - -``` -python validator-and-generator.py verify /path/to/SECURITY-INSIGHTS.yml /path/to/security-insights-schema.yml -``` - -If you want to create a new `SECURITY-INSIGHTS.yml` by complying the YAML schema, launch this command: - -``` -python validator-and-generator.py create /path/to/save/SECURITY-INSIGHTS.yml /path/to/security-insights-schema.yml -``` - -and fill out the questionnaire by following the wizard. The questions labeled with `(optional)` are not mandatory and can be skipped. - -## Bugs - -If you find any bugs, please open an issue or submit a pull request. - -### Known Bugs - -- [ ] Value type and format are not printed in the wizard -- [ ] The script accepts just `True` or `False` for boolean values (case sensitive) -- [ ] The script supports just single-line comments - -## Security - -If you find a security vulnerability, please report it to me privately at luigi[-dot-]gubello[-at-]protonmail.com. - - - diff --git a/validators/python/Dockerfile b/validators/python/Dockerfile new file mode 100644 index 0000000..8cf923e --- /dev/null +++ b/validators/python/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.11-bullseye + +WORKDIR /app + +COPY . . + +RUN pip install -r requirements.txt + +RUN chmod +x validator-and-generator.py + +RUN ln --symbolic /app/validator-and-generator.py /usr/bin/si-validator \ No newline at end of file diff --git a/validators/python/README.md b/validators/python/README.md new file mode 100644 index 0000000..43966e6 --- /dev/null +++ b/validators/python/README.md @@ -0,0 +1,42 @@ +# Command-line Generator and Validator + +A Python command-line tool to help maintainters, developers, and contributors to generate or validate the SECURITY INSIGHTS yaml file. + +## Usage + +[Docker](https://www.docker.com/) needs to be installed. Build the container image: + +``` +docker build -t sec-insights . +``` + +If you want to validate a `SECURITY-INSIGHTS.yml`, run the following command: + +``` +docker run -v $(pwd)/../..:/security-insights -it sec-insights si-validator verify /security-insights/examples/security-insights-minimal-sample.yml /security-insights/security-insights-schema-1.0.0.yaml +``` + +If you want to create a new `SECURITY-INSIGHTS.yml` by complying the YAML schema, launch this command: + +``` +docker run -v $(pwd)/../..:/security-insights -it sec-insights si-validator create /security-insights/examples/security-insights-minimal-sample.yml /security-insights/security-insights-schema-1.0.0.yaml +``` + +and fill out the questionnaire by following the wizard. The questions labeled with `(optional)` are not mandatory and can be skipped. + +## Bugs + +If you find any bugs, please open an issue or submit a pull request. + +### Known Bugs + +- [ ] Value type and format are not printed in the wizard +- [ ] The script accepts just `True` or `False` for boolean values (case sensitive) +- [ ] The script supports just single-line comments + +## Security + +If you find a security vulnerability, please report it via [GitHub private vulnerability reporting](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability). + + + diff --git a/command-line-tool/requirements.txt b/validators/python/requirements.txt similarity index 100% rename from command-line-tool/requirements.txt rename to validators/python/requirements.txt diff --git a/command-line-tool/validator-and-generator.py b/validators/python/validator-and-generator.py similarity index 99% rename from command-line-tool/validator-and-generator.py rename to validators/python/validator-and-generator.py index 4a18b8c..45f12e4 100644 --- a/command-line-tool/validator-and-generator.py +++ b/validators/python/validator-and-generator.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import collections import click import jsonschema