Skip to content

Instantly share code, notes, and snippets.

@s2504s
Last active January 8, 2023 07:43
Show Gist options
  • Select an option

  • Save s2504s/831ff7c5ca96d1aa0d6988caeede7c5b to your computer and use it in GitHub Desktop.

Select an option

Save s2504s/831ff7c5ca96d1aa0d6988caeede7c5b to your computer and use it in GitHub Desktop.

Revisions

  1. s2504s revised this gist Jan 8, 2023. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    ```
    docker run --rm -v ${PWD}:/app -v trivy-cache:/root/.cache/trivy -w /app --entrypoint /bin/sh -ti aquasec/trivy
    ```

    docker run -v trivy-cache:/root/.cache -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy i --ignore-unfixed --skip-dirs "/tmp" --no-progress --severity CRITICAL,HIGH,MEDIUM --exit-code 1 --timeout 5m my_image_name

    Create map with skipped dirs - key is SOURCE_REPO_URL and value is a list with skipped directories:
  2. s2504s revised this gist May 2, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    docker run -v trivy-cache:/root/.cache -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy i --ignore-unfixed --skip-dirs "/tmp" --no-progress --severity CRITICAL,HIGH,MEDIUM --exit-code 1 --timeout 5m my_image_name

    Create map with skipped dirs - key is SOURCE_REPO_URL and value is a list with skipped directories:
    ```
    ```bash
    def skip_dirs = [
    'my_git_url.git': ["/tmp", "/bin/"],
    ]
    ```

    Add this var to a CLI:
    ```
    ```bash
    ... --ignore-unfixed --skip-dirs "${skip_dirs[env.SOURCE_REPO]?.join(" ")}" ...
    ```
  3. s2504s renamed this gist May 2, 2022. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. s2504s revised this gist May 2, 2022. 1 changed file with 14 additions and 1 deletion.
    15 changes: 14 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1 +1,14 @@
    docker run -v trivy-cache:/root/.cache -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy i --ignore-unfixed --skip-dirs "/tmp" --no-progress --severity CRITICAL,HIGH,MEDIUM --exit-code 1 --timeout 5m my_image_name
    docker run -v trivy-cache:/root/.cache -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy i --ignore-unfixed --skip-dirs "/tmp" --no-progress --severity CRITICAL,HIGH,MEDIUM --exit-code 1 --timeout 5m my_image_name

    Create map with skipped dirs - key is SOURCE_REPO_URL and value is a list with skipped directories:
    ```
    def skip_dirs = [
    'my_git_url.git': ["/tmp", "/bin/"],
    ]
    ```

    Add this var to a CLI:
    ```
    ... --ignore-unfixed --skip-dirs "${skip_dirs[env.SOURCE_REPO]?.join(" ")}" ...

    ```
  5. s2504s created this gist May 2, 2022.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    docker run -v trivy-cache:/root/.cache -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy i --ignore-unfixed --skip-dirs "/tmp" --no-progress --severity CRITICAL,HIGH,MEDIUM --exit-code 1 --timeout 5m my_image_name