|
| 1 | +name: Check Dependency Updates |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Run every Monday at 6:00 AM UTC (weekly, like dependabot) |
| 6 | + - cron: '0 6 * * 1' |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + pull-requests: write |
| 12 | + |
| 13 | +jobs: |
| 14 | + check-pycti: |
| 15 | + # pycti is hardcoded as a Docker ARG and in hardcoded-requirements.txt |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Checkout repository |
| 19 | + uses: actions/checkout@v6.0.2 |
| 20 | + with: |
| 21 | + ref: develop |
| 22 | + |
| 23 | + - name: Check for pycti updates |
| 24 | + id: check |
| 25 | + run: | |
| 26 | + set -e |
| 27 | +
|
| 28 | + CURRENT_VERSION=$(grep -oP 'ARG PYCTI_VERSION=\K[0-9.]+' docker/Dockerfile) |
| 29 | + echo "Current pycti version: ${CURRENT_VERSION}" |
| 30 | +
|
| 31 | + LATEST_VERSION=$(curl -sf https://pypi.org/pypi/pycti/json | python3 -c "import sys, json; print(json.load(sys.stdin)['info']['version'])") |
| 32 | + echo "Latest pycti version: ${LATEST_VERSION}" |
| 33 | +
|
| 34 | + echo "current_version=${CURRENT_VERSION}" >> "$GITHUB_OUTPUT" |
| 35 | + echo "latest_version=${LATEST_VERSION}" >> "$GITHUB_OUTPUT" |
| 36 | +
|
| 37 | + if [ "${CURRENT_VERSION}" != "${LATEST_VERSION}" ]; then |
| 38 | + echo "update_available=true" >> "$GITHUB_OUTPUT" |
| 39 | + else |
| 40 | + echo "update_available=false" >> "$GITHUB_OUTPUT" |
| 41 | + fi |
| 42 | +
|
| 43 | + - name: Update pycti version |
| 44 | + if: steps.check.outputs.update_available == 'true' |
| 45 | + run: | |
| 46 | + CURRENT="${{ steps.check.outputs.current_version }}" |
| 47 | + LATEST="${{ steps.check.outputs.latest_version }}" |
| 48 | +
|
| 49 | + sed -i "s/ARG PYCTI_VERSION=${CURRENT}/ARG PYCTI_VERSION=${LATEST}/" docker/Dockerfile |
| 50 | + sed -i "s/pycti==${CURRENT}/pycti==${LATEST}/" requirements/hardcoded-requirements.txt |
| 51 | +
|
| 52 | + - name: Create Pull Request for pycti |
| 53 | + if: steps.check.outputs.update_available == 'true' |
| 54 | + uses: peter-evans/create-pull-request@v7 |
| 55 | + with: |
| 56 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + commit-message: "Update pycti from ${{ steps.check.outputs.current_version }} to ${{ steps.check.outputs.latest_version }}" |
| 58 | + title: "Update pycti from ${{ steps.check.outputs.current_version }} to ${{ steps.check.outputs.latest_version }}" |
| 59 | + body: | |
| 60 | + Updates pycti from `${{ steps.check.outputs.current_version }}` to `${{ steps.check.outputs.latest_version }}`. |
| 61 | +
|
| 62 | + PyPI: https://pypi.org/project/pycti/${{ steps.check.outputs.latest_version }}/ |
| 63 | +
|
| 64 | + Changes in: |
| 65 | + - `docker/Dockerfile` |
| 66 | + - `requirements/hardcoded-requirements.txt` |
| 67 | + branch: deps/update-pycti-${{ steps.check.outputs.latest_version }} |
| 68 | + base: develop |
| 69 | + labels: | |
| 70 | + dependencies |
| 71 | + maintenance |
| 72 | +
|
| 73 | + check-droidlysis: |
| 74 | + # droidlysis doesn't make releases, we pin to a specific commit |
| 75 | + runs-on: ubuntu-latest |
| 76 | + steps: |
| 77 | + - name: Checkout repository |
| 78 | + uses: actions/checkout@v6.0.2 |
| 79 | + with: |
| 80 | + ref: develop |
| 81 | + |
| 82 | + - name: Check for droidlysis updates |
| 83 | + id: check |
| 84 | + run: | |
| 85 | + set -e |
| 86 | +
|
| 87 | + CURRENT_COMMIT=$(grep -oP 'droidlysis@\K[a-f0-9]+' integrations/malware_tools_analyzers/requirements/droidlysis-requirements.txt) |
| 88 | + echo "Current droidlysis commit: ${CURRENT_COMMIT}" |
| 89 | +
|
| 90 | + LATEST_COMMIT=$(curl -sf https://api.github.com/repos/cryptax/droidlysis/commits/master | python3 -c "import sys, json; print(json.load(sys.stdin)['sha'][:7])") |
| 91 | + echo "Latest droidlysis commit: ${LATEST_COMMIT}" |
| 92 | +
|
| 93 | + echo "current_commit=${CURRENT_COMMIT}" >> "$GITHUB_OUTPUT" |
| 94 | + echo "latest_commit=${LATEST_COMMIT}" >> "$GITHUB_OUTPUT" |
| 95 | +
|
| 96 | + if [ "${CURRENT_COMMIT}" != "${LATEST_COMMIT}" ]; then |
| 97 | + echo "update_available=true" >> "$GITHUB_OUTPUT" |
| 98 | + else |
| 99 | + echo "update_available=false" >> "$GITHUB_OUTPUT" |
| 100 | + fi |
| 101 | +
|
| 102 | + - name: Update droidlysis commit |
| 103 | + if: steps.check.outputs.update_available == 'true' |
| 104 | + run: | |
| 105 | + CURRENT="${{ steps.check.outputs.current_commit }}" |
| 106 | + LATEST="${{ steps.check.outputs.latest_commit }}" |
| 107 | +
|
| 108 | + sed -i "s/droidlysis@${CURRENT}/droidlysis@${LATEST}/" integrations/malware_tools_analyzers/requirements/droidlysis-requirements.txt |
| 109 | +
|
| 110 | + - name: Create Pull Request for droidlysis |
| 111 | + if: steps.check.outputs.update_available == 'true' |
| 112 | + uses: peter-evans/create-pull-request@v7 |
| 113 | + with: |
| 114 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 115 | + commit-message: "Update droidlysis from ${{ steps.check.outputs.current_commit }} to ${{ steps.check.outputs.latest_commit }}" |
| 116 | + title: "Update droidlysis from ${{ steps.check.outputs.current_commit }} to ${{ steps.check.outputs.latest_commit }}" |
| 117 | + body: | |
| 118 | + Updates droidlysis pinned commit from `${{ steps.check.outputs.current_commit }}` to `${{ steps.check.outputs.latest_commit }}`. |
| 119 | +
|
| 120 | + Repo: https://github.com/cryptax/droidlysis |
| 121 | + Commits: https://github.com/cryptax/droidlysis/commits/master |
| 122 | +
|
| 123 | + Note: droidlysis does not make releases, we pin to a specific commit. |
| 124 | + Please review the changes between commits before merging. |
| 125 | +
|
| 126 | + Changes in: |
| 127 | + - `integrations/malware_tools_analyzers/requirements/droidlysis-requirements.txt` |
| 128 | + branch: deps/update-droidlysis-${{ steps.check.outputs.latest_commit }} |
| 129 | + base: develop |
| 130 | + labels: | |
| 131 | + dependencies |
| 132 | + maintenance |
| 133 | +
|
| 134 | + check-goresym: |
| 135 | + # GoReSym creates releases in the repo |
| 136 | + runs-on: ubuntu-latest |
| 137 | + steps: |
| 138 | + - name: Checkout repository |
| 139 | + uses: actions/checkout@v6.0.2 |
| 140 | + with: |
| 141 | + ref: develop |
| 142 | + |
| 143 | + - name: Check for GoReSym updates |
| 144 | + id: check |
| 145 | + run: | |
| 146 | + set -e |
| 147 | +
|
| 148 | + CURRENT_VERSION=$(grep -oP 'GoReSym/releases/download/v\K[0-9.]+' integrations/malware_tools_analyzers/Dockerfile | head -1) |
| 149 | + echo "Current GoReSym version: ${CURRENT_VERSION}" |
| 150 | +
|
| 151 | + LATEST_VERSION=$(curl -sf https://api.github.com/repos/mandiant/GoReSym/releases/latest | python3 -c "import sys, json; print(json.load(sys.stdin)['tag_name'].lstrip('v'))") |
| 152 | + echo "Latest GoReSym version: ${LATEST_VERSION}" |
| 153 | +
|
| 154 | + echo "current_version=${CURRENT_VERSION}" >> "$GITHUB_OUTPUT" |
| 155 | + echo "latest_version=${LATEST_VERSION}" >> "$GITHUB_OUTPUT" |
| 156 | +
|
| 157 | + if [ "${CURRENT_VERSION}" != "${LATEST_VERSION}" ]; then |
| 158 | + echo "update_available=true" >> "$GITHUB_OUTPUT" |
| 159 | + else |
| 160 | + echo "update_available=false" >> "$GITHUB_OUTPUT" |
| 161 | + fi |
| 162 | +
|
| 163 | + - name: Update GoReSym version |
| 164 | + if: steps.check.outputs.update_available == 'true' |
| 165 | + run: | |
| 166 | + CURRENT="${{ steps.check.outputs.current_version }}" |
| 167 | + LATEST="${{ steps.check.outputs.latest_version }}" |
| 168 | +
|
| 169 | + sed -i "s|GoReSym/releases/download/v${CURRENT}|GoReSym/releases/download/v${LATEST}|g" integrations/malware_tools_analyzers/Dockerfile |
| 170 | +
|
| 171 | + - name: Create Pull Request for GoReSym |
| 172 | + if: steps.check.outputs.update_available == 'true' |
| 173 | + uses: peter-evans/create-pull-request@v7 |
| 174 | + with: |
| 175 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 176 | + commit-message: "Update GoReSym from v${{ steps.check.outputs.current_version }} to v${{ steps.check.outputs.latest_version }}" |
| 177 | + title: "Update GoReSym from v${{ steps.check.outputs.current_version }} to v${{ steps.check.outputs.latest_version }}" |
| 178 | + body: | |
| 179 | + Updates GoReSym from `v${{ steps.check.outputs.current_version }}` to `v${{ steps.check.outputs.latest_version }}`. |
| 180 | +
|
| 181 | + Release: https://github.com/mandiant/GoReSym/releases/latest |
| 182 | +
|
| 183 | + Changes in: |
| 184 | + - `integrations/malware_tools_analyzers/Dockerfile` |
| 185 | + branch: deps/update-goresym-v${{ steps.check.outputs.latest_version }} |
| 186 | + base: develop |
| 187 | + labels: | |
| 188 | + dependencies |
| 189 | + maintenance |
| 190 | +
|
| 191 | + check-boxjs: |
| 192 | + # box-js version is hardcoded in npm install command in Dockerfile |
| 193 | + runs-on: ubuntu-latest |
| 194 | + steps: |
| 195 | + - name: Checkout repository |
| 196 | + uses: actions/checkout@v6.0.2 |
| 197 | + with: |
| 198 | + ref: develop |
| 199 | + |
| 200 | + - name: Check for box-js updates |
| 201 | + id: check |
| 202 | + run: | |
| 203 | + set -e |
| 204 | +
|
| 205 | + CURRENT_VERSION=$(grep -oP 'box-js@\K[0-9.]+' integrations/malware_tools_analyzers/Dockerfile) |
| 206 | + echo "Current box-js version: ${CURRENT_VERSION}" |
| 207 | +
|
| 208 | + LATEST_VERSION=$(curl -sf https://registry.npmjs.org/box-js/latest | python3 -c "import sys, json; print(json.load(sys.stdin)['version'])") |
| 209 | + echo "Latest box-js version: ${LATEST_VERSION}" |
| 210 | +
|
| 211 | + echo "current_version=${CURRENT_VERSION}" >> "$GITHUB_OUTPUT" |
| 212 | + echo "latest_version=${LATEST_VERSION}" >> "$GITHUB_OUTPUT" |
| 213 | +
|
| 214 | + if [ "${CURRENT_VERSION}" != "${LATEST_VERSION}" ]; then |
| 215 | + echo "update_available=true" >> "$GITHUB_OUTPUT" |
| 216 | + else |
| 217 | + echo "update_available=false" >> "$GITHUB_OUTPUT" |
| 218 | + fi |
| 219 | +
|
| 220 | + - name: Update box-js version |
| 221 | + if: steps.check.outputs.update_available == 'true' |
| 222 | + run: | |
| 223 | + CURRENT="${{ steps.check.outputs.current_version }}" |
| 224 | + LATEST="${{ steps.check.outputs.latest_version }}" |
| 225 | +
|
| 226 | + sed -i "s/box-js@${CURRENT}/box-js@${LATEST}/" integrations/malware_tools_analyzers/Dockerfile |
| 227 | +
|
| 228 | + - name: Create Pull Request for box-js |
| 229 | + if: steps.check.outputs.update_available == 'true' |
| 230 | + uses: peter-evans/create-pull-request@v7 |
| 231 | + with: |
| 232 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 233 | + commit-message: "Update box-js from ${{ steps.check.outputs.current_version }} to ${{ steps.check.outputs.latest_version }}" |
| 234 | + title: "Update box-js from ${{ steps.check.outputs.current_version }} to ${{ steps.check.outputs.latest_version }}" |
| 235 | + body: | |
| 236 | + Updates box-js from `${{ steps.check.outputs.current_version }}` to `${{ steps.check.outputs.latest_version }}`. |
| 237 | +
|
| 238 | + npm: https://www.npmjs.com/package/box-js |
| 239 | +
|
| 240 | + Changes in: |
| 241 | + - `integrations/malware_tools_analyzers/Dockerfile` |
| 242 | + branch: deps/update-boxjs-${{ steps.check.outputs.latest_version }} |
| 243 | + base: develop |
| 244 | + labels: | |
| 245 | + dependencies |
| 246 | + maintenance |
0 commit comments