Skip to content
This repository was archived by the owner on May 4, 2024. It is now read-only.

Commit ec96605

Browse files
Added usability features and cleanup. See commit comment for details.
Added feature to change port through property Added feature to use HTTP or HTTPS listener based on property Removed Java and Script modules Updated dependencies and cleaned pom.xml Made password masked in Runtime Manager Moved configurations to global.xml Updated to Spring Core 5.3 and Security 5.6 Added Spring auth filter to check for proper role Updated DNS endpoint RAML and default value so console works
1 parent 0fc9db1 commit ec96605

File tree

10 files changed

+252
-178
lines changed

10 files changed

+252
-178
lines changed

.DS_Store

-6 KB
Binary file not shown.

README.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,39 @@
11
# Net Tools API
22

3-
The Net-Tools-Api app is a deployable Mule app that you can deploy to CloudHub. The app will then expose a very simple UI that will allow you to do basic networking commands - the supported commands are DNS lookups, Ping, TraceRoute, opening a TCP socket, doing a simple request with curl, pull certificates and check supported ciphers for a given SSL/TLS endpoint. The idea is that most networking related issues with your CloudHub VPC and VPN are related to connectivity to your on-prem systems, and most of those issues end up being resolved on the customer end. If you have this tool available to you, you can work with your Networking team to test connectivity to various on-prem systems and verify that firewall and routing rules are working (and if not, you can generate some traffic that can help with diagnosing the issue).
3+
The Net Tools API is a deployable Mule app that you can deploy to CloudHub. The app will then expose a very simple UI that will allow you to do basic networking commands. The idea is that most networking related issues with your CloudHub VPC and VPN are related to connectivity to your on-prem systems, and most of those issues end up being resolved on the customer end. If you have this tool available to you, you can work with your Networking team to test connectivity to various on-prem systems and verify that firewall and routing rules are working. It can also be used to generate some traffic that can help with diagnosing networking issues.
44

5-
## Last build
5+
This supports HTTP and HTTPS connections with a configurable port for each.
66

7-
Last build can be found here: https://github.com/mulesoft-labs/net-tools-api/releases
7+
## Features
88

9-
## Usage
9+
- DNS lookups
10+
- Ping
11+
- TraceRoute
12+
- Opening a TCP socket
13+
- Simple curl request
14+
- Pull SSL certificates
15+
- Check supported ciphers for a given SSL/TLS endpoint
1016

11-
The UI can be access hitting *http://{app-name}.cloudhub.io*. It is protected by Basic Auth, the default credentials are "vpc-tools"/"SomePass". You can change those credentials setting "user" and "pass" properties in the CloudHub UI while deploying.
17+
## Latest build
1218

