Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing gitlab M1 startup issue by pushing multi arch images #45

Merged
merged 14 commits into from
Dec 12, 2022
26 changes: 20 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:
jobs:
ci:
machine:
image: ubuntu-2004:202010-01
image: ubuntu-2204:2022.07.1
resource_class: large
steps:
- checkout
Expand All @@ -17,7 +17,14 @@ jobs:
command: |
python3 rename.py git
cp -R ctfd/data/ tmp-ctfd/
docker-compose -f docker-compose-dev.yaml up -d --build
sudo apt-get update
sudo apt-get install -y qemu qemu-user-static
docker buildx create --name mybuilder --use --bootstrap
cd gitlab && docker buildx build --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-gitlab:latest . && cd ..
cd gitlab-runner && docker buildx build --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-gitlab-runner:latest . && cd ..
cd prod && docker buildx build --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-prod:latest . && cd ..
docker-compose -f docker-compose-dev.yaml up -d gitlab gitlab-runner prod
docker-compose -f docker-compose-dev.yaml up -d --build gitea ctfd jenkins-server jenkins-agent localstack docker
- run:
name: Install testing dependencies
command: |
Expand All @@ -30,10 +37,10 @@ jobs:
- run:
name: Pytest
command: |
pipenv run python -m pytest tests/
python3 -m pipenv run python -m pytest tests/
release:
machine:
image: ubuntu-2004:202010-01
image: ubuntu-2204:2022.07.1
resource_class: large
environment:
ORG: cidersecurity
Expand All @@ -45,7 +52,14 @@ jobs:
command: |
python3 rename.py git
cp -R ctfd/data/ tmp-ctfd/
docker-compose -f docker-compose-dev.yaml build --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1
sudo apt-get update
sudo apt-get install -y qemu qemu-user-static
docker buildx create --name mybuilder --use --bootstrap
cd gitlab && docker buildx build --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-gitlab:latest . && cd ..
cd gitlab-runner && docker buildx build --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-gitlab-runner:latest . && cd ..
cd prod && docker buildx build --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-prod:latest . && cd ..
docker-compose -f docker-compose-dev.yaml up -d gitlab gitlab-runner prod
docker-compose -f docker-compose-dev.yaml build --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 gitea ctfd jenkins-server jenkins-agent localstack docker
docker-compose -f docker-compose-dev.yaml up -d
- run:
name: Install testing dependencies
Expand All @@ -59,7 +73,7 @@ jobs:
- run:
name: Pytest
command: |
pipenv run python -m pytest tests/
python3 -m pipenv run python -m pytest tests/
docker-compose -f docker-compose-dev.yaml down
- run:
name: Push latest
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ python-gitlab = "*"
[dev-packages]

[requires]
python_version = "3.8"
python_version = "3.10"
86 changes: 39 additions & 47 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Created by [Cider Security](https://www.cidersecurity.io/?utm_source=github&utm_
* [Checklist](#Checklist)

## Description
The CI/CD Goat project allows engineers and security practitioners to learn and practice CI/CD security through a set of 10 challenges, enacted against a real, full blown CI/CD environment. The scenarios are of varying difficulty levels, with each scenario focusing on one primary attack vector.
The CI/CD Goat project allows engineers and security practitioners to learn and practice CI/CD security through a set of 11 challenges, enacted against a real, full blown CI/CD environment. The scenarios are of varying difficulty levels, with each scenario focusing on one primary attack vector.

The challenges cover the [Top 10 CI/CD Security Risks](https://www.cidersecurity.io/top-10-cicd-security-risks/?utm_source=github&utm_medium=github_page&utm_campaign=ci%2fcd%20goat_060422), including Insufficient Flow Control Mechanisms, PPE (Poisoned Pipeline Execution), Dependency Chain Abuse, PBAC (Pipeline-Based Access Controls), and more.\
The different challenges are inspired by Alice in Wonderland, each one is themed as a different character.
Expand All @@ -52,7 +52,6 @@ The images are configured to interconnect in a way that creates fully functional
## Download & Run
**There's no need to clone the repository.**
### Linux & Mac
!Note: GitLab is currently not working on Macs with Apple silicon.
```sh
curl -o cicd-goat/docker-compose.yaml --create-dirs https://raw.githubusercontent.com/cider-security-research/cicd-goat/main/docker-compose.yaml
cd cicd-goat && docker-compose up -d
Expand Down Expand Up @@ -98,7 +97,7 @@ docker-compose up -d
### Troubleshooting
* If Gitea shows a blank page, refresh the page.
* When forking a repository, don't change the name of the forked repository.
* If any of the services doesn't start or is not configured correctly try adding more cpu and memory to the docker engine.
* If any of the services doesn't start or is not configured correctly try adding more cpu and memory to the docker engine and update it to the lateset version.

## Solutions
**Warning:** Spoilers! :see_no_evil:
Expand Down
Loading