Skip to main content

Is there a way to set Java security preferences with a script? We have a lab using Wordle and the site applet gets blocked by Java with the default "High" security level. When I drop the level to medium, it works fine. I'd like to set this level across all machines in this lab remotely. I tried the following defaults command:



defaults write com.oracle.javadeployment.plist deployment.securty.level MEDIUM



This added the key outside of my <dict> array. I'd like to add the MEDIUM security setting inside that array like this:



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>/com/oracle/javadeployment/</key>
<dict>
<key>deployment.javaws.appicon.index</key>
<string>/Users/john/Library/Application Support/Oracle/Java/Deployment/cache/6.0/appIcon/appIcon.xml</string>
<key>deployment.javaws.splash.index</key>
<string>/Users/john/Library/Application Support/Oracle/Java/Deployment/cache/6.0/splash/splash.xml</string>
<key>deployment.modified.timestamp</key>
<string>1378397568382</string>
<key>deployment.proxy.type</key>
<string>0</string>
<key>deployment.security.level</key>
<string>MEDIUM</string>

<key>deployment.version</key>
<string>7.21</string>
</dict>
</dict>
</plist>



Is there a way I can modify my defaults command or another way to do this?



Thanks,
John

@kempt
Were just going to create that directory in the Finder, and place the two files we created with a text editor such as text edit or text wrangler. Then open Composer and drag the two files into the left side of composer.....wait and it will re-create the folder structure with the files. You can check the permissions at the bottom of the window on composer.
Dan De Rusha


@dderusha
So, when you're saying "Create that directory in the Finder", how are you accomplishing this? The way I would do it doesn't seem to be re-creating in Composer - it just adds the one file.


ok forget composer for a minute...... Go to your finder.
Do you see this path?
/Library/Application Support/Oracle/Java/Deployment/
If not in the Finder, go up to File - New Folder. and create this exact folder structure.
Drop your config and properties files into Deployment.
Now open composer.
Drag the config and properties files to the left hand side of composer.
wait and composer now should create this same path with the files in it...hit the button at the top to make a .dmg and your done.
Dan De Rusha


That's what I tired doing before. I was expecting to see the path on the left, but if I click the .txt file I dragged in, the path in the main window is correct.


@kempt
Left side will show the name of the package....click on it to change the name.
Right side shows the path.


Gotcha. Just ran it in Self-Service - policy ran but no change in the settings occurred. Also, is there any way to allow non-admins to run this policy? We need to push it out to our non-admin students.


you can "push" it with a policy if you would like. you can also set it up in self service. regarding no change in the settings, did you set the permissions before making it?


I did, according to your description. We have one Owner (our admin account) and one Group (students). For Deployment, the Owner has RWX, Group has RX, and Everyone has X. For the two files, Owner has RW, Group has RW and Everyone has R.


This is a global preference not at the user level
/Library not ~/Library
the owner is root, group is admin



drwxr-xr-x 5 root admin 170 May 14 14:15 Java



all the way down


FYI,



From http://www.java.com/en/download/help/jcp_security.xml



Starting with Java 8 Update 20, the Medium security level has been removed from the Java Control Panel. Only High and Very High levels are available.

The exception site list provides users with the option of allowing the same applets that would have been allowed by selecting the Medium option but on a site-by-site basis therefore minimizing the risk of using more permissive settings.

I was wondering if anyone has been able to disable "Check for Updates Automatically" via script with version 8 update 20?



If so would you mind sharing??



Thanks in advance...


@dderusha,
I switched the path to the root pay rather than the user. However, I'm still unclear on how you're telling me to set the permissions. What do you mean by "drwxr-xr-x 5 root admin 170 "?


@kemt
can you post the permissions of your directory and files?


Owner: root (0) R W X
Group: admin (80) R X
Everyone: X



Same for both files.


you should be good to go with those permissions.


So after I run that package in Self-Service, I should be able to open my Java Preferences and see the slider set to Medium?


yes, make sure you check the box for FEU - fill existing users.


Still not doing it, and I had FEU checked.


Reply