Skip to content

Commit

Permalink
Adding support for log4shell (#37)
Browse files Browse the repository at this point in the history
<!-- markdownlint-disable-file MD041 -->

## Pull request checklist

Please check if your PR fulfills the following requirements:

- [x] I have read the
[CONTRIBUTING](https://github.com/fabasoad/pre-commit-snyk/blob/main/CONTRIBUTING.md)
      doc.
- [x] Tests for the changes have been added (for bug fixes / features).
- [x] Docs have been reviewed and added / updated if needed (for bug
fixes / features).

## Pull request type

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type, submit multiple
pull
requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [x] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior

<!-- Please describe the current behavior that you are modifying, or
link to a
relevant issue. -->

## What is the new behavior

<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Added support for testing for log4j
-
-

## Does this introduce a breaking change

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and
migration path for existing applications below. -->

## Other information

<!-- Any other information that is important to this PR such as
screenshots of
how the component looks before and after the change. -->
<!-- This document was adapted from the open-source
[appium/appium](https://github.com/appium/appium/blob/master/.github/PULL_REQUEST_TEMPLATE.md)
repository. -->

---

Closes #{IssueNumber}
  • Loading branch information
jezd-axyl authored Jun 21, 2023
1 parent 7316f91 commit 97b6b36
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@
entry: hooks/snyk-test.sh
language: script
pass_filenames: false

- id: snyk-log4shell
name: Snyk log4shell
description: Runs 'snyk log4shell' command
entry: hooks/snyk-log4shell.sh
language: script
pass_filenames: false
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
1. [snyk-container](#snyk-container)
2. [snyk-iac](#snyk-iac)
3. [snyk-test](#snyk-test)
4. [snyk-log4shell](#snyk-log4shell)

## Description

Expand Down Expand Up @@ -69,3 +70,13 @@ repos:
- id: snyk-test
args: ["--severity-threshold=critical"]
```

### snyk-log4shell

```yaml
repos:
- repo: https://github.com/fabasoad/pre-commit-snyk
rev: <rev>
hooks:
- id: snyk-log4shell
```
6 changes: 6 additions & 0 deletions hooks/snyk-log4shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -eu
SCRIPT_DIR="$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)"
bash "${SCRIPT_DIR}"/installation/main.sh

snyk log4shell "$@"

0 comments on commit 97b6b36

Please sign in to comment.