Skip to content

Commit

Permalink
Updated CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberphor committed Oct 13, 2024
1 parent 7376945 commit 471a4f4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,5 @@ jobs:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest --cov=sigma --cov-report term --cov-report xml:cov.xml -vv
- name: Store coverage for badge
if: ${{ runner.os == 'Linux' }}
run: poetry run python print-coverage.py >> $GITHUB_ENV
- name: Create coverage badge
if: ${{ github.repository == 'cyberphor/pySigma-backend-powershell' && github.event_name == 'push' && runner.os == 'Linux' }}
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: d3f7db7182e7819f3748e64a2ab2d126
filename: cyberphor-pySigma-backend-powershell.json
label: Coverage
message: ${{ env.COVERAGE }}
color: ${{ env.COVERAGE_COLOR }}
- name: Lint with black
run: poetry run black --check .
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ packages = [
python = "^3.11"
pysigma = "^0.11.14"
pytest = "^8.3.3"
black = "^24.10.0"

[tool.poetry.scripts]
sigma2powershell = "scripts.sigma2powershell:main"
Expand Down
3 changes: 2 additions & 1 deletion sigma/backends/powershell/powershell.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

class PowerShellBackend(TextQueryBackend):
"""PowerShell backend."""

name: ClassVar[str] = "PowerShell backend"
formats: Dict[str, str] = {
"default": "PowerShell queries",
Expand Down Expand Up @@ -205,4 +206,4 @@ class PowerShellBackend(TextQueryBackend):
def finalize_query_default(
self, rule: SigmaRule, query: Any, index: int, state: ConversionState
) -> Any:
return f'-LogName "{rule.logsource.service}" | Read-WinEvent | Where-Object {{{query}}}"'
return f'-LogName "{rule.logsource.service}" | Read-WinEvent | Where-Object {{{query}}}"'

0 comments on commit 471a4f4

Please sign in to comment.