Skip to content

Commit

Permalink
add jks file detction in azure (#960)
Browse files Browse the repository at this point in the history
* 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
4 people committed May 30, 2023
1 parent 49abffe commit 8e85f4e
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
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 not shown.
Binary file not shown.
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>

0 comments on commit 8e85f4e

Please sign in to comment.