Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .githooks/commit-msg

This file was deleted.

16 changes: 10 additions & 6 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:
inputs:
coverage_report:
Expand All @@ -28,7 +33,6 @@ jobs:

name: Coding standards test
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
env:
EXTENSION_PATH: "my-code/remediation-engine"

Expand All @@ -48,11 +52,11 @@ jobs:

- name: Add Redis, Memcached and Crowdsec
run: |
ddev get ddev/ddev-redis
ddev get ddev/ddev-memcached
ddev add-on get ddev/ddev-redis
ddev add-on get ddev/ddev-memcached
# override redis.conf
ddev get julienloizelet/ddev-tools
ddev get julienloizelet/ddev-crowdsec-php
ddev add-on get julienloizelet/ddev-tools
ddev add-on get julienloizelet/ddev-crowdsec-php

- name: Start DDEV
run: |
Expand All @@ -64,7 +68,7 @@ jobs:
ddev exec php -v

- name: Clone sources
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: ${{env.EXTENSION_PATH}}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:

- name: Clone sources
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: extension

Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/keepalive.yml

This file was deleted.

11 changes: 5 additions & 6 deletions .github/workflows/php-sdk-development-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:

name: Unit and integration test
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
env:
EXTENSION_PATH: "my-code/remediation-engine"
DDEV_PROJECT: "remediation-engine"
Expand Down Expand Up @@ -145,34 +144,34 @@ jobs:

- name: Clone Remediation Engine files
if: inputs.is_call != true
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: ${{env.EXTENSION_PATH}}

- name: Clone Remediation Engine files
if: inputs.is_call == true
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: ${{ env.REMEDIATION_REPO }}
path: ${{env.EXTENSION_PATH}}
ref: "main"

- name: Clone PHP common files
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: ${{ steps.set-common-data.outputs.repo}}
ref: ${{ steps.set-common-data.outputs.branch }}
path: ${{env.PHP_COMMON_PATH}}

- name: Clone LAPI client
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: ${{ steps.set-lapi-client-data.outputs.repo }}
ref: ${{ steps.set-lapi-client-data.outputs.branch }}
path: ${{env.LAPI_CLIENT_PATH}}

