ThisCalculator

Everyday

JEV Security Settings to Change Before Deployment

Updated · Standard formula, shown below

Average pace 5.00 min/km
Average speed
12.00 km/h
Result
Finish time
50 min
You entered
Distance
10 km
You entered

JEV Security Settings to Change Before Deployment

Before deploying a Java Embedded Virtual Machine (JEV) in a production environment, teams should change a specific set of security settings to reduce the attack surface and meet compliance requirements. The most critical changes include disabling remote management unless strictly needed, enforcing strong authentication for JMX, restricting network interfaces, and applying the principle of least privilege to the JVM’s file and socket permissions.

Formula

The average pace is the total time divided by the distance:

pace = t / d

where t is the finish time in minutes and d is the distance in kilometers. The average speed is the distance divided by the time in hours:

speed = d / (t / 60)

Both results are rounded to two decimal places.

Worked Example

Using the default values: t = 50 minutes, d = 10 km.

pace = 50 / 10 = 5.00 min/km

speed = 10 / (50 / 60) = 10 / 0.8333 = 12.00 km/h

So a 50‑minute, 10‑km run gives an average pace of 5:00 per kilometer and an average speed of 12.00 km/h.

Why JEV Security Settings Matter

JEV is a stripped‑down Java runtime designed for embedded devices—routers, industrial controllers, point‑of‑sale terminals, and IoT gateways. Unlike a desktop JRE, it often runs with limited resources and may be deployed on hardware that stays in the field for years. That longevity means a misconfigured JVM can become a silent backdoor. Attackers frequently scan for open JMX ports or default keystores, and an unsecured JEV is an easy target.

The default configuration of a standard Java runtime is not hardened for production. It may listen on all interfaces, allow remote debugging, or trust a broad set of certificate authorities. For an embedded device, every open port and every enabled feature is a potential entry point. Changing these settings before deployment is not just a best practice—it is often a compliance requirement in sectors like healthcare, finance, and critical infrastructure.

How JEV Security Works

JEV security relies on several layers that work together:

  • Java security manager (though deprecated in newer versions) can restrict file, network, and system property access.
  • JMX (Java Management Extensions) allows remote monitoring and management, but if exposed without authentication, it gives attackers full control over the JVM.
  • Keystores and truststores hold the certificates used for TLS and code signing. Default passwords and self‑signed certificates are common weaknesses.
  • Network permissions are controlled by the security policy file, which defines which sockets the JVM can open.
  • JVM flags like -Djava.security.manager and -Dcom.sun.management.jmxremote turn features on or off at launch.

Each layer can be independently configured, but they must be considered together. For example, you can close the JMX port but leave a debug port open—an attacker will simply use that instead.

Key Settings to Change Before Deployment

The exact settings depend on your JEV version (Java 8, 11, 17, etc.), but these are the most important ones to review:

  1. Disable remote management unless absolutely necessary. If you do not need remote JMX, do not enable it. If you do, use SSL and strong authentication.
  2. Set a strong JMX password and role. The default jmxremote.password file often contains a placeholder that must be changed. Use a file with read‑only permissions for the JVM user.
  3. Bind JMX to localhost only. Use -Dcom.sun.management.jmxremote.host=127.0.0.1 or the appropriate loopback address.
  4. Disable remote debugging. Do not use -agentlib:jdwp unless you are actively debugging, and even then, bind it to localhost with a non‑default port.
  5. Replace default keystore passwords. The default changeit password is well known. Generate a new keystore with a strong password and restrict file access.
  6. Set a restrictive security policy. Grant the minimum permissions your application needs. Use java.security.policy to point to a custom policy file.
  7. Limit network interfaces. If your device has multiple network interfaces, ensure the JVM only listens on the intended one.
  8. Disable unnecessary JVM features. Turn off RMI, CORBA, and other legacy protocols if they are not used.

Common Mistakes and Misconceptions

One common mistake is assuming that the JVM’s default settings are secure because the OS is hardened. That is false—the JVM runs as a user process and inherits the OS user’s permissions. If the JVM runs as root, a compromised JVM means root access.

Another misconception is that disabling the security manager makes the JVM more secure because it removes a source of bugs. In fact, the security manager is a valuable layer of defense, and disabling it without a replacement (like Java’s module system or container isolation) increases risk.

Teams also forget to change the default keystore password. The default changeit is publicly documented, and many tools scan for it. Even if you use a self‑signed certificate, you must protect the private key with a strong password.