13-
You can also use the API Console accessing *http://{app-name}.cloudhub.io/api/console*.
19+
Latest build can be found here: https://github.com/mulesoft-labs/net-tools-api/releases
20+
21+
# Usage
22+
23+
The UI can be accessed by using the base URL for the app. The options are listed below.
24+
25+
- CloudHub Shared Load Balancer: `http://{app-name}.{region}.cloudhub.io` where the app-name and region are specific to the deployed app.
26+
- Dedicated Load Balancer: `custom url`. See *Configuration* section to update settings.
27+
28+
The API Console is available at the `/console` path.
29+
30+
The UI is protected by Basic Authentication, and the default credentials are listed in the *Configuration* section.
31+
32+
# Configuration
33+
The properties below can be set on the app to override the default settings. The proper port and protocol must be set to accommodate load balancer and VPC firewall rule settings. The default settings are for the CloudHub shared load balancer HTTP endpoint. See the [CloudHub Load Balancer documentation](https://docs.mulesoft.com/runtime-manager/lb-architecture) for which port and protocol to use for your configuration.
34+
35+
- `user`: User name for login; defaults to `vpc-tools`
36+
- `pass`: Password for login; defaults to `SomePass`
37+
- `protocol`: The protocol to use; defaults to `http`. Options: `http` or `https`
38+
- `httpPort`: Sets the listener port for http; defaults to `8081`
39+
- `httpsPort`: Sets the listener port for https; defaults to `8082`

mule-artifact.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
{"minMuleVersion":"4.1.3"}
1+
{
2+
"minMuleVersion":"4.1.3",
3+
"secureProperties": [
4+
"pass"
5+
]
6+
}

pom.xml

Lines changed: 131 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,141 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
3+
<modelVersion>4.0.0</modelVersion>
44

5-
<groupId>com.mycompany</groupId>
6-
<artifactId>net-tools-api</artifactId>
7-
<version>2.3.0</version>
8-
<packaging>mule-application</packaging>
5+
<groupId>com.mycompany</groupId>
6+
<artifactId>net-tools-api</artifactId>
7+
<version>2.3.0</version>
8+
<packaging>mule-application</packaging>
99

10-
<name>net-tools-api</name>
10+
<name>net-tools-api</name>
1111

12-
<properties>
13-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14-
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
12+
<properties>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1515

16-
<app.runtime>4.1.5</app.runtime>
17-
<mule.maven.plugin.version>3.1.6</mule.maven.plugin.version>
18-
</properties>
16+
<app.runtime>4.3.0</app.runtime>
17+
<mule.maven.plugin.version>3.4.2</mule.maven.plugin.version>
18+
<apikit.module.version>1.5.9</apikit.module.version>
19+
<http.connector.version>1.6.0</http.connector.version>
20+
<sockets.connector.version>1.2.2</sockets.connector.version>
21+
<spring.module.version>1.3.6</spring.module.version>
1922

20-
<build>
21-
<plugins>
22-
<plugin>
23-
<groupId>org.mule.tools.maven</groupId>
24-
<artifactId>mule-maven-plugin</artifactId>
25-
<version>${mule.maven.plugin.version}</version>
26-
<extensions>true</extensions>
27-
<configuration>
28-
<sharedLibraries>
29-
<sharedLibrary>
30-
<groupId>org.springframework</groupId>
31-
<artifactId>spring-context</artifactId>
32-
</sharedLibrary>
33-
<sharedLibrary>
34-
<groupId>org.springframework.security</groupId>
35-
<artifactId>spring-security-core</artifactId>
36-
</sharedLibrary>
37-
<sharedLibrary>
38-
<groupId>org.springframework</groupId>
39-
<artifactId>spring-beans</artifactId>
40-
</sharedLibrary>
41-
<sharedLibrary>
42-
<groupId>org.springframework.security</groupId>
43-
<artifactId>spring-security-config</artifactId>
44-
</sharedLibrary>
45-
<sharedLibrary>
46-
<groupId>org.springframework</groupId>
47-
<artifactId>spring-core</artifactId>
48-
</sharedLibrary>
49-
</sharedLibraries>
50-
<classifier>mule-application</classifier>
51-
</configuration>
52-
</plugin>
53-
</plugins>
54-
</build>
23+
<spring.version>5.3.15</spring.version>
24+
<spring-security.version>5.6.1</spring-security.version>
25+
</properties>
5526

56-
<dependencies>
57-
<dependency>
58-
<groupId>org.mule.connectors</groupId>
59-
<artifactId>mule-http-connector</artifactId>
60-
<version>1.5.0</version>
61-
<classifier>mule-plugin</classifier>
62-
</dependency>
63-
<dependency>
64-
<groupId>org.mule.connectors</groupId>
65-
<artifactId>mule-sockets-connector</artifactId>
66-
<version>1.1.1</version>
67-
<classifier>mule-plugin</classifier>
68-
</dependency>
69-
<dependency>
70-
<groupId>org.mule.modules</groupId>
71-
<artifactId>mule-apikit-module</artifactId>
72-
<version>1.5.8</version>
73-
<classifier>mule-plugin</classifier>
74-
</dependency>
75-
<dependency>
76-
<groupId>org.mule.modules</groupId>
77-
<artifactId>mule-spring-module</artifactId>
78-
<version>1.2.0</version>
79-
<classifier>mule-plugin</classifier>
80-
</dependency>
81-
<dependency>
82-
<groupId>org.springframework</groupId>
83-
<artifactId>spring-context</artifactId>
84-
<version>4.3.17.RELEASE</version>
85-
</dependency>
86-
<dependency>
87-
<groupId>org.springframework.security</groupId>
88-
<artifactId>spring-security-core</artifactId>
89-
<version>4.2.6.RELEASE</version>
90-
</dependency>
91-
<dependency>
92-
<groupId>org.springframework</groupId>
93-
<artifactId>spring-beans</artifactId>
94-
<version>4.3.17.RELEASE</version>
95-
</dependency>
96-
<dependency>
97-
<groupId>org.springframework.security</groupId>
98-
<artifactId>spring-security-config</artifactId>
99-
<version>4.2.6.RELEASE</version>
100-
</dependency>
101-
<dependency>
102-
<groupId>org.springframework</groupId>
103-
<artifactId>spring-core</artifactId>
104-
<version>4.3.17.RELEASE</version>
105-
</dependency>
106-
<dependency>
107-
<groupId>org.mule.modules</groupId>
108-
<artifactId>mule-scripting-module</artifactId>
109-
<version>1.1.1</version>
110-
<classifier>mule-plugin</classifier>
111-
</dependency>
112-
<dependency>
113-
<groupId>org.mule.module</groupId>
114-
<artifactId>mule-java-module</artifactId>
115-
<version>1.1.1</version>
116-
<classifier>mule-plugin</classifier>
117-
</dependency>
118-
</dependencies>
27+
<build>
28+
<plugins>
29+
<plugin>
30+
<groupId>org.mule.tools.maven</groupId>
31+
<artifactId>mule-maven-plugin</artifactId>
32+
<version>${mule.maven.plugin.version}</version>
33+
<extensions>true</extensions>
34+
<configuration>
35+
<sharedLibraries>
36+
<sharedLibrary>
37+
<groupId>org.springframework</groupId>
38+
<artifactId>spring-context</artifactId>
39+
</sharedLibrary>
40+
<sharedLibrary>
41+
<groupId>org.springframework.security</groupId>
42+
<artifactId>spring-security-core</artifactId>
43+
</sharedLibrary>
44+
<sharedLibrary>
45+
<groupId>org.springframework</groupId>
46+
<artifactId>spring-beans</artifactId>
47+
</sharedLibrary>
48+
<sharedLibrary>
49+
<groupId>org.springframework.security</groupId>
50+
<artifactId>spring-security-config</artifactId>
51+
</sharedLibrary>
52+
<sharedLibrary>
53+
<groupId>org.springframework</groupId>
54+
<artifactId>spring-core</artifactId>
55+
</sharedLibrary>
56+
</sharedLibraries>
57+
<classifier>mule-application</classifier>
58+
</configuration>
59+
</plugin>
60+
</plugins>
61+
</build>
11962

120-
<repositories>
121-
<repository>
122-
<id>anypoint-exchange</id>
123-
<name>Anypoint Exchange</name>
124-
<url>https://maven.anypoint.mulesoft.com/api/v1/maven</url>
125-
<layout>default</layout>
126-
</repository>
127-
<repository>
128-
<id>mulesoft-releases</id>
129-
<name>MuleSoft Releases Repository</name>
130-
<url>https://repository.mulesoft.org/releases/</url>
131-
<layout>default</layout>
132-
</repository>
133-
</repositories>
134-
<pluginRepositories>
135-
<pluginRepository>
136-
<id>mulesoft-releases</id>
137-
<name>mulesoft release repository</name>
138-
<layout>default</layout>
139-
<url>https://repository.mulesoft.org/releases/</url>
140-
<snapshots>
141-
<enabled>false</enabled>
142-
</snapshots>
143-
</pluginRepository>
144-
</pluginRepositories>
63+
<dependencies>
64+
<dependency>
65+
<groupId>org.mule.connectors</groupId>
66+
<artifactId>mule-http-connector</artifactId>
67+
<version>${http.connector.version}</version>
68+
<classifier>mule-plugin</classifier>
69+
</dependency>
70+
<dependency>
71+
<groupId>org.mule.connectors</groupId>
72+
<artifactId>mule-sockets-connector</artifactId>
73+
<version>${sockets.connector.version}</version>
74+
<classifier>mule-plugin</classifier>
75+
</dependency>
76+
<dependency>
77+
<groupId>org.mule.modules</groupId>
78+
<artifactId>mule-apikit-module</artifactId>
79+
<version>${apikit.module.version}</version>
80+
<classifier>mule-plugin</classifier>
81+
</dependency>
82+
<dependency>
83+
<groupId>org.mule.modules</groupId>
84+
<artifactId>mule-spring-module</artifactId>
85+
<version>${spring.module.version}</version>
86+
<classifier>mule-plugin</classifier>
87+
</dependency>
88+
<dependency>
89+
<groupId>org.springframework</groupId>
90+
<artifactId>spring-context</artifactId>
91+
<version>${spring.version}</version>
92+
</dependency>
93+
<dependency>
94+
<groupId>org.springframework</groupId>
95+
<artifactId>spring-beans</artifactId>
96+
<version>${spring.version}</version>
97+
</dependency>
98+
<dependency>
99+
<groupId>org.springframework</groupId>
100+
<artifactId>spring-core</artifactId>
101+
<version>${spring.version}</version>
102+
</dependency>
103+
<dependency>
104+
<groupId>org.springframework.security</groupId>
105+
<artifactId>spring-security-core</artifactId>
106+
<version>${spring-security.version}</version>
107+
</dependency>
108+
<dependency>
109+
<groupId>org.springframework.security</groupId>
110+
<artifactId>spring-security-config</artifactId>
111+
<version>${spring-security.version}</version>
112+
</dependency>
113+
</dependencies>
114+
115+
<repositories>
116+
<repository>
117+
<id>anypoint-exchange</id>
118+
<name>Anypoint Exchange</name>
119+
<url>https://maven.anypoint.mulesoft.com/api/v1/maven</url>
120+
<layout>default</layout>
121+
</repository>
122+
<repository>
123+
<id>mulesoft-releases</id>
124+
<name>MuleSoft Releases Repository</name>
125+
<url>https://repository.mulesoft.org/releases/</url>
126+
<layout>default</layout>
127+
</repository>
128+
</repositories>
129+
<pluginRepositories>
130+
<pluginRepository>
131+
<id>mulesoft-releases</id>
132+
<name>mulesoft release repository</name>
133+
<layout>default</layout>
134+
<url>https://repository.mulesoft.org/releases/</url>
135+
<snapshots>
136+
<enabled>false</enabled>
137+
</snapshots>
138+
</pluginRepository>
139+
</pluginRepositories>
145140

146141
</project>

src/main/mule/global.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<mule xmlns:tls="http://www.mulesoft.org/schema/mule/tls"
4+
xmlns:spring="http://www.mulesoft.org/schema/mule/spring"
5+
xmlns:apikit="http://www.mulesoft.org/schema/mule/mule-apikit"
6+
xmlns:http="http://www.mulesoft.org/schema/mule/http"
7+
xmlns="http://www.mulesoft.org/schema/mule/core"
8+
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
9+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:schemaLocation="
11+
http://www.mulesoft.org/schema/mule/mule-apikit http://www.mulesoft.org/schema/mule/mule-apikit/current/mule-apikit.xsd
12+
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
13+
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
14+
http://www.mulesoft.org/schema/mule/spring http://www.mulesoft.org/schema/mule/spring/current/mule-spring.xsd
15+
http://www.mulesoft.org/schema/mule/tls http://www.mulesoft.org/schema/mule/tls/current/mule-tls.xsd">
16+
17+
<configuration-properties doc:name="Properties Config" file="properties.yaml" />
18+
19+
<http:listener-config name="http">
20+
<http:listener-connection host="0.0.0.0" port="${httpPort}" />
21+
</http:listener-config>
22+
23+
<http:listener-config name="https">
24+
<http:listener-connection host="0.0.0.0" port="${httpsPort}" protocol="HTTPS">
25+
<tls:context >
26+
<tls:key-store type="jceks" path="server.jceks" alias="self-signed-certificate" keyPassword="selfsigned" password="selfsigned" />
27+
</tls:context>
28+
</http:listener-connection>
29+
</http:listener-config>
30+
31+
<apikit:config name="net-tools-config" raml="net-tools.raml" outboundHeadersMapName="outboundHeaders" httpStatusVarName="httpStatus" />
32+
33+
<spring:config name="Spring_Config" doc:id="45181472-36fd-44e6-b710-296481c3c450" files="beans.xml" />
34+
<spring:security-manager>
35+
<spring:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager" />
36+
</spring:security-manager>
37+
</mule>

0 commit comments

Comments
 (0)