mirror of
https://github.com/fabriziosalmi/patterns.git
synced 2026-07-31 15:05:44 -04:00
Bumps the actions group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `3` | `7` | | [actions/setup-node](https://github.com/actions/setup-node) | `4` | `7` | | [actions/configure-pages](https://github.com/actions/configure-pages) | `4` | `6` | | [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) | `3` | `5` | | [actions/deploy-pages](https://github.com/actions/deploy-pages) | `4` | `5` | | [actions/cache](https://github.com/actions/cache) | `3` | `6` | | [actions/setup-python](https://github.com/actions/setup-python) | `4` | `7` | | [softprops/action-gh-release](https://github.com/softprops/action-gh-release) | `2` | `3` | Updates `actions/checkout` from 3 to 7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v7) Updates `actions/setup-node` from 4 to 7 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4...v7) Updates `actions/configure-pages` from 4 to 6 - [Release notes](https://github.com/actions/configure-pages/releases) - [Commits](https://github.com/actions/configure-pages/compare/v4...v6) Updates `actions/upload-pages-artifact` from 3 to 5 - [Release notes](https://github.com/actions/upload-pages-artifact/releases) - [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v5) Updates `actions/deploy-pages` from 4 to 5 - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](https://github.com/actions/deploy-pages/compare/v4...v5) Updates `actions/cache` from 3 to 6 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v6) Updates `actions/setup-python` from 4 to 7 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v7) Updates `softprops/action-gh-release` from 2 to 3 - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/configure-pages dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/deploy-pages dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-node dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-python dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/upload-pages-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: softprops/action-gh-release dependency-version: '3' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
93 lines
2.7 KiB
YAML
93 lines
2.7 KiB
YAML
name: Nginx patterns validation
|
|
|
|
permissions:
|
|
contents: read # Needed to read repository contents (e.g., WAF rules)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # Trigger on push to main branch
|
|
pull_request:
|
|
branches:
|
|
- main # Trigger on pull request to main branch
|
|
|
|
jobs:
|
|
validate-nginx-configuration:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Download WAF rules
|
|
run: |
|
|
wget https://github.com/fabriziosalmi/patterns/releases/download/latest/nginx_waf.zip -O nginx_waf.zip
|
|
echo "Downloaded nginx_waf.zip"
|
|
ls -lh nginx_waf.zip
|
|
|
|
- name: Extract WAF rules
|
|
run: |
|
|
unzip nginx_waf.zip -d waf_rules
|
|
echo "Extracted WAF rules into waf_rules directory"
|
|
ls -lh waf_rules/
|
|
|
|
- name: Verify WAF rules extraction
|
|
run: |
|
|
if [ -z "$(ls -A waf_rules/*.conf 2>/dev/null)" ]; then
|
|
echo "Error: No .conf files found in waf_rules/"
|
|
echo "Contents of waf_rules/:"
|
|
ls -l waf_rules/
|
|
exit 1
|
|
fi
|
|
echo "Found WAF configuration files:"
|
|
ls -l waf_rules/*.conf
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v7
|
|
with:
|
|
python-version: "3.9"
|
|
|
|
- name: Install crossplane
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install crossplane
|
|
|
|
- name: Validate individual WAF rule files
|
|
run: |
|
|
for file in waf_rules/*.conf; do
|
|
echo "Validating $file..."
|
|
# Use crossplane to parse and validate the file
|
|
if ! crossplane parse "$file" > /dev/null; then
|
|
echo "Error: Validation failed for $file"
|
|
crossplane parse "$file" # Print detailed error
|
|
exit 1
|
|
fi
|
|
echo "Validation successful for $file"
|
|
done
|
|
|
|
- name: Merge all WAF rules into a single file
|
|
run: |
|
|
echo "Merging all WAF rules into a single file..."
|
|
echo "http {" > merged_waf_rules.conf
|
|
for file in waf_rules/*.conf; do
|
|
echo "Merging $file..."
|
|
cat "$file" >> merged_waf_rules.conf
|
|
echo "" >> merged_waf_rules.conf
|
|
done
|
|
echo "}" >> merged_waf_rules.conf
|
|
|
|
echo "Contents of merged_waf_rules.conf:"
|
|
cat merged_waf_rules.conf
|
|
|
|
- name: Validate merged WAF rules
|
|
run: |
|
|
echo "Validating merged WAF rules..."
|
|
# Use crossplane to parse and validate the merged file
|
|
if ! crossplane parse merged_waf_rules.conf > /dev/null; then
|
|
echo "Error: Validation failed for merged_waf_rules.conf"
|
|
crossplane parse merged_waf_rules.conf # Print detailed error
|
|
exit 1
|
|
fi
|
|
echo "Validation successful for merged_waf_rules.conf"
|
|
|