Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
aac90f5
code updates for vault.py
sclinnell Sep 12, 2023
bb1d087
more changes for return objects
sclinnell Sep 12, 2023
dd468a2
some final changes to clean up the code
sclinnell Sep 13, 2023
b6f5570
update pipfile stuff
sclinnell Sep 13, 2023
25e88e6
new updates
sclinnell Sep 13, 2023
5661150
updates from suggestions
sclinnell Sep 13, 2023
8ffdc3b
updating how the config file is pulled in
krkazmier Sep 13, 2023
d336418
change to read secret by name
sclinnell Sep 20, 2023
ff63555
update tests
sclinnell Sep 20, 2023
3dc3b4f
add mock vals
sclinnell Sep 20, 2023
f14ce82
updating some things
sclinnell Sep 20, 2023
84dcc9c
addition for updating secret
sclinnell Sep 21, 2023
abadda5
final updates for dss
sclinnell Sep 25, 2023
b2df7e5
Update cronjob.yaml
sclinnell Sep 27, 2023
0534067
Update cronjob.yaml
sclinnell Sep 27, 2023
d4b2056
Update cronjob.yaml
sclinnell Sep 27, 2023
ca59c52
adding case for empty secret
sclinnell Oct 19, 2023
d5364de
return a request response instead of string
sclinnell Oct 19, 2023
03de258
Patching python dependencies (#25)
krkazmier May 8, 2024
500b534
pulling in patching from main (#29)
krkazmier May 15, 2024
296689c
Patching (#35)
krkazmier Mar 13, 2025
e9de35b
Added changes from main to ibm-cloud-secrets-manager
carloscumpian Mar 18, 2026
074b74f
Revert "Added changes from main to ibm-cloud-secrets-manager"
carloscumpian Mar 18, 2026
663c7a1
Re-apply updates from main (revert the revert)
carloscumpian Mar 18, 2026
1deb9f3
Initial GHA test
carloscumpian Mar 31, 2026
91a1bb7
Update runner and add cache
carloscumpian Mar 31, 2026
82b4d7f
Update runner to use GHs
carloscumpian Mar 31, 2026
3964aa0
Add setuptools installations
carloscumpian Mar 31, 2026
8c168f0
Fix for pkg_resources error
carloscumpian Mar 31, 2026
f9da086
Add pipenv install setuptools + wheel
carloscumpian Mar 31, 2026
3b5df78
Fix ibm-cloud-sdk-core
carloscumpian Mar 31, 2026
e23a19a
Move fix to env section
carloscumpian Mar 31, 2026
4fa0c19
Update ibm-db to fix error
carloscumpian Mar 31, 2026
593130a
Add ibm-cloud-sdk-core to Pipfile for tests to function
carloscumpian Mar 31, 2026
8c0d6fc
Update pip for tests
carloscumpian Mar 31, 2026
75035b9
Add GD_VAULT_CONF env to fix tests errors
carloscumpian Mar 31, 2026
6eac933
Fix vault_test.py by using GD_VAULT_CONF env
carloscumpian Mar 31, 2026
04e0df9
Fix mock data for vault_test.py
carloscumpian Mar 31, 2026
60aa8d2
Update mock tests for vault_test.py
carloscumpian Mar 31, 2026
643735d
Update mock tests for vault_test.py p.2
carloscumpian Mar 31, 2026
3ab31a3
Fix cryptography vuln in pipfile
carloscumpian Mar 31, 2026
e76db3a
Add pipenv to pre-commit due to GHA diff
carloscumpian Mar 31, 2026
8ea07b3
Fix format based on pre=commit checks
carloscumpian Mar 31, 2026
a077040
Fix python-pkg vulns
carloscumpian Mar 31, 2026
38da1d4
Revert pipfile changes + update packages in dockerfile
carloscumpian Mar 31, 2026
99e73ec
Fix wheel and jaraco.context vulns
carloscumpian Mar 31, 2026
c885703
Fix wheel and jaraco.context vulns in Dockerfile Stage 3
carloscumpian Mar 31, 2026
b9bde5f
Update how packages are updated in docker
carloscumpian Mar 31, 2026
51ccbde
Update setuptools version in Dockerfile
carloscumpian Mar 31, 2026
b33cd2c
Update to exact version + remove --upgrade from Dockerfile
carloscumpian Mar 31, 2026
b9f7d9b
Add -f flag to makefile for plugin
carloscumpian Mar 31, 2026
e9dbb87
Upgraded pyjwt + set exact versions for ibm-secrets + cloud
carloscumpian Mar 31, 2026
b4572ab
Remove blank space in Pipfile
carloscumpian Mar 31, 2026
53d05d3
Update pipfile.lock
carloscumpian Apr 1, 2026
6471719
Pin 3.12.13 version + uncomment deploy section
carloscumpian Apr 2, 2026
a4fb3b1
Update how GHA handles cache/version changes
carloscumpian Apr 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 201 additions & 0 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
name: Test and Deploy DSS

on:
push:
branches:
- main
- add-gh-actions
tags:
- '*'
pull_request:
branches:
- main

env:
PYTHON_VERSION: '3.12.13'
CONTAINER_REGISTRY: icr.io
IBM_CLOUD_REGION: us-east
DOCKER_IMAGE_NAME: icr.io/git-defenders/detect-secrets-stream

jobs:
test:
name: Test and Quality Checks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set VERSION environment variable
run: |
if [ -n "${{ github.ref_type == 'tag' && github.ref_name || '' }}" ]; then
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
else
echo "VERSION=github-actions-${{ github.run_number }}-$(date +%Y%m%d-%H%M%S)" >> $GITHUB_ENV
fi

- name: Display build version
run: echo "Build Version=${{ env.VERSION }}"

- name: Cache Trivy
uses: actions/cache@v4
with:
path: ~/.cache/trivy
key: ${{ runner.os }}-trivy-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-trivy-

- name: Cache pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pre-commit-

- name: Cache cosign
uses: actions/cache@v4
with:
path: ~/.cache/cosign
key: ${{ runner.os }}-cosign-${{ hashFiles('**/Makefile') }}
restore-keys: |
${{ runner.os }}-cosign-

- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Cache pipenv virtualenv
uses: actions/cache@v4
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-${{ env.PYTHON_VERSION }}-

- name: Cache IBM Cloud CLI
uses: actions/cache@v4
with:
path: |
/usr/local/bin/ibmcloud
~/.bluemix
key: ${{ runner.os }}-ibmcloud-${{ hashFiles('**/Makefile') }}
restore-keys: |
${{ runner.os }}-ibmcloud-

- name: Cache Skaffold
uses: actions/cache@v4
with:
path: /usr/local/bin/skaffold
key: ${{ runner.os }}-skaffold-latest
restore-keys: |
${{ runner.os }}-skaffold-

- name: Cache Kustomize
uses: actions/cache@v4
with:
path: /usr/local/bin/kustomize
key: ${{ runner.os }}-kustomize-latest
restore-keys: |
${{ runner.os }}-kustomize-

- name: Cache container-structure-test
uses: actions/cache@v4
with:
path: /usr/local/bin/container-structure-test
key: ${{ runner.os }}-container-structure-test-latest
restore-keys: |
${{ runner.os }}-container-structure-test-

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Install dependencies
run: make setup
env:
TRAVIS: true # Some Makefile targets check for this

- name: Run tests and quality checks
run: make travis-test
env:
TRAVIS: true
GD_VAULT_CONF: /home/runner/vault.prod.conf

deploy:
name: Deploy to Container Registry
runs-on: ubuntu-latest
needs: test
if: |
github.event_name == 'push' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set VERSION environment variable
run: |
if [ -n "${{ github.ref_type == 'tag' && github.ref_name || '' }}" ]; then
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
else
echo "VERSION=github-actions-${{ github.run_number }}-$(date +%Y%m%d-%H%M%S)" >> $GITHUB_ENV
fi

- name: Display build version
run: echo "Build Version=${{ env.VERSION }}"

- name: Cache Trivy
uses: actions/cache@v4
with:
path: ~/.cache/trivy
key: ${{ runner.os }}-trivy-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-trivy-

- name: Cache cosign
uses: actions/cache@v4
with:
path: ~/.cache/cosign
key: ${{ runner.os }}-cosign-${{ hashFiles('**/Makefile') }}
restore-keys: |
${{ runner.os }}-cosign-

- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install deployment dependencies
run: make setup
env:
TRAVIS: true

- name: Deploy to registry
run: make travis-deploy
env:
IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY }}
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PUBLIC_KEY: ${{ secrets.COSIGN_PUBLIC_KEY }}
VERSION: ${{ env.VERSION }}
7 changes: 4 additions & 3 deletions Dockerfiles/Dockerfile.dss
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Stage 1, create base
# Reference from https://github.com/pypa/pipenv/issues/3160#issuecomment-510951442

FROM python:3.12-slim AS base
FROM python:3.12.13-slim AS base

ENV PYROOT /pyroot
ENV PYTHONUSERBASE $PYROOT
ENV PATH $PATH:$PYROOT/bin

RUN pip install pip==25.3
RUN pip install setuptools==78.1.1
RUN pip install pip==26.0
RUN pip install setuptools==82.0.1

RUN apt-get update && \
apt-get upgrade -y && \
Expand All @@ -31,6 +31,7 @@ RUN PIP_USER=1 PIP_IGNORE_INSTALLED=1 pipenv install --system --deploy --ignore-
# Explicitly install packages that are sometimes skipped by pipenv
# Use same PIP_USER=1 environment variable to install to /pyroot
RUN PIP_USER=1 PIP_IGNORE_INSTALLED=1 pip install certifi==2024.12.14 typing-extensions==4.12.2 packaging==24.2 zope.interface==7.2 zope.event==5.0

# Stage 3
FROM base

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ setup: setup-trivy setup-cosign setup-deploy-tools
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
ibmcloud -v
ibmcloud plugin install container-service -f
ibmcloud plugin install container-registry
ibmcloud plugin install container-registry -f

.PHONY: start-local-test-db
start-local-test-db: stop-local-test-db
Expand Down Expand Up @@ -157,7 +157,7 @@ endif
# ignore 41002: coverage <6.0b1 resolved (5.5 installed)! it's part of pytest-cov
# which does not have a version containing the fix.
pipenv check --ignore 41002 --ignore 51499
pre-commit run --all-files --show-diff-on-failure
pipenv run pre-commit run --all-files --show-diff-on-failure

.PHONY: start-db_metrics
start-db_metrics:
Expand Down
8 changes: 5 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ click = "==8.1.8"
flask = "==3.1.1"
backoff = "==2.2.1"
boxsdk = {extras = ["jwt"],version = "==3.12.0"}
cryptography = "==44.0.1"
cryptography = "==46.0.5"
hvac = "==2.3.0"
asyncio = "==3.4.3"
requests = "==2.32.5"
Expand All @@ -36,8 +36,10 @@ gunicorn = "==23.0.0"
gevent = "==24.11.1"
zope.interface = "==7.2"
zope.event = "==5.0"
pyjwt = "==2.10.1"
ibm-db = "==3.2.7"
pyjwt = "==2.12.0"
ibm-db = "==3.2.8"
ibm-cloud-sdk-core = "==3.24.4"
ibm-secrets-manager-sdk = "==2.1.19"
detect-secrets = {ref = "0.13.1+ibm.64.dss", git = "https://github.com/ibm/detect-secrets.git"}
pytest = "==8.3.4"
Werkzeug = "==3.1.5"
Expand Down
Loading
Loading