Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Jul 13, 2023
2 parents 7efc5e7 + b93b10d commit e6a36b0
Show file tree
Hide file tree
Showing 21 changed files with 607 additions and 375 deletions.
88 changes: 50 additions & 38 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,26 @@ env:
NODE_VERSION: 18.16.0
# https://github.com/helm/helm/releases
HELM_VERSION: 3.11.2
# https://npmjs.com/package/snyk?activeTab=versions
SNYK_VERSION: 1.1187.0
# https://github.com/oras-project/oras/releases
ORAS_VERSION: 1.0.0

jobs:
sast-creds:
name: SAST - Credentials
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected].2
uses: actions/[email protected].3
with:
# We need all Git history for testing credentials
fetch-depth: 0
# Ensure all submodules up-to-date
submodules: recursive

- name: SAST - Credentials
uses: trufflesecurity/trufflehog@v3.33.0
uses: trufflesecurity/trufflehog@v3.44.0
with:
base: ${{ github.event.repository.default_branch }}
head: HEAD
Expand All @@ -53,7 +57,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected].2
uses: actions/[email protected].3
with:
# We need all Git history for "version.sh"
fetch-depth: 0
Expand All @@ -73,7 +77,7 @@ jobs:

# Required for running "npx" CLI
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version: ${{ env.NODE_VERSION }}

Expand Down Expand Up @@ -112,20 +116,10 @@ jobs:
--severity-threshold=medium \
.helm-template
# Fix issue "Error: Code Scanning could not process the submitted SARIF file: rejecting SARIF, as there are more runs than allowed (XX > 20)"
# See: https://github.com/github/codeql-action/issues/220
- name: Merge SARIF files
run: |
npx --yes @microsoft/sarif-multitool@${{ env.SARIF_MULTITOOL_VERSION }} \
merge \
--merge-runs \
--output-file merged.sarif \
snyk.sarif
- name: Upload results to GitHub Security
uses: github/codeql-action/upload-sarif@v2.2.12
uses: github/codeql-action/upload-sarif@v2.20.3
with:
sarif_file: merged.sarif
sarif_file: snyk.sarif

deploy-helm:
name: Deploy Helm chart
Expand All @@ -137,7 +131,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected].2
uses: actions/[email protected].3
with:
# Chart Releaser needs to have local access to "gh-pages" plus current branch
fetch-depth: 0
Expand Down Expand Up @@ -177,7 +171,7 @@ jobs:
src: [conversation-api, conversation-ui]
steps:
- name: Checkout
uses: actions/[email protected].2
uses: actions/[email protected].3
with:
# We need all Git history for "version.sh"
fetch-depth: 0
Expand All @@ -197,31 +191,31 @@ jobs:
- name: Setup QEMU
id: setup-qemu
uses: docker/setup-qemu-action@v2.1.0
uses: docker/setup-qemu-action@v2.2.0
with:
platforms: ${{ env.CONTAINER_PLATFORMS }}

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2.5.0
uses: docker/setup-buildx-action@v2.9.1
with:
version: v${{ env.BUILDX_VERSION }}

# Required for running "npx" CLI
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version: ${{ env.NODE_VERSION }}

- name: Login to container registry
uses: docker/login-action@v2.1.0
uses: docker/login-action@v2.2.0
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Container meta
id: meta
uses: docker/metadata-action@v4.4.0
uses: docker/metadata-action@v4.6.0
with:
images: ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_NAME }}/${{ matrix.src }}
tags: |
Expand All @@ -244,7 +238,7 @@ jobs:
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Build/push container
uses: docker/build-push-action@v4.0.0
uses: docker/build-push-action@v4.1.1
with:
build-args: |
VERSION=${{ steps.version.outputs.version_full }}
Expand Down Expand Up @@ -275,20 +269,10 @@ jobs:
--severity-threshold=medium \
${{ steps.tag.outputs.tag }}
# Fix issue "Error: Code Scanning could not process the submitted SARIF file: rejecting SARIF, as there are more runs than allowed (XX > 20)"
# See: https://github.com/github/codeql-action/issues/220
- name: Merge SARIF files
run: |
npx --yes @microsoft/sarif-multitool@${{ env.SARIF_MULTITOOL_VERSION }} \
merge \
--merge-runs \
--output-file merged.sarif \
snyk.sarif
- name: Upload results to GitHub Security
uses: github/codeql-action/upload-sarif@v2.2.12
uses: github/codeql-action/upload-sarif@v2.20.3
with:
sarif_file: merged.sarif
sarif_file: snyk.sarif

