Skip to content

Commit 51d36a9

Browse files
authored
Modify scan script for pac4j-jwt to handle output folder
Updated the action script to save scan output to a specified folder and added a check for the output directory. Also make it friendlier to run directly
1 parent 59cb2cb commit 51d36a9

File tree

1 file changed

+43
-32
lines changed

1 file changed

+43
-32
lines changed
Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BES.xsd">
3-
<Task>
4-
<Title>Scan to find pac4j-jwt - CVE-2026-29000 - Unix/Linux</Title>
5-
<Description>This is a task that searches the file system for pac4j-jwt but not which version. It scans file contents but not file names, which probably should also be checked. Results do not mean there is a vulernable version found, but that further investigation is needed. </Description>
6-
<Relevance>unix of operating system</Relevance>
7-
<Category></Category>
8-
<DownloadSize>0</DownloadSize>
9-
<Source>Internal</Source>
10-
<SourceID>jgstew</SourceID>
11-
<SourceReleaseDate>2026-03-06</SourceReleaseDate>
12-
<SourceSeverity></SourceSeverity>
13-
<CVENames>CVE-2026-29000</CVENames>
14-
<SANSID></SANSID>
15-
<MIMEField>
16-
<Name>x-fixlet-modification-time</Name>
17-
<Value>Fri, 06 Mar 2026 16:07:59 +0000</Value>
18-
</MIMEField>
19-
<Domain>BESC</Domain>
20-
<DefaultAction ID="Action1">
21-
<Description>
22-
<PreLink>Click </PreLink>
23-
<Link>here</Link>
24-
<PostLink> to deploy this action.</PostLink>
25-
</Description>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BES.xsd">
3+
<Task>
4+
<Title>Scan to find pac4j-jwt - CVE-2026-29000 - Unix/Linux</Title>
5+
<Description>This is a task that searches the file system for pac4j-jwt but not which version. It scans file contents but not file names, which probably should also be checked. Results do not mean there is a vulernable version found, but that further investigation is needed. </Description>
6+
<Relevance>unix of operating system</Relevance>
7+
<Category></Category>
8+
<DownloadSize>0</DownloadSize>
9+
<Source>Internal</Source>
10+
<SourceID>jgstew</SourceID>
11+
<SourceReleaseDate>2026-03-06</SourceReleaseDate>
12+
<SourceSeverity></SourceSeverity>
13+
<CVENames>CVE-2026-29000</CVENames>
14+
<SANSID></SANSID>
15+
<MIMEField>
16+
<Name>x-fixlet-modification-time</Name>
17+
<Value>Fri, 06 Mar 2026 16:07:59 +0000</Value>
18+
</MIMEField>
19+
<Domain>BESC</Domain>
20+
<DefaultAction ID="Action1">
21+
<Description>
22+
<PreLink>Click </PreLink>
23+
<Link>here</Link>
24+
<PostLink> to deploy this action.</PostLink>
25+
</Description>
2626
<ActionScript MIMEType="application/x-Fixlet-Windows-Shell"><![CDATA[
2727
parameter "bash_script_name" = "run-pac4j-jwt-scan.sh"
2828
parameter "output_folder" = "{pathnames of folders "Logs" of folders "__Global" of data folders of client}"
@@ -37,11 +37,21 @@ delete "{parameter "output_folder"}/scan_pac4j-jwt_results.txt"
3737
createfile until _END_OF_FILE_
3838
#!/usr/bin/env bash
3939
40-
echo "$(date +'%Y-%m-%d %T'): pac4j-jwt Scan Started" >> "{parameter "output_folder"}/scan_pac4j-jwt_results.txt"
40+
OUTPUT_FOLDER="{parameter "output_folder"}"
4141
42-
find / -xdev -type f -print0 | xargs -0 grep -Hl -F "pac4j-jwt" >> "{parameter "output_folder"}/scan_pac4j-jwt_results.txt"
42+
if [[ -d "$OUTPUT_FOLDER" ]]; then
43+
echo "Saving Scan Output To: $OUTPUT_FOLDER"
44+
else
45+
echo "Saving Scan Output To: /tmp"
46+
OUTPUT_FOLDER="/tmp"
47+
fi
4348
44-
echo "$(date +'%Y-%m-%d %T'): pac4j-jwt Scan Finished" >> "{parameter "output_folder"}/scan_pac4j-jwt_results.txt"
49+
echo "$(date +'%Y-%m-%d %T'): pac4j-jwt Scan Started" >> "$OUTPUT_FOLDER/scan_pac4j-jwt_results.txt"
50+
51+
# // Use find so we only inspect real files in real directories. We don't want an infinite loop or network shares.
52+
find / -xdev -type f -print0 | xargs -0 grep -Hl -F "pac4j-jwt" >> "$OUTPUT_FOLDER/scan_pac4j-jwt_results.txt"
53+
54+
echo "$(date +'%Y-%m-%d %T'): pac4j-jwt Scan Finished" >> "$OUTPUT_FOLDER/scan_pac4j-jwt_results.txt"
4555
4656
_END_OF_FILE_
4757
@@ -52,7 +62,8 @@ delete /tmp/{parameter "bash_script_name"}
5262
copy __createfile /tmp/{parameter "bash_script_name"}
5363
5464
// run the scan:
55-
run bash /tmp/{parameter "bash_script_name"}]]></ActionScript>
56-
</DefaultAction>
57-
</Task>
58-
</BES>
65+
66+
run bash /tmp/{parameter "bash_script_name"}]]></ActionScript>
67+
</DefaultAction>
68+
</Task>
69+
</BES>

0 commit comments

Comments
 (0)