|
| 1 | +name: SYCL hardening check |
| 2 | + |
| 3 | +permissions: read-all |
| 4 | + |
| 5 | +on: |
| 6 | + workflow_call: |
| 7 | + inputs: |
| 8 | + sycl_linux_artifact: |
| 9 | + type: string |
| 10 | + sycl_linux_archive: |
| 11 | + type: string |
| 12 | + sycl_linux_decompress_command: |
| 13 | + type: string |
| 14 | + |
| 15 | + sycl_windows_artifact: |
| 16 | + type: string |
| 17 | + sycl_windows_archive: |
| 18 | + type: string |
| 19 | + |
| 20 | +jobs: |
| 21 | + hardening_check: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Install hardening-check |
| 26 | + run: | |
| 27 | + sudo apt update |
| 28 | + sudo apt install -y devscripts |
| 29 | +
|
| 30 | + - name: Download SYCL toolchain |
| 31 | + uses: actions/download-artifact@v4 |
| 32 | + with: |
| 33 | + name: ${{ inputs.sycl_linux_artifact }} |
| 34 | + |
| 35 | + - name: Extract SYCL toolchain |
| 36 | + run: | |
| 37 | + mkdir toolchain |
| 38 | + tar -I '${{ inputs.sycl_linux_decompress_command }}' -xf ${{ inputs.sycl_linux_archive }} -C toolchain |
| 39 | +
|
| 40 | + - name: Perform checks |
| 41 | + run: | |
| 42 | + for file in ./toolchain/bin/*; do |
| 43 | + hardening-check "$file" | tee -a "./hardening-check.txt" |
| 44 | + done |
| 45 | +
|
| 46 | + for file in $(find ./toolchain/lib/ -type f -name "*.so*"); do |
| 47 | + hardening-check "$file" | tee -a "./hardening-check.txt" |
| 48 | + done |
| 49 | +
|
| 50 | + - uses: actions/upload-artifact@v4 |
| 51 | + with: |
| 52 | + name: hardening-check |
| 53 | + path: hardening-check.txt |
| 54 | + |
| 55 | + winchecksec: |
| 56 | + runs-on: windows-latest |
| 57 | + |
| 58 | + steps: |
| 59 | + - name: Install winchecksec |
| 60 | + run: | |
| 61 | + curl -LO https://github.com/trailofbits/winchecksec/releases/download/v3.1.0/windows.x64.Release.zip |
| 62 | + mkdir winchecksec |
| 63 | + unzip "windows.x64.Release.zip" -d winchecksec |
| 64 | +
|
| 65 | + - name: Download SYCL toolchain |
| 66 | + uses: actions/download-artifact@v4 |
| 67 | + with: |
| 68 | + name: ${{ inputs.sycl_windows_artifact }} |
| 69 | + |
| 70 | + - name: Extract SYCL toolchain |
| 71 | + shell: bash |
| 72 | + run: | |
| 73 | + mkdir toolchain |
| 74 | + tar -xf ${{ inputs.sycl_windows_archive }} -C toolchain |
| 75 | +
|
| 76 | + - name: Download and check Windows artifacts |
| 77 | + shell: bash |
| 78 | + run: | |
| 79 | + for file in $(find ./toolchain/bin/ -type f -name "*.exe"); do |
| 80 | + ./winchecksec/build/Release/winchecksec.exe "$file" | tee -a "./winchecksec.txt" |
| 81 | + done |
| 82 | +
|
| 83 | + for file in $(find ./toolchain/bin/ -type f -name "*.dll"); do |
| 84 | + ./winchecksec/build/Release/winchecksec.exe "$file" | tee -a "./winchecksec.txt" |
| 85 | + done |
| 86 | +
|
| 87 | + - uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: winchecksec |
| 90 | + path: winchecksec.txt |
0 commit comments