sast-semgrep:
name: SAST - Semgrep
Expand All @@ -300,7 +284,7 @@ jobs:
image: returntocorp/semgrep
steps:
- name: Checkout
uses: actions/[email protected].2
uses: actions/[email protected].3

- name: Run tests
# Semgrep can be used to break the build when it detects security issues. In this case we want to upload the issues to GitHub Security
Expand All @@ -310,6 +294,34 @@ jobs:
run: semgrep ci --sarif --output=semgrep.sarif

- name: Upload results to GitHub Security
uses: github/codeql-action/upload-sarif@v2.2.12
uses: github/codeql-action/upload-sarif@v2.20.3
with:
sarif_file: semgrep.sarif

deploy-artifacthub-metadata:
name: Deploy ArtifactHub metadata
# Only deploy on main branch, as we don't want to break verification with a bad metadata file during development
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]

- name: Setup ORAS
uses: oras-project/[email protected]
with:
version: ${{ env.ORAS_VERSION }}

- name: Login to registry
uses: docker/[email protected]
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push to registry
run: |
oras push \
${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_NAME }}:artifacthub.io \
artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml \
--config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml
83 changes: 83 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [Clémence Lesné](mailto:[email protected]). All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 🔒 Private GPT
# Employee communication with Private GPT – AI-powered chatbot you can trust

> 👋🏻 Demo available at [private-gpt.shopping-cart-devops-demo.lesne.pro](https://private-gpt.shopping-cart-devops-demo.lesne.pro).
Expand Down Expand Up @@ -153,4 +153,12 @@ sequenceDiagram

WIP

## [Security](./SECURITY.md)

## Support

This project is open source and maintained by people like you. If you need help or found a bug, please feel free to open an issue on the [clemlesne/private-gpt](https://github.com/clemlesne/private-gpt) GitHub project.

## [Code of conduct](./CODE_OF_CONDUCT.md)

## [Authors](./AUTHORS.md)
21 changes: 21 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Security Policy

## Proactive detection of vulnerabilities

At each build, a vulnerability scan is performed on the system. If a vulnerability that can be upgraded is detected, the build is stopped and the image is not pushed to the registry. Vulnerability is reported in [GitHub Security](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning). The maintainers are alterted and have access to reports.

Automation is supported by [Snyk](https://snyk.io) and [Semgrep](https://semgrep.dev). Helm chart, configuration files, and containers, are scanned for vulnerabilities and misconfigurations.

## Reporting a vulnerability

If you think you have found a vulnerability, please do not open an issue on GitHub. Instead, please send an email to [Clémence Lesné](mailto:[email protected]).

## Chain of trust

Helm chart and containers are not signed yet with a GPG key.

## Reliability notes

Systems are built every days. Each image is accompanied by a SBOM (Software Bill of Materials) which allows to verify that the installed packages are those expected. This speed has the advantage of minimizing exposure to security flaws, which will then be corrected on the build environments in 24 hours.

Nevertheless it can happen that a package provider (e.g. Debian, Canonical, Red Hat) deploys a system update that introduces a bug. This is difficult to predict.
4 changes: 4 additions & 0 deletions artifacthub-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
repositoryID: 06ff1e13-8ff5-42a2-b081-0d647a731827
owners:
- name: clemlesne
email: [email protected]
16 changes: 16 additions & 0 deletions cicd/helm/private-gpt/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ name: private-gpt
description: Private GPT is a local version of Chat GPT, using Azure OpenAI.
version: 0.0.0
apiVersion: v1
keywords:
- ai-assisted-chat
- azure-openai
- business-productivity
- chatgpt
- cloud-based-chat
- conversational-interface
- deploy-chatbot
- employee-communication
- employee-engagement
- enterprise-grade-platform
- internal-communication
- local-chatbot
- natural-language-processing
- private-gpt
- virtual-assistant-for-employees
dependencies:
- name: qdrant
version: 0.2.9
Expand Down
Binary file modified docs/doc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e6a36b0

Please sign in to comment.