Skip to content

Commit

Permalink
Python 3.12 (#716)
Browse files Browse the repository at this point in the history
* initial install script updates

* more cleanup

* merge common code

* update Dockerfile

* update dependencies for python 3.12

* allow 3.12 for deps

* pysecretsocks compat

* bump minimum py version to 3.10, upgrade deps for 3.12, add 3.12 to supported versions

* bump to python 3.12

* upgrade deps

* update pr matrix

* ignore thread warnings

* take out the huge query

* take out the huge query in the perf test

* typos in compose file

* more tweaks

* bump time limit on install tests

* bump perf test again because py3.12 is slow on the runner for some reason

* disable some steps

* run ci

* remove token

* fix geo issue

* run py 3.12 tests

* uncomment

* move symlink to install script. use sudo for mysql setup

* fix symlinks

* add keyring bypass to kali

* setup keyring no matter the os. update nim symlinking

* Update CHANGELOG.md

* split install tests

* org agnostic check

* Fix function

* remove release token from checkout in python step

* remove release token from checkout in python step

* fix function

* syntax

* update run-all-tests script

* change var name

* add some echos

* split CI

* updates

* remove token

* wrong path

* re-enable token

* disable parrot for now

* install starkiller in the docker build. check or it in cst. update forked dep references

* update changelog with warning
  • Loading branch information
vinnybod authored Nov 5, 2023
1 parent f93afd9 commit 4ba4bab
Show file tree
Hide file tree
Showing 36 changed files with 1,447 additions and 1,404 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Git
**.git
.gitignore
.github

# CI
.codeclimate.yml
Expand Down
57 changes: 53 additions & 4 deletions .github/cst-config-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,59 @@
schemaVersion: 2.0.0
commandTests:
- name: "python3 which"
command: "which"
args: ["python3"]
- name: "poetry python"
command: "poetry"
args: ["run", "which", "python3"]
expectedOutput: ["/usr/local/bin/python3"]
- name: "python3 version"
command: "python3"
args: ["--version"]
expectedOutput: ["Python 3.11.*"]
expectedOutput: ["Python 3.12.*"]
- name: "poetry"
command: "which"
args: ["poetry"]
expectedOutput: ["/usr/bin/poetry"]
- name: "poetry version"
command: "poetry"
args: ["--version"]
expectedOutput: ["Poetry (version 1.6*)*"]
- name: "poetry python version"
command: "poetry"
args: ["run", "python3", "--version"]
expectedOutput: ["Python 3.12.*"]
- name: "dotnet which"
command: "which"
args: ["dotnet"]
expectedOutput: ["/usr/bin/dotnet"]
- name: "dotnet version"
command: "dotnet"
args: [ "--version" ]
expectedOutput: ["6.0.*"]
- name: "powershell which"
command: "which"
args: ["pwsh"]
expectedOutput: ["/usr/bin/pwsh"]
- name: "powershell version"
command: "pwsh"
args: ["--version"]
expectedOutput: ["PowerShell 7.*"]
- name: "ps-empire help"
command: "./ps-empire"
args: ["server", "--help"]
expectedOutput: ["usage: empire.py server [-h]*"]
- name: "ps-empire version"
command: "./ps-empire"
args: ["server", "--version"]
expectedOutput: ["5.* BC Security Fork"]
fileExistenceTests:
- name: 'profiles'
path: '/empire/empire/server/data/profiles/'
shouldExist: true
- name: 'invoke obfuscation'
path: '/usr/local/share/powershell/Modules/Invoke-Obfuscation/'
shouldExist: true
- name: 'sharpire'
path: '/empire/empire/server/csharp/Covenant/Data/ReferenceSourceLibraries/Sharpire'
shouldExist: true
- name: 'starkiller'
path: '/empire/empire/server/api/v2/starkiller/index.html'
shouldExist: true
10 changes: 0 additions & 10 deletions .github/install_tests/Debian10.Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions .github/install_tests/Debian11.Dockerfile

This file was deleted.

18 changes: 18 additions & 0 deletions .github/install_tests/InstallTest.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ARG BASE_IMAGE
FROM $BASE_IMAGE
WORKDIR /empire
COPY . /empire

SHELL ["/bin/bash", "-c"]

RUN apt-get update && apt-get -y install sudo

# Add a non-root user
RUN echo 'empire ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
RUN useradd -m empire
RUN chown -R empire:empire /empire
USER empire

RUN sed -i 's/use: mysql/use: sqlite/g' empire/server/config.yaml
RUN yes | /empire/setup/install.sh
RUN rm -rf /empire/empire/server/data/empire*
9 changes: 0 additions & 9 deletions .github/install_tests/KaliRolling.Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions .github/install_tests/ParrotRolling.Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions .github/install_tests/Ubuntu2004.Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions .github/install_tests/Ubuntu2204.Dockerfile

This file was deleted.

8 changes: 8 additions & 0 deletions .github/install_tests/cst-config-debian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
schemaVersion: 2.0.0
containerRunOptions:
user: "empire"
commandTests:
- name: "mysql version"
command: "mysql"
args: ["--version"]
expectedOutput: ["mysql Ver 15.*10.*-MariaDB"]
18 changes: 0 additions & 18 deletions .github/install_tests/cst-config-debian10.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/install_tests/cst-config-debian11.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
schemaVersion: 2.0.0
commandTests:
# pyenv
- name: "pyenv"
command: "which"
args: ["pyenv"]
expectedOutput: ["/usr/bin/pyenv"]
- name: "pyenv version"
command: "pyenv"
args: ["--version"]
expectedOutput: ["pyenv 2.3.*"]
# poetry
- name: "poetry python"
command: "poetry"
args: ["run", "which", "python3"]
expectedOutput: ["/empire/.venv/bin/python3"]
- name: "poetry"
command: "which"
args: ["poetry"]
expectedOutput: ["/usr/bin/poetry"]
- name: "poetry version"
command: "poetry"
args: ["--version"]
expectedOutput: ["Poetry (version 1.6*)*"]
- name: "poetry python version"
command: "poetry"
args: ["run", "python3", "--version"]
expectedOutput: ["Python 3.12.*"]
# dotnet
- name: "dotnet which"
command: "which"
args: ["dotnet"]
Expand All @@ -8,6 +35,7 @@ commandTests:
command: "dotnet"
args: [ "--version" ]
expectedOutput: ["6.0.*"]
# powershell
- name: "powershell which"
command: "which"
args: ["pwsh"]
Expand All @@ -16,6 +44,21 @@ commandTests:
command: "pwsh"
args: ["--version"]
expectedOutput: ["PowerShell 7.*"]
# mysql
- name: "mysql which"
command: "which"
args: ["mysql"]
expectedOutput: ["/usr/bin/mysql"]
# nim
- name: "nim which"
command: "which"
args: ["nim"]
expectedOutput: ["/usr/bin/nim"]
- name: "nim version"
command: "nim"
args: ["--version"]
expectedOutput: ["Nim Compiler Version 1.6.*"]
# run
- name: "ps-empire help"
command: "./ps-empire"
args: ["server", "--help"]
Expand All @@ -34,4 +77,3 @@ fileExistenceTests:
- name: 'sharpire'
path: '/empire/empire/server/csharp/Covenant/Data/ReferenceSourceLibraries/Sharpire'
shouldExist: true

8 changes: 8 additions & 0 deletions .github/install_tests/cst-config-kali.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
schemaVersion: 2.0.0
containerRunOptions:
user: "empire"
commandTests:
- name: "mysql version"
command: "mysql"
args: ["--version"]
expectedOutput: ["mysql Ver 15.*10.*-MariaDB"]
18 changes: 0 additions & 18 deletions .github/install_tests/cst-config-kalirolling.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions .github/install_tests/cst-config-parrot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
schemaVersion: 2.0.0
containerRunOptions:
user: "empire"
commandTests:
- name: "mysql version"
command: "mysql"
args: ["--version"]
expectedOutput: ["mysql Ver 15.*10.*-MariaDB"]
18 changes: 0 additions & 18 deletions .github/install_tests/cst-config-parrotrolling.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions .github/install_tests/cst-config-ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
schemaVersion: 2.0.0
containerRunOptions:
user: "empire"
commandTests:
- name: "mysql version"
command: "mysql"
args: ["--version"]
expectedOutput: ["mysql Ver 8.0.*"]
18 changes: 0 additions & 18 deletions .github/install_tests/cst-config-ubuntu2004.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/install_tests/cst-config-ubuntu2204.yaml

This file was deleted.

Loading

0 comments on commit 4ba4bab

Please sign in to comment.