- name: Clone CAPI client
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: ${{ steps.set-capi-client-data.outputs.repo }}
ref: ${{ steps.set-capi-client-data.outputs.branch }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
tag_name:
type: string
required: true
description: Tag with v prefix


jobs:
Expand All @@ -30,7 +31,7 @@ jobs:
echo "VERSION_NUMBER=$(echo ${{ github.event.inputs.tag_name }} | sed 's/v//g' )" >> $GITHUB_ENV

- name: Clone sources
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Check version ${{ env.VERSION_NUMBER }} consistency in files
# Check src/Constants.php and CHANGELOG.md
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/sdk-chain-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
paths-ignore:
- "**.md"
pull_request:
branches:
- main
paths-ignore:
- '**.md'

permissions:
contents: read
Expand All @@ -15,34 +20,31 @@ env:
jobs:
test-standalone-bouncer:
name: Run Standalone Bouncer tests
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
uses: crowdsecurity/cs-standalone-php-bouncer/.github/workflows/php-sdk-development-tests.yml@main
with:
php_common_json: '["main"]'
lapi_client_json: '["main"]'
capi_client_json: '["main"]'
remediation_engine_json: '["${{ github.ref_name }}"]'
remediation_engine_json: '["${{ github.head_ref || github.ref_name }}"]'
bouncer_lib_json: '["main"]'

test-bouncer-lib:
name: Run Bouncer lib tests
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
uses: crowdsecurity/php-cs-bouncer/.github/workflows/php-sdk-development-tests.yml@main
with:
php_common_json: '["main"]'
lapi_client_json: '["main"]'
capi_client_json: '["main"]'
remediation_engine_json: '["${{ github.ref_name }}"]'
remediation_engine_json: '["${{ github.head_ref || github.ref_name }}"]'

test-magento-engine:
name: Run Magento 2 Engine module tests
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
uses: crowdsecurity/magento-cs-extension/.github/workflows/php-sdk-development-tests.yml@main
with:
php_common_json: '["main"]'
lapi_client_json: '["main"]'
capi_client_json: '["main"]'
remediation_engine_json: '["${{ github.ref_name }}"]'
remediation_engine_json: '["${{ github.head_ref || github.ref_name }}"]'
bouncer_lib_json: '["main"]'
secrets:
MACHINE_ID: ${{ secrets.TEST_MACHINE_ID }}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/unit-and-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
schedule:
- cron: '25 02 * * THU'
workflow_dispatch:
Expand Down Expand Up @@ -34,7 +39,6 @@ jobs:

name: Unit and integration test
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
env:
EXTENSION_PATH: "my-code/remediation-engine"

Expand Down Expand Up @@ -75,7 +79,7 @@ jobs:
ddev exec -s crowdsec cscli version

- name: Clone sources
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: ${{env.EXTENSION_PATH}}

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ The [public API](https://semver.org/spec/v2.0.0.html#spec-item-1) of this libra
As far as possible, we try to adhere to [Symfony guidelines](https://symfony.com/doc/current/contributing/code/bc.html#working-on-symfony-code) when deciding whether a change is a breaking change or not.


---

## [4.3.1](https://github.com/crowdsecurity/php-remediation-engine/releases/tag/v4.3.1) - 2025-12-05
[_Compare with previous release_](https://github.com/crowdsecurity/php-remediation-engine/compare/v4.3.0...v4.3.1)


### Fixed

- Allow `Allowlists` with no description

---

## [4.3.0](https://github.com/crowdsecurity/php-remediation-engine/releases/tag/v4.3.0) - 2025-04-11
Expand Down
19 changes: 6 additions & 13 deletions docs/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

There are many ways to install this library on a local PHP environment.

We are using [DDEV](https://ddev.readthedocs.io/en/stable/) because it is quite simple to use and customize.
We are using [DDEV](https://docs.ddev.com/en/stable/) because it is quite simple to use and customize.

Of course, you may use your own local stack, but we provide here some useful tools that depends on DDEV.

Expand All @@ -42,7 +42,7 @@ For a quick start, follow the below steps.

#### DDEV installation

For the DDEV installation, please follow the [official instructions](https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/).
For the DDEV installation, please follow the [official instructions](https://docs.ddev.com/en/stable/users/install/ddev-installation/).


#### Prepare DDEV PHP environment
Expand Down Expand Up @@ -81,10 +81,10 @@ ddev config --project-type=php --php-version=8.2 --project-name=remediation-engi
- Add some DDEV add-ons:

```bash
ddev get ddev/ddev-redis
ddev get ddev/ddev-memcached
ddev get julienloizelet/ddev-tools
ddev get julienloizelet/ddev-crowdsec-php
ddev add-on get ddev/ddev-redis
ddev add-on get ddev/ddev-memcached
ddev add-on get julienloizelet/ddev-tools
ddev add-on get julienloizelet/ddev-crowdsec-php
```

- Clone this repo sources in a `my-code/remediation-engine` folder:
Expand Down Expand Up @@ -252,13 +252,6 @@ Example:
feat(watcher): Add a new endpoint for watcher


You can use the `commit-msg` git hook that you will find in the `.githooks` folder :

```
cp .githooks/commit-msg .git/hooks/commit-msg
chmod +x .git/hooks/commit-msg
```

### Allowed message `type` values

- chore (automatic tasks; no production code change)
Expand Down
1 change: 0 additions & 1 deletion src/CapiRemediation.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ private function validateAllowlist(array $allowlist): bool
if (
!empty($allowlist['id'])
&& !empty($allowlist['name'])
&& !empty($allowlist['description'])
&& !empty($allowlist['url'])
) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,5 @@ class Constants extends CommonConstants
/**
* @var string The current version of this library
*/
public const VERSION = 'v4.3.0';
public const VERSION = 'v4.3.1';
}
1 change: 1 addition & 0 deletions tools/coding-standards/psalm/psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<errorLevel type="info">
<referencedClass name="Predis\ClientInterface"/>
<referencedClass name="Relay\Relay"/>
<referencedClass name="Relay\Cluster"/>
</errorLevel>
</UndefinedClass>
<UndefinedInterfaceMethod>
Expand Down
Loading