Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e5cd475
Merge pull request #427 from iriusrisk/feature/BLAZ-1137
dfernandezvigo Jan 15, 2025
0a766e5
Merge pull request #428 from iriusrisk/main
dantolin-iriusrisk Jan 15, 2025
c4e1299
Merge pull request #430 from iriusrisk/feature/BLAZ-1300
dantolin-iriusrisk Feb 12, 2025
da3ba63
Merge pull request #432 from iriusrisk/feature/BLAZ-1339
dantolin-iriusrisk Feb 12, 2025
457cefb
[BLAZ-1493] Upgraded vsdx
smaneroiriusrisk Mar 6, 2025
8844900
[BLAZ-1493] Fixed test pipe
smaneroiriusrisk Mar 6, 2025
11a8750
[BLAZ-1493] upgrade python-multipart
smaneroiriusrisk Mar 6, 2025
aa5b85d
Merge pull request #435 from iriusrisk/feature/BLAZ-1493
dantolin-iriusrisk Mar 10, 2025
0fe4ac8
[BLAZ-1548] Improve performance creation docker image
smaneroiriusrisk Mar 17, 2025
fd3cf77
[BLAZ-1548] Fix pygraphviz version for windows pipelines
smaneroiriusrisk Mar 17, 2025
f1ac9da
[BLAZ-1548] Fixed dependencies on python 3.9. Added 3.12 version to q…
smaneroiriusrisk Mar 17, 2025
af84b25
[BLAZ-1548] Fixed dependencies on python 3.9
smaneroiriusrisk Mar 18, 2025
fd65ecc
[BLAZ-1548] Removed qa action for 3.12
smaneroiriusrisk Mar 18, 2025
5dea3a4
[BLAZ-1548] Fix github action for windows and python3.9
smaneroiriusrisk Mar 18, 2025
afe5b53
[BLAZ-1548] Removed windows tests
smaneroiriusrisk Mar 19, 2025
a18157f
[BLAZ-1548] Add python 3.12 qa tests to github action. Remove compati…
smaneroiriusrisk Mar 19, 2025
8531332
[BLAZ-1548] Fix github action qa tests over python 3.12
smaneroiriusrisk Mar 19, 2025
6d5bd99
[BLAZ-1548] Fix github action qa tests over python 3.12
smaneroiriusrisk Mar 19, 2025
11325b2
[BLAZ-1548] Minor changes on Dockerfile
smaneroiriusrisk Mar 20, 2025
7297b69
[BLAZ-1548] Added uvicorn to docker
smaneroiriusrisk Mar 20, 2025
05981de
Merge pull request #436 from iriusrisk/feature/BLAZ-1548
dantolin-iriusrisk Mar 24, 2025
036e194
[BLAZ-1642] Added valid background property to mxGraphModelType in dr…
dantolin-iriusrisk Apr 1, 2025
791f3b1
Merge pull request #437 from iriusrisk/bugfix/BLAZ-1642
smaneroiriusrisk Apr 2, 2025
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
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
venv
build
dist
deployment
test-reports
**/tests
.semgrep
.idea
.github
.eggs
.pre-commit-config.yaml
*.egg-info/
**/*.zip
**/*.7z
22 changes: 7 additions & 15 deletions .github/actions/install-startleft/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,19 @@ runs:
with:
python-version: ${{ inputs.python-version }}

- name: Update pip version to 23.0.1
run: python -m pip install --use-pep517 --upgrade pip==23.0.1
- name: Ensure pip is up-to-date
run: python -m ensurepip --upgrade
shell: bash

- name: Upgrade setuptools for compatibility with setuptools-scm
run: python -m pip install --upgrade setuptools
shell: bash

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@55fcdfa9328aed658432c22011bec2873cd8e69f # Securely point to hash commit for v1

- name: Configure Graphviz in Windows
if: runner.os == 'Windows'
shell: bash
run: |
pip install --global-option=build_ext --global-option="-IC:\Program files\Graphviz\include" --global-option="-LC:\Program files\Graphviz\lib" pygraphviz==1.10
echo "C:\Program Files\Graphviz\bin" >> $GITHUB_PATH

- name: Install dependencies
run: pip install -e ".[setup,test]"
run: python -m pip install . && python -m pip install -e ".[setup,test]"
shell: bash

# This step MUST be after the general installation of StartLeft
- name: Install libmagic in Windows
if: runner.os == 'Windows'
run: pip install python-magic-bin
shell: bash

