Skip to content

Commit

Permalink
Merge branch 'contrib/munna-metron_SentinelOne-V2-3.2.37' into Sentin…
Browse files Browse the repository at this point in the history
…elOne-V2-3.2.37
  • Loading branch information
munna-metron authored Mar 4, 2025
2 parents 6ea399f + 9e3773e commit 06d676b
Show file tree
Hide file tree
Showing 277 changed files with 14,081 additions and 3,412 deletions.
2 changes: 1 addition & 1 deletion .github/github_workflow_scripts/parse_junit_per_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def parse_pack_name(class_name: str):
return parsed_pack_name


def parse_xml(path: Path = Path(".report_pytest.xml")) -> dict[str, float]:
def parse_xml(path: Path = Path("report_pytest.xml")) -> dict[str, float]:
pack_times: defaultdict[str, float] = defaultdict(int)

for suite in ET.parse(path).getroot().findall("testsuite"):
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pre-commit-reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
id: check-pytest-junit-exists
uses: andstor/file-existence-action@v2
with:
files: ".report_pytest.xml"
files: "report_pytest.xml"

- name: Create pack-wise pytest report
run: poetry run python .github/github_workflow_scripts/parse_junit_per_pack.py
Expand All @@ -86,7 +86,7 @@ jobs:
github.event.pull_request.head.repo.fork == false
- name: Upload junit & pack-wise pytest report
uses: actions/upload-artifact@v4
uses: PaloAltoNetworks/upload-secure-artifact@v1.0.5
if: |
always() &&
steps.check-pytest-junit-exists.outputs.files_exists == 'true' &&
Expand All @@ -95,7 +95,7 @@ jobs:
name: pytest
path: |
packwise_pytest_time.csv
.report_pytest.xml
report_pytest.xml
if-no-files-found: error

- name: Pytest coverage comment
Expand All @@ -108,7 +108,7 @@ jobs:
continue-on-error: true # may fail on output > 65k chars
with:
pytest-xml-coverage-path: coverage_report/coverage.xml
junitxml-path: .report_pytest.xml
junitxml-path: report_pytest.xml

- uses: actions/cache/save@v3
if: always()
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Packs/Whois/Integrations/Whois/test_data/microsocks
.pre-commit-config-content.yaml
.report.json
.report_pytest.xml
report_pytest.xml
.report_mypy.xml
coverage.xml
Packs/**/Integrations/**/.pytest.ini
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ repos:
- -v
- --override-ini='asyncio_mode=auto'
- --rootdir=/src
- --junitxml=/src/.pre-commit/pytest-junit/.report_pytest.xml
- --junitxml=/src/.pre-commit/pytest-junit/report_pytest.xml
- --color=yes
- --files
args:docker_autoupdate:
Expand All @@ -163,7 +163,7 @@ repos:
- -v
- --override-ini='asyncio_mode=auto'
- --rootdir=/src
- --junitxml=/src/.pre-commit/pytest-junit/.report_pytest.xml
- --junitxml=/src/.pre-commit/pytest-junit/report_pytest.xml
- --color=yes
- --files
copy_files:
Expand Down Expand Up @@ -193,7 +193,7 @@ repos:
- -v
- --override-ini='asyncio_mode=auto'
- --rootdir=/src
- --junitxml=/src/.pre-commit/pytest-junit/.report_pytest.xml
- --junitxml=/src/.pre-commit/pytest-junit/report_pytest.xml
- --color=yes
copy_files:
- Tests/scripts/dev_envs/pytest/conftest.py
Expand Down
3 changes: 2 additions & 1 deletion Documentation/common_server_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"BaseHTTPClient", "DemistoHandler", "DebugLogger", "FeedIndicatorType", "Indicator",
"IndicatorType", "EntryType", "EntryFormat", "abstractmethod",
"HTTPAdapter", "Retry", "Common", "randint", "GetDemistoVersion", "get_demisto_version",
"BaseWidget", "UTC", "WarningsHandler", "__line__", "_find_relevant_module"]
"BaseWidget", "UTC", "WarningsHandler", "__line__", "_find_relevant_module", "register_module_line",
"fix_traceback_line_numbers"]

