diff --git a/.github/workflows/test-pr.yaml b/.github/workflows/test-pr.yaml index 778bed4..00affca 100644 --- a/.github/workflows/test-pr.yaml +++ b/.github/workflows/test-pr.yaml @@ -1,32 +1,50 @@ name: "CI - Test Templates" on: - pull_request: + pull_request: jobs: - detect-changes: - runs-on: ubuntu-latest - outputs: - templates: ${{ steps.filter.outputs.changes }} - steps: - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - color: ./**/color/** - hello: ./**/hello/** + detect-templates: + runs-on: ubuntu-latest + outputs: + templates: ${{ steps.set-matrix.outputs.templates }} + steps: + - uses: actions/checkout@v3 - test: - needs: [detect-changes] - runs-on: ubuntu-latest - continue-on-error: true - strategy: - matrix: - templates: ${{ fromJSON(needs.detect-changes.outputs.templates) }} - steps: - - uses: actions/checkout@v3 + - name: Find template directories + id: set-matrix + run: | + # Find all directories in src/ - these are our templates + templates=$(find src -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | sort) - - name: Smoke test for '${{ matrix.templates }}' - id: smoke_test - uses: ./.github/actions/smoke-test - with: - template: "${{ matrix.templates }}" + # Convert to JSON array format for matrix + json_array="[" + first=true + for template in $templates; do + if [ "$first" = true ]; then + json_array="$json_array\"$template\"" + first=false + else + json_array="$json_array,\"$template\"" + fi + done + json_array="$json_array]" + + echo "Found templates: $json_array" + echo "templates=$json_array" >> $GITHUB_OUTPUT + + test: + needs: [detect-templates] + if: ${{ fromJSON(needs.detect-templates.outputs.templates)[0] != null }} + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + template: ${{ fromJSON(needs.detect-templates.outputs.templates) }} + steps: + - uses: actions/checkout@v3 + + - name: Smoke test for '${{ matrix.template }}' + id: smoke_test + uses: ./.github/actions/smoke-test + with: + template: "${{ matrix.template }}" diff --git a/src/playwright-kali/.devcontainer/devcontainer.json b/src/playwright-kali/.devcontainer/devcontainer.json new file mode 100644 index 0000000..03f8f18 --- /dev/null +++ b/src/playwright-kali/.devcontainer/devcontainer.json @@ -0,0 +1,11 @@ +{ + "name": "Kali Linux Development", + "image": "kalilinux/kali-rolling", + "customizations": { + "vscode": { + "extensions": ["ms-python.python"] + } + }, + "postCreateCommand": "apt-get update && apt-get install -y curl git python3 python3-pip sudo", + "remoteUser": "root" +} diff --git a/src/playwright-kali/README.md b/src/playwright-kali/README.md new file mode 100644 index 0000000..a3af91f --- /dev/null +++ b/src/playwright-kali/README.md @@ -0,0 +1,67 @@ +# Kali Linux Development Container + +A basic Kali Linux development environment that can be extended with security tools as needed. + +## What's Included + +- **Base Image**: Official Kali Linux Rolling Release +- **Basic Tools**: curl, git, python3, python3-pip, sudo +- **VS Code Extension**: Python support + +## Getting Started + +1. Open this template in VS Code with the Dev Containers extension +2. VS Code will build and start the Kali Linux container +3. Install additional tools as needed for your specific use case + +## Installing Additional Tools + +Since this is a minimal setup, you can install Kali's security tools on demand: + +```bash +# Update package list +sudo apt update + +# Install specific tools +sudo apt install nmap burpsuite sqlmap nikto + +# Or install tool collections +sudo apt install kali-tools-web +sudo apt install kali-tools-forensics +sudo apt install kali-tools-wireless +``` + +## Common Security Tools + +Some popular tools you might want to install: + +- **Web Testing**: `burpsuite`, `zaproxy`, `sqlmap`, `nikto` +- **Network**: `nmap`, `masscan`, `wireshark`, `netcat` +- **Forensics**: `autopsy`, `volatility`, `sleuthkit` +- **Wireless**: `aircrack-ng`, `kismet`, `reaver` + +## Why This Approach? + +This template provides a clean Kali Linux base without pre-installing hundreds of tools. This means: + +- Faster container startup +- Smaller image size +- Install only what you need +- Easier troubleshooting +- More reliable builds + +## Extending the Template + +To customize this template for your specific needs: + +1. Fork this repository +2. Modify `.devcontainer/devcontainer.json` +3. Add your required tools to `postCreateCommand` +4. Add VS Code extensions to the `extensions` array + +Example customization: +```json +{ + "postCreateCommand": "apt-get update && apt-get install -y nmap burpsuite sqlmap" +} +``` diff --git a/src/playwright-kali/devcontainer-template.json b/src/playwright-kali/devcontainer-template.json new file mode 100644 index 0000000..4549a55 --- /dev/null +++ b/src/playwright-kali/devcontainer-template.json @@ -0,0 +1,8 @@ +{ + "id": "kali-linux", + "version": "1.0.0", + "name": "Kali Linux", + "description": "A basic Kali Linux development environment that can be extended with security tools", + "documentationURL": "https://github.com/public-rant/template-starter/tree/main/src/playwright-kali", + "options": {} +} diff --git a/test/playwright-kali/test.sh b/test/playwright-kali/test.sh new file mode 100755 index 0000000..0464715 --- /dev/null +++ b/test/playwright-kali/test.sh @@ -0,0 +1,14 @@ +#!/bin/bash +cd $(dirname "$0") +source test-utils.sh + +# Template specific tests +check "distro" cat /etc/os-release | grep -i kali +check "python3" python3 --version +check "pip3" pip3 --version +check "curl" curl --version +check "git" git --version +check "sudo" sudo --version + +# Report result +reportResults