4 changes: 2 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
name: StartLeft Tests
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
python-version: [ "3.9", "3.10", "3.11" ]
os: [ ubuntu-latest ]
python-version: [ "3.10", "3.11", "3.12"]
uses: ./.github/workflows/test.yml
with:
os: ${{ matrix.os }}
Expand Down
30 changes: 12 additions & 18 deletions deployment/Dockerfile.application
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
FROM python:3.11-alpine AS startleft-base
FROM python:3.12-alpine3.21 AS startleft-base

WORKDIR /usr/src/app

RUN apk update && \
apk upgrade && \
apk add --repository=https://dl-cdn.alpinelinux.org/alpine/v3.20/main --repository=https://dl-cdn.alpinelinux.org/alpine/v3.20/community \
g++~=13.2 gcc~=13.2 gfortran~=13.2 libgcc~=13.2 libstdc++~=13.2 && \
apk --no-cache add geos geos-dev git graphviz-dev lapack lapack-dev libmagic musl-dev py3-pybind11-dev re2 re2-dev
WORKDIR /app

COPY . .

RUN pip install --upgrade pip && pip install .
RUN apk -U upgrade && \
apk add --no-cache cblas geos git lapack libmagic py3-pygraphviz py3-re2 py3-shapely re2 && \
cp -R /usr/lib/python3.12/site-packages /usr/local/lib/python3.12/ && \
pip install --upgrade pip && pip install .


FROM python:3.11-alpine
FROM python:3.12-alpine3.21

WORKDIR /app

RUN apk update && \
apk upgrade && \
apk --no-cache add cblas geos graphviz-dev lapack libmagic re2 && \
RUN apk -U upgrade && \
apk add --no-cache libmagic py3-pygraphviz py3-re2 py3-shapely && \
adduser --disabled-password --no-create-home startleft && \
rm -rf /usr/local/lib/python3.11/site-packages

COPY --from=startleft-base /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
rm -Rf /usr/local/lib/python3.12/site-packages

COPY --from=startleft-base /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=startleft-base /usr/local/bin/startleft /usr/local/bin/startleft
COPY --from=startleft-base /usr/local/bin/uvicorn /usr/local/bin/uvicorn

USER startleft

Expand Down
17 changes: 9 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from startleft.startleft._version.local_scheme import guess_startleft_semver_suffix
from startleft.startleft._version.version_scheme import guess_startleft_semver


setup(
name='startleft',
description='Parse Infrastructure as Code files to the Open Threat Model format and upload them to IriusRisk',
Expand All @@ -13,7 +14,7 @@
keywords=['threat modeling', 'cyber security', 'appsec'],
packages=find_packages(),
include_package_data=True,
python_requires='>= 3.9, <= 3.12',
python_requires='>= 3.10, < 3.13',
install_requires=[
'pyyaml==6.0.1',
'jsonschema==4.19.0',
Expand All @@ -22,22 +23,22 @@
'python-hcl2==4.3.2',
'requests==2.32.3',
'fastapi>=0.115.2,<0.116.0',
'python-multipart==0.0.18',
"python-multipart==0.0.19",
'click==8.1.7',
'uvicorn==0.23.2',
'shapely==2.0.1',
'vsdx==0.5.13',
'vsdx==0.5.19',
'python-magic==0.4.27',
'setuptools==70.3.0',
'setuptools-scm==8.1.0',
'defusedxml==0.7.1',
'networkx==3.1',
'dependency-injector==4.41.0',
'google-re2==1.0',
'dependency-injector==4.46.0',
'xmlschema==2.5.0',
'word2number==1.1',
# Do not upgrade pygraphviz unless security issues because it is heavily dependent on the underlying OS
'pygraphviz==1.10',
# These dependencies are heavily dependent on the underlying OS
'pygraphviz==1.13',
'shapely==2.0.6',
'google-re2',
# Numpy is a transitive dependency of fastapi, requests and python-multipart
# They require different v1 versions, while v2 versions lead to import errors
'numpy<2.0'
Expand Down
1 change: 1 addition & 0 deletions slp_drawio/resources/schemas/drawio_schema.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<xs:attribute type="xs:string" name="pageHeight"/>
<xs:attribute type="xs:string" name="math"/>
<xs:attribute type="xs:string" name="shadow"/>
<xs:attribute type="xs:string" name="background"/>
</xs:complexType>
<xs:complexType name="diagramType" mixed="true">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
Expand Down