PY_IRREGULAR_FUNCS = {"LOG": {"argList": ["message"]}}

Expand Down
1 change: 1 addition & 0 deletions Packs/Akamai_SIEM/Integrations/Akamai_SIEM/Akamai_SIEM.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ def fetch_events_command(
"please run 'akamai-siem-reset-offset' on the specific instance.\n" \
'For more information, please refer to the Troubleshooting section in the integration documentation.\n' \
f'original error: [{e}]'
reset_offset_command(client)
raise DemistoException(err_msg)
else:
raise DemistoException(e)
Expand Down
6 changes: 6 additions & 0 deletions Packs/Akamai_SIEM/ReleaseNotes/1_2_3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Integrations

##### Akamai WAF SIEM

- Fixed an issue where auto offset reset didn't work for **fetch-events**.
2 changes: 1 addition & 1 deletion Packs/Akamai_SIEM/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Akamai WAF SIEM",
"description": "Use the Akamai WAF SIEM integration to retrieve security events from Akamai Web Application Firewall (WAF) service.",
"support": "xsoar",
"currentVersion": "1.2.2",
"currentVersion": "1.2.3",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2459,7 +2459,7 @@ def form_powershell_command(unescaped_string: str) -> str:
else:
escaped_string += char

return f"powershell -Command '{escaped_string}'"
return f"powershell -Command \"{escaped_string}\""


def run_script_execute_commands_command(client: CoreClient, args: Dict) -> CommandResults:
Expand Down
10 changes: 5 additions & 5 deletions Packs/ApiModules/Scripts/CoreIRApiModule/CoreIRApiModule_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
POWERSHELL_COMMAND_CASES = [
pytest.param(
"Write-Output 'Hello, world, it`s me!'",
"powershell -Command 'Write-Output ''Hello, world, it`s me!'''",
"powershell -Command \"Write-Output ''Hello, world, it`s me!''\"",
id='Hello World message',
),
pytest.param(
r"New-Item -Path 'C:\Users\User\example.txt' -ItemType 'File'",
"powershell -Command 'New-Item -Path ''C:\\Users\\User\\example.txt'' -ItemType ''File'''",
"powershell -Command \"New-Item -Path ''C:\\Users\\User\\example.txt'' -ItemType ''File''\"",
id='New file in path with backslashes',
),
pytest.param(
"$message = 'This is a test with special chars: `&^%$#@!'; Write-Output $message",
"powershell -Command '$message = ''This is a test with special chars: `&^%$#@!''; Write-Output $message'",
"powershell -Command \"$message = ''This is a test with special chars: `&^%$#@!''; Write-Output $message\"",
id='Special characters message',
),
pytest.param(
Expand All @@ -46,11 +46,11 @@
"$sessionId = $sessionInfo[2]; if ($users -contains $username) { logoff $sessionId } } }"
),
(
"powershell -Command '$users = @(JohnDoe) -split '';''; query user | Select-Object -Skip 1 | "
"powershell -Command \"$users = @(JohnDoe) -split '';''; query user | Select-Object -Skip 1 | "
"ForEach-Object { $sessionInfo = $_ -split ''\\s+'' | "
"Where-Object { $_ -ne '''' -and $_ -notlike ''Disc'' }; "
"if ($sessionInfo.Length -ge 6) { $username = $sessionInfo[0].TrimStart(''>''); "
"$sessionId = $sessionInfo[2]; if ($users -contains $username) { logoff $sessionId } } }'"
"$sessionId = $sessionInfo[2]; if ($users -contains $username) { logoff $sessionId } } }\""
),
id='End RDP session for users',
),
Expand Down
Loading

0 comments on commit 06d676b

Please sign in to comment.