Finally, some developers leave the JMX port open “temporarily� for debugging and forget to close it. This is how many real‑world breaches start. Always verify that no unintended ports are listening before deployment.

How to Choose the Right Settings

Start by listing what your application actually needs:

  • Does it need to accept incoming network connections? If so, on which port and interface?
  • Does it need to make outbound connections (e.g., to a central server)?
  • Does it need to read or write files? Only those directories?
  • Does it need to load native libraries?

Then create a security policy that grants only those permissions. For example, if your application only needs to send data to a single server, allow SocketPermission only to that host and port. If it does not need file writes, deny FilePermission for write actions.

For JMX, decide whether you need remote monitoring at all. If you do, use SSL and a password file with a strong password. If you only need local monitoring, bind to localhost and use a Unix socket if available.

Finally, test the configuration in a staging environment that mirrors production. Run a vulnerability scan and attempt to connect to all ports from an external network to confirm they are closed.

Costs and Trade-Offs

Hardening JEV has a small performance cost. Enabling the security manager adds overhead to every permission check, and SSL for JMX adds CPU usage. On a resource‑constrained device, this can be noticeable. However, the security benefit far outweighs the performance hit in most cases.

There is also a maintenance cost. A restrictive security policy can break when you update the application or add new features. You will need to revisit the policy each time you change the code. Some teams mitigate this by using a policy that is moderately restrictive but not overly granular—for example, allowing all permissions under a specific directory rather than individual files.

Another trade-off is convenience. Remote debugging and JMX are incredibly useful during development, but they are liabilities in production. Many teams adopt a “secure by default� approach: the build process generates a hardened configuration for production, while development uses a separate, more permissive one.

Alternatives and Additional Layers

JEV security settings are only one part of a defense‑in‑depth strategy. Consider these complementary measures:

  • Run the JVM as a non‑root user. This limits the damage if the JVM is compromised.
  • Use a firewall. Block all ports except those the JVM needs.
  • Use containerization or OS‑level sandboxing. For example, run the JVM inside a Docker container with read‑only filesystem and no network except the required ports.
  • Use a reverse proxy for management interfaces. If you need remote JMX, put it behind an SSH tunnel or a VPN instead of exposing it directly.
  • Keep the JVM updated. Apply security patches promptly. JEV versions have different security lifecycles, so plan for upgrades.

Each of these layers makes it harder for an attacker to exploit a single misconfiguration. Even if you miss a setting, the firewall or OS user restrictions can stop an attack.

Frequently Asked Questions

What is the default JMX password and why must I change it?

The default JMX password file contains a placeholder user with the password changeit (the same default as the Java keystore). This is publicly known, so leaving it unchanged is equivalent to having no authentication. Change it to a strong, unique password and set the file permissions so only the JVM user can read it.

Should I disable the Java security manager?

In Java 17 and later, the security manager is deprecated for removal, but for JEV versions that still support it, you should keep it enabled unless you have a solid replacement. If you disable it, you lose a layer of defense. Consider using container isolation or OS‑level security to compensate.

How do I bind JMX to localhost?

Add the JVM flag -Dcom.sun.management.jmxremote.host=127.0.0.1 (or the IPv6 loopback ::1). This makes the JMX port only accessible from the same machine, so you must use an SSH tunnel or a local agent to connect remotely.

What is the difference between a keystore and a truststore?

A keystore holds your private keys and certificates (used to prove your identity), while a truststore holds certificates of trusted CAs (used to verify others). Both have default passwords (changeit) that must be changed. If you use self‑signed certificates, you must add them to the truststore of any client that connects.

Can I use a firewall instead of changing JVM settings?

A firewall is a good complement, but it is not a substitute. It can block external access to a port, but it cannot prevent a local attacker or a compromised process from using the JVM’s open port. Always configure the JVM itself to listen only on the intended interfaces and to require authentication.

Does JEV support the same security policies as the full JRE?

JEV is a subset of the full JRE, but it includes the core security classes, the security manager, and the policy file mechanism. However, some features like the Java Management Extensions (JMX) remote may be trimmed. Check your JEV documentation to see which components are included.

Related

Formula used
in t | Finish time | min | 50 | 0
in d | Distance | km | 10 | 0
out pace | Average pace | min/km | t / d | 2
out speed | Average speed | km/h | d / (t / 60) | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.