-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add jks file detction in azure (#960)
* add jks file detction * update test * JKS Rule message rewording --------- Co-authored-by: kaiqianyang <kaiqianyang@microsoftcom> Co-authored-by: PhilipCattanach <31246010+PhilipCattanach@users.noreply.github.com> Co-authored-by: PhilipCattanach <pcattana@redhat.com>
- Loading branch information
1 parent
49abffe
commit 8e85f4e
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
rules/rules-reviewed/azure/springboot/spring-boot-to-azure-jks.windup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0"?> | ||
<ruleset id="spring-boot-to-azure-jks" | ||
xmlns="http://windup.jboss.org/schema/jboss-ruleset" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd"> | ||
<metadata> | ||
<description> | ||
Detect JKS files in Spring Boot applications | ||
</description> | ||
<dependencies> | ||
<addon id="org.jboss.windup.rules,windup-rules-xml,3.0.0.Final"/> | ||
</dependencies> | ||
<sourceTechnology id="springboot"/> | ||
<targetTechnology id="azure-spring-apps"/> | ||
<targetTechnology id="azure-appservice"/> | ||
<targetTechnology id="azure-aks"/> | ||
<targetTechnology id="azure-container-apps"/> | ||
<tag>JKS</tag> | ||
</metadata> | ||
<rules> | ||
<rule id="spring-boot-to-azure-jks-01000"> | ||
<when> | ||
<file filename="{*}.jks"/> | ||
</when> | ||
<perform> | ||
<hint title="JKS file" effort="1" category-id="mandatory"> | ||
<message>Java KeyStore file is found. Make sure to externalize the Java Keystore.</message> | ||
<tag>JKS</tag> | ||
</hint> | ||
</perform> | ||
</rule> | ||
</rules> | ||
</ruleset> |
Binary file added
BIN
+202 Bytes
rules/rules-reviewed/azure/springboot/tests/data/spring-boot-to-azure-jks/test
Binary file not shown.
Binary file added
BIN
+202 Bytes
rules/rules-reviewed/azure/springboot/tests/data/spring-boot-to-azure-jks/test.jks
Binary file not shown.
22 changes: 22 additions & 0 deletions
22
rules/rules-reviewed/azure/springboot/tests/spring-boot-to-azure-jks.windup.test.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0"?> | ||
<ruletest id="spring-boot-to-azure-jks-test" xmlns="http://windup.jboss.org/schema/jboss-ruleset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd"> | ||
<testDataPath>data/spring-boot-to-azure-jks</testDataPath> | ||
<rulePath>../spring-boot-to-azure-jks.windup.xml</rulePath> | ||
<ruleset> | ||
<rules> | ||
<rule id="spring-boot-to-azure-jks-test-01000"> | ||
<when> | ||
<not> | ||
<iterable-filter size="1"> | ||
<hint-exists message="Java KeyStore file is found." /> | ||
</iterable-filter> | ||
</not> | ||
</when> | ||
<perform> | ||
<fail message="spring-boot-to-azure-jks-test-01000 failed!" /> | ||
</perform> | ||
</rule> | ||
</rules> | ||
</ruleset> | ||
</ruletest> |