Skip to content

Commit

Permalink
Merge pull request #38 from ossf/luigigubello/dockerfile-for-python
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddie Knight authored Sep 22, 2023
2 parents 17d5f44 + 7b2b88c commit 75e4a1e
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 42 deletions.
42 changes: 0 additions & 42 deletions command-line-tool/README.md

This file was deleted.

11 changes: 11 additions & 0 deletions validators/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
42 changes: 42 additions & 0 deletions validators/python/README.md
Original file line number Diff line number Diff line change
@@ -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).



File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

import collections
import click
import jsonschema
Expand Down

0 comments on commit 75e4a1e

Please sign in to comment.