Skip to content

Optimize the document of Quark Script CWE-312 and CWE-798 #94

Optimize the document of Quark Script CWE-312 and CWE-798

Optimize the document of Quark Script CWE-312 and CWE-798 #94

Workflow file for this run

name: Test Quark Scripts
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Git Clone Quark-Engine Repo
run: |
git clone https://github.com/quark-engine/quark-engine.git
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: quark-engine/setup.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install frida objection importlib_resources
# Install graphviz
sudo apt-get -y install graphviz
# Install click <=8.1.7 for CLI supports
python -m pip install "click<=8.1.7"
- name: Install Quark-Engine
run: |
cd quark-engine/
pip install .
cd ..
- name: Setup Sample Files For Testing Quark Scripts
run: |
while read -r line;
do
rm "$line/$line.py";
done < skip_test.txt
mkdir test_ground
git clone "https://github.com/quark-engine/apk-samples.git"
mv -vn $GITHUB_WORKSPACE/CWE-*/CWE-*.py test_ground/
mv -vn $GITHUB_WORKSPACE/CWE-*/*.json test_ground/
mv -vn $GITHUB_WORKSPACE/CWE-*/*.js test_ground/
mv -vn ./apk-samples/vulnerable-samples/*.apk test_ground/
- name: Test with the Quark Scripts
run: |
cd test_ground
ls ./CWE-*.py | while read -r line ; do
if [[ -z "$(python $line 2> /tmp/quark_script_err.log)" ]]
then
echo "::error file={$line},title={An Error happens in Quark Script for detecting CWE}::{$(cat /tmp/quark_script_err.log))}"
exit 1
else
echo $line
fi
done