diff --git a/README.md b/README.md index 8ed04293..e2dc7c5a 100755 --- a/README.md +++ b/README.md @@ -1,39 +1,24 @@ -KeyBox +Bastillion ====== -KeyBox is a web-based SSH console that centrally manages administrative access to systems. Web-based administration is combined with management and distribution of user's public SSH keys. Key management and administration is based on profiles assigned to defined users. +Bastillion is a web-based SSH console that centrally manages administrative access to systems. Web-based administration is combined with management and distribution of user's public SSH keys. Key management and administration is based on profiles assigned to defined users. Administrators can login using two-factor authentication with [FreeOTP](https://freeotp.github.io/) or [Google Authenticator](https://github.com/google/google-authenticator). From there they can manage their public SSH keys or connect to their systems through a web-shell. Commands can be shared across shells to make patching easier and eliminate redundant command execution. -KeyBox layers TLS/SSL on top of SSH and acts as a bastion host for administration. Protocols are stacked (TLS/SSL + SSH) so infrastructure cannot be exposed through tunneling / port forwarding. More details can be found in the following whitepaper: [Implementing a Trusted Third-Party System for Secure Shell](https://www.sshkeybox.com/docs/using/whitepaper). Also, SSH key management is enabled by default to prevent unmanaged public keys and enforce best practices. +Bastillion layers TLS/SSL on top of SSH and acts as a bastion host for administration. Protocols are stacked (TLS/SSL + SSH) so infrastructure cannot be exposed through tunneling / port forwarding. More details can be found in the following whitepaper: [Implementing a Trusted Third-Party System for Secure Shell](https://www.bastillion.io/docs/using/whitepaper). Also, SSH key management is enabled by default to prevent unmanaged public keys and enforce best practices. -![Terminals](https://www.sshkeybox.com/images/screenshots/medium/terminals.png) +![Terminals](https://www.bastillion.io/images/screenshots/medium/terminals.png) -AMI in the AWS Marketplace +Bastillion Releases ------ -If you are using AWS, the simplest way to get started is to run the AMI from the AWS Marketplace. - -http://aws.amazon.com/marketplace/pp/B076PNFPCL - -Once the KeyBox instance is up and running, open your browser to https://\:443 - -Login with - - username:admin - password: - -In order to help register new EC2 instances, the KeyBox public can be found under 'Settings -> Public Key' and should be imported as an EC2 Key Pair in the AWS console. - -KeyBox Releases ------- -This software is free for non-commercial use under the AGPL licence! - Commercial users can purchase a license through an annual subscription and access the binary releases. -https://www.sshkeybox.com/subscription +https://www.bastillion.io/subscription Also, users can purchase through the AWS Marketplace. -Feel free to try out KeyBox using the build instructions below! +Feel free to try out Bastillion for a limited amount of users(6) or systems(12)! + +https://github.com/bastillion-io/Bastillion/releases Prerequisites ------------- @@ -49,7 +34,7 @@ Prerequisites **Loophole MVC** *(Only needed if building from source)* -> https://github.com/skavanagh/lmvc +> https://github.com/bastillion-io/lmvc **Install [FreeOTP](https://freeotp.github.io/) or [Google Authenticator](https://github.com/google/google-authenticator)** to enable two-factor authentication with Android or iOS @@ -72,7 +57,7 @@ In the directory that contains the pom.xml run *Note: Doing a mvn clean will delete the H2 DB and wipe out all the data.* -Using KeyBox +Using Bastillion ------ Open browser to https://\:8443 @@ -97,24 +82,24 @@ Steps: Managing SSH Keys ------ -By default KeyBox will overwrite all values in the specified authorized_keys file for a system. You can disable key management by editing KeyBoxConfig.properties file and use KeyBox only as a bastion host. This file is located in the jetty/keybox/WEB-INF/classes directory. (or the src/main/resources directory if building from source) +By default Bastillion will overwrite all values in the specified authorized_keys file for a system. You can disable key management by editing BastillionConfig.properties file and use Bastillion only as a bastion host. This file is located in the jetty/bastillion/WEB-INF/classes directory. (or the src/main/resources directory if building from source) - #set to false to disable key management. If false, the KeyBox public key will be appended to the authorized_keys file (instead of it being overwritten completely). + #set to false to disable key management. If false, the Bastillion public key will be appended to the authorized_keys file (instead of it being overwritten completely). keyManagementEnabled=false -Also, the authorized_keys file is updated/refreshed periodically based on the relationships defined in the application. If key management is enabled the refresh interval can be specified in the KeyBoxConfig.properties file. +Also, the authorized_keys file is updated/refreshed periodically based on the relationships defined in the application. If key management is enabled the refresh interval can be specified in the BastillionConfig.properties file. #authorized_keys refresh interval in minutes (no refresh for <=0) authKeysRefreshInterval=120 -By default KeyBox will generated and distribute the SSH keys managed by administrators while having them download the generated private. This forces admins to use strong passphrases for keys that are set on systems. The private key is only available for download once and is not stored on the application side. To disable and allow administrators to set any public key edit the KeyBoxConfig.properties. +By default Bastillion will generated and distribute the SSH keys managed by administrators while having them download the generated private. This forces admins to use strong passphrases for keys that are set on systems. The private key is only available for download once and is not stored on the application side. To disable and allow administrators to set any public key edit the BastillionConfig.properties. #set to true to generate keys when added/managed by users and enforce strong passphrases set to false to allow users to set their own public key forceUserKeyGeneration=false Supplying a Custom SSH Key Pair ------ -KeyBox generates its own public/private SSH key upon initial startup for use when registering systems. You can specify a custom SSH key pair in the KeyBoxConfig.properties file. +Bastillion generates its own public/private SSH key upon initial startup for use when registering systems. You can specify a custom SSH key pair in the BastillionConfig.properties file. For example: @@ -140,22 +125,22 @@ Adjusting Database Settings Database settings can be adjusted in the configuration properties. #Database user - dbUser=keybox + dbUser=bastillion #Database password dbPassword=p@$$w0rd!! #Database JDBC driver dbDriver=org.h2.Driver #Connection URL to the DB - dbConnectionURL=jdbc:h2:keydb/keybox;CIPHER=AES; + dbConnectionURL=jdbc:h2:keydb/bastillion;CIPHER=AES; By default the datastore is set as embedded, but a remote H2 database can supported through adjusting the connection URL. #Connection URL to the DB - dbConnectionURL=jdbc:h2:tcp://:/~/keybox;CIPHER=AES; + dbConnectionURL=jdbc:h2:tcp://:/~/bastillion;CIPHER=AES; External Authentication ------ -External Authentication can be enabled through the KeyBoxConfig.properties. +External Authentication can be enabled through the BastillionConfig.properties. For example: @@ -166,7 +151,7 @@ Connection details need to be set in the jaas.conf file ldap-ol { com.sun.security.auth.module.LdapLoginModule SUFFICIENT - userProvider="ldap://hostname:389/ou=example,dc=keybox,dc=com" + userProvider="ldap://hostname:389/ou=example,dc=bastillion,dc=com" userFilter="(&(uid={USERNAME})(objectClass=inetOrgPerson))" authzIdentity="{cn}" useSSL=false @@ -176,7 +161,7 @@ Connection details need to be set in the jaas.conf file Administrators will be added as they are authenticated and profiles of systems may be assigned by full-privileged users. -User LDAP roles can be mapped to profiles defined in KeyBox through the use of the org.eclipse.jetty.jaas.spi.LdapLoginModule. +User LDAP roles can be mapped to profiles defined in Bastillion through the use of the org.eclipse.jetty.jaas.spi.LdapLoginModule. ldap-ol-with-roles { //openldap auth with roles that can map to profiles @@ -190,12 +175,12 @@ User LDAP roles can be mapped to profiles defined in KeyBox through the use of t bindPassword="" authenticationMethod="simple" forceBindingLogin="true" - userBaseDn="ou=users,dc=keybox,dc=com" + userBaseDn="ou=users,dc=bastillion,dc=com" userRdnAttribute="uid" userIdAttribute="uid" userPasswordAttribute="userPassword" userObjectClass="inetOrgPerson" - roleBaseDn="ou=groups,dc=keybox,dc=com" + roleBaseDn="ou=groups,dc=bastillion,dc=com" roleNameAttribute="cn" roleMemberAttribute="member" roleObjectClass="groupOfNames"; @@ -205,26 +190,26 @@ Users will be added/removed from defined profiles as they login and when the rol Auditing ------ -Auditing is disabled by default and is only a proof of concept. Can be enabled in the KeyBoxConfig.properties. +Auditing is disabled by default and is only a proof of concept. Can be enabled in the BastillionConfig.properties. #enable audit --set to true to enable enableInternalAudit=true Screenshots ----------- -![Login](https://www.sshkeybox.com/images/screenshots/medium/login.png) +![Login](https://www.bastillion.io/images/screenshots/medium/login.png) -![Two-Factor](https://www.sshkeybox.com/images/screenshots/medium/two-factor.png) +![Two-Factor](https://www.bastillion.io/images/screenshots/medium/two-factor.png) -![More Terminals](https://www.sshkeybox.com/images/screenshots/medium/terminals.png) +![More Terminals](https://www.bastillion.io/images/screenshots/medium/terminals.png) -![Manage Systems](https://www.sshkeybox.com/images/screenshots/medium/manage_systems.png) +![Manage Systems](https://www.bastillion.io/images/screenshots/medium/manage_systems.png) -![Manage Users](https://www.sshkeybox.com/images/screenshots/medium/manage_users.png) +![Manage Users](https://www.bastillion.io/images/screenshots/medium/manage_users.png) -![Define SSH Keys](https://www.sshkeybox.com/images/screenshots/medium/manage_keys.png) +![Define SSH Keys](https://www.bastillion.io/images/screenshots/medium/manage_keys.png) -![Disable SSH Keys](https://www.sshkeybox.com/images/screenshots/medium/disable_keys.png) +![Disable SSH Keys](https://www.bastillion.io/images/screenshots/medium/disable_keys.png) Acknowledgments ------ @@ -237,11 +222,11 @@ Third-party dependencies are mentioned in the [_3rdPartyLicenses.md_](3rdPartyLi Dual License ----------- -KeyBox is available for non-commercial use under the Affero General Public License +Bastillion is available for non-commercial use under the Affero General Public License A commercial license is also available through a subscription -https://www.sshkeybox.com/subscription +https://www.bastillion.io/subscription or when running an AMI from the AWS marketplace. diff --git a/pom.xml b/pom.xml index 40998bfa..2b509b24 100755 --- a/pom.xml +++ b/pom.xml @@ -2,11 +2,11 @@ 4.0.0 - com.keybox - keybox - 3.03.00-SNAPSHOT + io.bastillion + bastillion + 3.05.00 war - KeyBox + Bastillion UTF-8 1.9 diff --git a/src/main/java/com/keybox/common/db/DBInitServlet.java b/src/main/java/io/bastillion/common/db/DBInitServlet.java old mode 100755 new mode 100644 similarity index 94% rename from src/main/java/com/keybox/common/db/DBInitServlet.java rename to src/main/java/io/bastillion/common/db/DBInitServlet.java index 9692fd79..20a88513 --- a/src/main/java/com/keybox/common/db/DBInitServlet.java +++ b/src/main/java/io/bastillion/common/db/DBInitServlet.java @@ -25,14 +25,14 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.common.db; +package io.bastillion.common.db; -import com.keybox.common.util.AppConfig; -import com.keybox.manage.model.Auth; -import com.keybox.manage.util.DBUtils; -import com.keybox.manage.util.EncryptionUtil; -import com.keybox.manage.util.RefreshAuthKeyUtil; -import com.keybox.manage.util.SSHUtil; +import io.bastillion.common.util.AppConfig; +import io.bastillion.manage.model.Auth; +import io.bastillion.manage.util.DBUtils; +import io.bastillion.manage.util.EncryptionUtil; +import io.bastillion.manage.util.RefreshAuthKeyUtil; +import io.bastillion.manage.util.SSHUtil; import javax.servlet.ServletConfig; import javax.servlet.ServletException; @@ -136,11 +136,12 @@ public void init(ServletConfig config) throws ServletException { statement.executeUpdate("create table if not exists session_log (id BIGINT PRIMARY KEY AUTO_INCREMENT, session_tm timestamp default CURRENT_TIMESTAMP, first_nm varchar, last_nm varchar, username varchar not null, ip_address varchar)"); statement.executeUpdate("create table if not exists terminal_log (session_id BIGINT, instance_id INTEGER, output varchar not null, log_tm timestamp default CURRENT_TIMESTAMP, display_nm varchar not null, user varchar not null, host varchar not null, port INTEGER not null, foreign key (session_id) references session_log(id) on delete cascade)"); + statement.executeUpdate("create table if not exists license (id INTEGER PRIMARY KEY AUTO_INCREMENT, license_tx varchar not null)"); //if exists readfile to set default password String salt = EncryptionUtil.generateSalt(); String defaultPassword = EncryptionUtil.hash("changeme" + salt); - File file = new File("/opt/keybox/instance_id"); + File file = new File("/opt/bastillion/instance_id"); if (file.exists()) { String str = FileUtils.readFileToString(file, "UTF-8"); if(StringUtils.isNotEmpty(str)) { @@ -168,7 +169,7 @@ public void init(ServletConfig config) throws ServletException { DBUtils.closeStmt(pStmt); //generate new key and insert passphrase - System.out.println("Setting KeyBox SSH public/private key pair"); + System.out.println("Setting Bastillion SSH public/private key pair"); //generate application pub/pvt key and get values String passphrase = SSHUtil.keyGen(); @@ -183,7 +184,7 @@ public void init(ServletConfig config) throws ServletException { pStmt.execute(); DBUtils.closeStmt(pStmt); - System.out.println("KeyBox Generated Global Public Key:"); + System.out.println("Bastillion Generated Global Public Key:"); System.out.println(publicKey); //set config to default diff --git a/src/main/java/com/keybox/common/filter/AuthFilter.java b/src/main/java/io/bastillion/common/filter/AuthFilter.java old mode 100755 new mode 100644 similarity index 96% rename from src/main/java/com/keybox/common/filter/AuthFilter.java rename to src/main/java/io/bastillion/common/filter/AuthFilter.java index 16843a66..8f021090 --- a/src/main/java/com/keybox/common/filter/AuthFilter.java +++ b/src/main/java/io/bastillion/common/filter/AuthFilter.java @@ -25,11 +25,11 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.common.filter; +package io.bastillion.common.filter; -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.db.AuthDB; -import com.keybox.manage.model.Auth; +import io.bastillion.common.util.AuthUtil; +import io.bastillion.manage.db.AuthDB; +import io.bastillion.manage.model.Auth; import javax.servlet.*; import javax.servlet.http.HttpServletRequest; @@ -37,6 +37,7 @@ import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/keybox/common/util/AppConfig.java b/src/main/java/io/bastillion/common/util/AppConfig.java old mode 100755 new mode 100644 similarity index 93% rename from src/main/java/com/keybox/common/util/AppConfig.java rename to src/main/java/io/bastillion/common/util/AppConfig.java index 120d801b..60d1dfbf --- a/src/main/java/com/keybox/common/util/AppConfig.java +++ b/src/main/java/io/bastillion/common/util/AppConfig.java @@ -25,9 +25,9 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.common.util; +package io.bastillion.common.util; -import com.keybox.manage.util.EncryptionUtil; +import io.bastillion.manage.util.EncryptionUtil; import org.apache.commons.configuration.PropertiesConfiguration; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; @@ -51,18 +51,18 @@ public class AppConfig { try { //move configuration to specified dir if (StringUtils.isNotEmpty(System.getProperty("CONFIG_DIR"))) { - File configFile = new File(CONFIG_DIR + "/KeyBoxConfig.properties"); + File configFile = new File(CONFIG_DIR + "BastillionConfig.properties"); if (!configFile.exists()) { - File oldConfig = new File(AppConfig.class.getClassLoader().getResource(".").getPath() + "/KeyBoxConfig.properties"); + File oldConfig = new File(AppConfig.class.getClassLoader().getResource(".").getPath() + "BastillionConfig.properties"); FileUtils.moveFile(oldConfig, configFile); } - configFile = new File(CONFIG_DIR + "/jaas.conf"); + configFile = new File(CONFIG_DIR + "jaas.conf"); if (!configFile.exists()) { - File oldConfig = new File(AppConfig.class.getClassLoader().getResource(".").getPath() + "/jaas.conf"); + File oldConfig = new File(AppConfig.class.getClassLoader().getResource(".").getPath() + "jaas.conf"); FileUtils.moveFile(oldConfig, configFile); } } - prop = new PropertiesConfiguration(CONFIG_DIR + "/KeyBoxConfig.properties"); + prop = new PropertiesConfiguration(CONFIG_DIR + "BastillionConfig.properties"); } catch (Exception ex) { log.error(ex.toString(), ex); } diff --git a/src/main/java/com/keybox/common/util/AuthUtil.java b/src/main/java/io/bastillion/common/util/AuthUtil.java similarity index 99% rename from src/main/java/com/keybox/common/util/AuthUtil.java rename to src/main/java/io/bastillion/common/util/AuthUtil.java index 0be03955..995c5426 100644 --- a/src/main/java/com/keybox/common/util/AuthUtil.java +++ b/src/main/java/io/bastillion/common/util/AuthUtil.java @@ -25,9 +25,9 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.common.util; +package io.bastillion.common.util; -import com.keybox.manage.util.EncryptionUtil; +import io.bastillion.manage.util.EncryptionUtil; import org.apache.commons.lang3.StringUtils; import javax.servlet.http.HttpServletRequest; diff --git a/src/main/java/com/keybox/manage/control/AuthKeysKtrl.java b/src/main/java/io/bastillion/manage/control/AuthKeysKtrl.java similarity index 96% rename from src/main/java/com/keybox/manage/control/AuthKeysKtrl.java rename to src/main/java/io/bastillion/manage/control/AuthKeysKtrl.java index d42ca995..c53e1def 100644 --- a/src/main/java/com/keybox/manage/control/AuthKeysKtrl.java +++ b/src/main/java/io/bastillion/manage/control/AuthKeysKtrl.java @@ -25,24 +25,25 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; +package io.bastillion.manage.control; import com.jcraft.jsch.JSch; import com.jcraft.jsch.KeyPair; -import com.keybox.common.util.AppConfig; -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.db.*; -import com.keybox.manage.model.*; -import com.keybox.manage.util.EncryptionUtil; -import com.keybox.manage.util.PasswordUtil; -import com.keybox.manage.util.RefreshAuthKeyUtil; -import com.keybox.manage.util.SSHUtil; +import io.bastillion.common.util.AppConfig; +import io.bastillion.common.util.AuthUtil; +import io.bastillion.manage.db.*; +import io.bastillion.manage.model.*; +import io.bastillion.manage.util.EncryptionUtil; +import io.bastillion.manage.util.PasswordUtil; +import io.bastillion.manage.util.RefreshAuthKeyUtil; +import io.bastillion.manage.util.SSHUtil; +import io.bastillion.manage.db.*; +import io.bastillion.manage.model.*; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; import loophole.mvc.annotation.Validate; import loophole.mvc.base.BaseKontroller; -import loophole.mvc.filter.SecurityFilter; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/keybox/manage/control/LoginKtrl.java b/src/main/java/io/bastillion/manage/control/LoginKtrl.java similarity index 92% rename from src/main/java/com/keybox/manage/control/LoginKtrl.java rename to src/main/java/io/bastillion/manage/control/LoginKtrl.java index 9445c9d1..3502ce4c 100644 --- a/src/main/java/com/keybox/manage/control/LoginKtrl.java +++ b/src/main/java/io/bastillion/manage/control/LoginKtrl.java @@ -25,14 +25,14 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; - -import com.keybox.common.util.AppConfig; -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.db.AuthDB; -import com.keybox.manage.model.Auth; -import com.keybox.manage.model.User; -import com.keybox.manage.util.OTPUtil; +package io.bastillion.manage.control; + +import io.bastillion.common.util.AppConfig; +import io.bastillion.common.util.AuthUtil; +import io.bastillion.manage.db.AuthDB; +import io.bastillion.manage.model.Auth; +import io.bastillion.manage.model.User; +import io.bastillion.manage.util.OTPUtil; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; @@ -50,7 +50,7 @@ public class LoginKtrl extends BaseKontroller { //check if otp is enabled @Model(name = "otpEnabled") static final Boolean otpEnabled = ("required".equals(AppConfig.getProperty("oneTimePassword")) || "optional".equals(AppConfig.getProperty("oneTimePassword"))); - private static Logger loginAuditLogger = LoggerFactory.getLogger("com.keybox.manage.control.LoginAudit"); + private static Logger loginAuditLogger = LoggerFactory.getLogger("io.bastillion.manage.control.LoginAudit"); private final String AUTH_ERROR = "Authentication Failed : Login credentials are invalid"; private final String AUTH_ERROR_NO_PROFILE = "Authentication Failed : There are no profiles assigned to this account"; @Model(name = "auth") diff --git a/src/main/java/com/keybox/manage/control/OTPKtrl.java b/src/main/java/io/bastillion/manage/control/OTPKtrl.java similarity index 89% rename from src/main/java/com/keybox/manage/control/OTPKtrl.java rename to src/main/java/io/bastillion/manage/control/OTPKtrl.java index d08b8f46..1c72faea 100644 --- a/src/main/java/com/keybox/manage/control/OTPKtrl.java +++ b/src/main/java/io/bastillion/manage/control/OTPKtrl.java @@ -25,17 +25,17 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; +package io.bastillion.manage.control; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.QRCodeWriter; -import com.keybox.common.util.AppConfig; -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.db.AuthDB; -import com.keybox.manage.db.UserDB; -import com.keybox.manage.util.OTPUtil; +import io.bastillion.common.util.AppConfig; +import io.bastillion.common.util.AuthUtil; +import io.bastillion.manage.db.AuthDB; +import io.bastillion.manage.db.UserDB; +import io.bastillion.manage.util.OTPUtil; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; @@ -106,7 +106,7 @@ public String qrImage() { try { - String qrCodeText = "otpauth://totp/KeyBox%20%28" + URLEncoder.encode(getRequest().getHeader("host").replaceAll("\\:.*$", ""), "utf-8") + "%29:" + username + "?secret=" + secret; + String qrCodeText = "otpauth://totp/Bastillion%20%28" + URLEncoder.encode(getRequest().getHeader("host").replaceAll("\\:.*$", ""), "utf-8") + "%29:" + username + "?secret=" + secret; QRCodeWriter qrWriter = new QRCodeWriter(); diff --git a/src/main/java/com/keybox/manage/control/ProfileKtrl.java b/src/main/java/io/bastillion/manage/control/ProfileKtrl.java similarity index 93% rename from src/main/java/com/keybox/manage/control/ProfileKtrl.java rename to src/main/java/io/bastillion/manage/control/ProfileKtrl.java index 947fb6c4..d3609070 100644 --- a/src/main/java/com/keybox/manage/control/ProfileKtrl.java +++ b/src/main/java/io/bastillion/manage/control/ProfileKtrl.java @@ -25,11 +25,11 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; +package io.bastillion.manage.control; -import com.keybox.manage.db.ProfileDB; -import com.keybox.manage.model.Profile; -import com.keybox.manage.model.SortedSet; +import io.bastillion.manage.db.ProfileDB; +import io.bastillion.manage.model.Profile; +import io.bastillion.manage.model.SortedSet; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; diff --git a/src/main/java/com/keybox/manage/control/ProfileSystemsKtrl.java b/src/main/java/io/bastillion/manage/control/ProfileSystemsKtrl.java similarity index 90% rename from src/main/java/com/keybox/manage/control/ProfileSystemsKtrl.java rename to src/main/java/io/bastillion/manage/control/ProfileSystemsKtrl.java index 7ed73ef8..196104b3 100644 --- a/src/main/java/com/keybox/manage/control/ProfileSystemsKtrl.java +++ b/src/main/java/io/bastillion/manage/control/ProfileSystemsKtrl.java @@ -25,14 +25,14 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; +package io.bastillion.manage.control; -import com.keybox.manage.db.ProfileDB; -import com.keybox.manage.db.ProfileSystemsDB; -import com.keybox.manage.db.SystemDB; -import com.keybox.manage.model.Profile; -import com.keybox.manage.model.SortedSet; -import com.keybox.manage.util.RefreshAuthKeyUtil; +import io.bastillion.manage.db.ProfileDB; +import io.bastillion.manage.db.ProfileSystemsDB; +import io.bastillion.manage.db.SystemDB; +import io.bastillion.manage.model.Profile; +import io.bastillion.manage.model.SortedSet; +import io.bastillion.manage.util.RefreshAuthKeyUtil; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; diff --git a/src/main/java/com/keybox/manage/control/ProfileUsersKtrl.java b/src/main/java/io/bastillion/manage/control/ProfileUsersKtrl.java similarity index 90% rename from src/main/java/com/keybox/manage/control/ProfileUsersKtrl.java rename to src/main/java/io/bastillion/manage/control/ProfileUsersKtrl.java index ea2b9792..e434777e 100644 --- a/src/main/java/com/keybox/manage/control/ProfileUsersKtrl.java +++ b/src/main/java/io/bastillion/manage/control/ProfileUsersKtrl.java @@ -25,14 +25,14 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; +package io.bastillion.manage.control; -import com.keybox.manage.db.ProfileDB; -import com.keybox.manage.db.UserDB; -import com.keybox.manage.db.UserProfileDB; -import com.keybox.manage.model.Profile; -import com.keybox.manage.model.SortedSet; -import com.keybox.manage.util.RefreshAuthKeyUtil; +import io.bastillion.manage.db.ProfileDB; +import io.bastillion.manage.db.UserDB; +import io.bastillion.manage.db.UserProfileDB; +import io.bastillion.manage.model.Profile; +import io.bastillion.manage.model.SortedSet; +import io.bastillion.manage.util.RefreshAuthKeyUtil; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; diff --git a/src/main/java/com/keybox/manage/control/ScriptKtrl.java b/src/main/java/io/bastillion/manage/control/ScriptKtrl.java similarity index 95% rename from src/main/java/com/keybox/manage/control/ScriptKtrl.java rename to src/main/java/io/bastillion/manage/control/ScriptKtrl.java index 65753d42..5d905ad7 100644 --- a/src/main/java/com/keybox/manage/control/ScriptKtrl.java +++ b/src/main/java/io/bastillion/manage/control/ScriptKtrl.java @@ -25,12 +25,12 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; +package io.bastillion.manage.control; -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.db.ScriptDB; -import com.keybox.manage.model.Script; -import com.keybox.manage.model.SortedSet; +import io.bastillion.common.util.AuthUtil; +import io.bastillion.manage.db.ScriptDB; +import io.bastillion.manage.model.Script; +import io.bastillion.manage.model.SortedSet; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; diff --git a/src/main/java/com/keybox/manage/control/SecureShellKtrl.java b/src/main/java/io/bastillion/manage/control/SecureShellKtrl.java similarity index 97% rename from src/main/java/com/keybox/manage/control/SecureShellKtrl.java rename to src/main/java/io/bastillion/manage/control/SecureShellKtrl.java index 5d387ce7..b9a79b58 100644 --- a/src/main/java/com/keybox/manage/control/SecureShellKtrl.java +++ b/src/main/java/io/bastillion/manage/control/SecureShellKtrl.java @@ -25,18 +25,19 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; +package io.bastillion.manage.control; import com.jcraft.jsch.ChannelShell; -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.db.*; -import com.keybox.manage.model.*; -import com.keybox.manage.util.SSHUtil; +import io.bastillion.common.util.AuthUtil; +import io.bastillion.manage.db.*; +import io.bastillion.manage.model.*; +import io.bastillion.manage.db.*; +import io.bastillion.manage.model.*; +import io.bastillion.manage.util.SSHUtil; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; import loophole.mvc.base.BaseKontroller; -import loophole.mvc.filter.SecurityFilter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/keybox/manage/control/SessionAuditKtrl.java b/src/main/java/io/bastillion/manage/control/SessionAuditKtrl.java similarity index 91% rename from src/main/java/com/keybox/manage/control/SessionAuditKtrl.java rename to src/main/java/io/bastillion/manage/control/SessionAuditKtrl.java index f28f6190..ee305f7d 100644 --- a/src/main/java/com/keybox/manage/control/SessionAuditKtrl.java +++ b/src/main/java/io/bastillion/manage/control/SessionAuditKtrl.java @@ -25,16 +25,16 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; +package io.bastillion.manage.control; import com.google.gson.Gson; -import com.keybox.manage.db.SessionAuditDB; -import com.keybox.manage.db.SystemDB; -import com.keybox.manage.db.UserDB; -import com.keybox.manage.model.HostSystem; -import com.keybox.manage.model.SessionAudit; -import com.keybox.manage.model.SortedSet; -import com.keybox.manage.model.User; +import io.bastillion.manage.db.SessionAuditDB; +import io.bastillion.manage.db.SystemDB; +import io.bastillion.manage.db.UserDB; +import io.bastillion.manage.model.HostSystem; +import io.bastillion.manage.model.SessionAudit; +import io.bastillion.manage.model.SortedSet; +import io.bastillion.manage.model.User; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; diff --git a/src/main/java/com/keybox/manage/control/SystemKtrl.java b/src/main/java/io/bastillion/manage/control/SystemKtrl.java similarity index 59% rename from src/main/java/com/keybox/manage/control/SystemKtrl.java rename to src/main/java/io/bastillion/manage/control/SystemKtrl.java index 2eaaf702..01368dc5 100644 --- a/src/main/java/com/keybox/manage/control/SystemKtrl.java +++ b/src/main/java/io/bastillion/manage/control/SystemKtrl.java @@ -1,39 +1,41 @@ /** - * Copyright (C) 2013 Loophole, LLC - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the GNU Affero General Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. + * Copyright (C) 2013 Loophole, LLC + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + *

+ * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the GNU Affero General Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. */ -package com.keybox.manage.control; - -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.db.ProfileDB; -import com.keybox.manage.db.ScriptDB; -import com.keybox.manage.db.SystemDB; -import com.keybox.manage.db.UserProfileDB; -import com.keybox.manage.model.*; -import com.keybox.manage.util.SSHUtil; +package io.bastillion.manage.control; + +import io.bastillion.common.util.AuthUtil; +import io.bastillion.manage.db.ProfileDB; +import io.bastillion.manage.db.ScriptDB; +import io.bastillion.manage.db.SystemDB; +import io.bastillion.manage.db.UserProfileDB; +import io.bastillion.manage.model.*; +import io.bastillion.manage.model.*; +import io.bastillion.manage.util.LicenseUtil; +import io.bastillion.manage.util.SSHUtil; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; @@ -62,7 +64,7 @@ public class SystemKtrl extends BaseKontroller { @Model(name = "passphrase") String passphrase; @Model(name = "profileList") - List profileList= new ArrayList<>(); + List profileList = new ArrayList<>(); public SystemKtrl(HttpServletRequest request, HttpServletResponse response) { super(request, response); @@ -74,10 +76,10 @@ public String viewAdminSystems() { if (Auth.MANAGER.equals(AuthUtil.getUserType(getRequest().getSession()))) { sortedSet = SystemDB.getSystemSet(sortedSet); - profileList=ProfileDB.getAllProfiles(); + profileList = ProfileDB.getAllProfiles(); } else { sortedSet = SystemDB.getUserSystemSet(sortedSet, userId); - profileList= UserProfileDB.getProfilesByUser(userId); + profileList = UserProfileDB.getProfilesByUser(userId); } if (script != null && script.getId() != null) { script = ScriptDB.getScript(script.getId(), userId); @@ -89,26 +91,29 @@ public String viewAdminSystems() { @Kontrol(path = "/manage/viewSystems", method = MethodType.GET) public String viewManageSystems() { sortedSet = SystemDB.getSystemSet(sortedSet); - profileList=ProfileDB.getAllProfiles(); - return "/manage/view_systems.html"; } @Kontrol(path = "/manage/saveSystem", method = MethodType.POST) public String saveSystem() { - String retVal="redirect:/manage/viewSystems.ktrl?sortedSet.orderByDirection=" + sortedSet.getOrderByDirection() + "&sortedSet.orderByField=" + sortedSet.getOrderByField(); + String retVal = "redirect:/manage/viewSystems.ktrl?sortedSet.orderByDirection=" + sortedSet.getOrderByDirection() + "&sortedSet.orderByField=" + sortedSet.getOrderByField(); hostSystem = SSHUtil.authAndAddPubKey(hostSystem, passphrase, password); if (hostSystem.getId() != null) { SystemDB.updateSystem(hostSystem); } else { - hostSystem.setId(SystemDB.insertSystem(hostSystem)); + if (LicenseUtil.isValid() || SystemDB.getSystemSet(sortedSet).getItemList().size() < 12) { + hostSystem.setId(SystemDB.insertSystem(hostSystem)); + } else { + addError("Systems can no longer be added without a valid license"); + retVal = "/manage/view_systems.html"; + } } sortedSet = SystemDB.getSystemSet(sortedSet); if (!HostSystem.SUCCESS_STATUS.equals(hostSystem.getStatusCd())) { - retVal="/manage/view_systems.html"; + retVal = "/manage/view_systems.html"; } return retVal; } diff --git a/src/main/java/com/keybox/manage/control/UploadAndPushKtrl.java b/src/main/java/io/bastillion/manage/control/UploadAndPushKtrl.java similarity index 96% rename from src/main/java/com/keybox/manage/control/UploadAndPushKtrl.java rename to src/main/java/io/bastillion/manage/control/UploadAndPushKtrl.java index 0e476e38..bc41ed75 100644 --- a/src/main/java/com/keybox/manage/control/UploadAndPushKtrl.java +++ b/src/main/java/io/bastillion/manage/control/UploadAndPushKtrl.java @@ -25,18 +25,17 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; - -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.db.SystemStatusDB; -import com.keybox.manage.model.HostSystem; -import com.keybox.manage.model.SchSession; -import com.keybox.manage.util.DBUtils; -import com.keybox.manage.util.SSHUtil; +package io.bastillion.manage.control; + +import io.bastillion.common.util.AuthUtil; +import io.bastillion.manage.db.SystemStatusDB; +import io.bastillion.manage.model.HostSystem; +import io.bastillion.manage.model.SchSession; +import io.bastillion.manage.util.DBUtils; +import io.bastillion.manage.util.SSHUtil; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; -import loophole.mvc.annotation.Validate; import loophole.mvc.base.BaseKontroller; import loophole.mvc.filter.SecurityFilter; import org.apache.commons.fileupload.FileItem; diff --git a/src/main/java/com/keybox/manage/control/UserSettingsKtrl.java b/src/main/java/io/bastillion/manage/control/UserSettingsKtrl.java similarity index 78% rename from src/main/java/com/keybox/manage/control/UserSettingsKtrl.java rename to src/main/java/io/bastillion/manage/control/UserSettingsKtrl.java index e950816c..905b8ccc 100644 --- a/src/main/java/com/keybox/manage/control/UserSettingsKtrl.java +++ b/src/main/java/io/bastillion/manage/control/UserSettingsKtrl.java @@ -25,20 +25,23 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; - -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.db.AuthDB; -import com.keybox.manage.db.PrivateKeyDB; -import com.keybox.manage.db.UserThemeDB; -import com.keybox.manage.model.Auth; -import com.keybox.manage.model.UserSettings; -import com.keybox.manage.util.PasswordUtil; +package io.bastillion.manage.control; + +import io.bastillion.common.util.AuthUtil; +import io.bastillion.manage.db.AuthDB; +import io.bastillion.manage.db.LicenseDB; +import io.bastillion.manage.db.PrivateKeyDB; +import io.bastillion.manage.db.UserThemeDB; +import io.bastillion.manage.model.Auth; +import io.bastillion.manage.model.UserSettings; +import io.bastillion.manage.util.LicenseUtil; +import io.bastillion.manage.util.PasswordUtil; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; import loophole.mvc.annotation.Validate; import loophole.mvc.base.BaseKontroller; +import org.apache.commons.lang3.StringUtils; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -73,6 +76,10 @@ public class UserSettingsKtrl extends BaseKontroller { Auth auth; @Model(name = "userSettings") UserSettings userSettings; + @Model(name = "license") + String license; + @Model(name ="expirationDt") + String expirationDt; @@ -83,6 +90,11 @@ public UserSettingsKtrl(HttpServletRequest request, HttpServletResponse response @Kontrol(path = "/admin/userSettings", method = MethodType.GET) public String userSettings() { userSettings = UserThemeDB.getTheme(AuthUtil.getUserId(getRequest().getSession())); + license = LicenseDB.getLicense(); + expirationDt = LicenseUtil.getExpirationDt(license); + if(StringUtils.isNotEmpty(license) && !LicenseUtil.isValid(license)) { + addError("License is invalid or has expired"); + } return "/admin/user_settings.html"; } @@ -118,6 +130,17 @@ public String themeSubmit() { return "redirect:/admin/menu.html"; } + @Kontrol(path = "/admin/licenseSubmit", method = MethodType.POST) + public String licenseSubmit() { + String retVal = "/admin/user_settings.html"; + if(LicenseUtil.isValid(license)) { + LicenseDB.saveLicense(license); + retVal = "redirect:/admin/menu.html"; + } else { + addError("License is invalid or has expired"); + } + return retVal; + } /** * Validates fields for password submit */ diff --git a/src/main/java/com/keybox/manage/control/UsersKtrl.java b/src/main/java/io/bastillion/manage/control/UsersKtrl.java similarity index 81% rename from src/main/java/com/keybox/manage/control/UsersKtrl.java rename to src/main/java/io/bastillion/manage/control/UsersKtrl.java index ea6938e7..cbeee1ea 100644 --- a/src/main/java/com/keybox/manage/control/UsersKtrl.java +++ b/src/main/java/io/bastillion/manage/control/UsersKtrl.java @@ -25,16 +25,17 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.control; - -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.db.PublicKeyDB; -import com.keybox.manage.db.UserDB; -import com.keybox.manage.model.Auth; -import com.keybox.manage.model.SortedSet; -import com.keybox.manage.model.User; -import com.keybox.manage.util.PasswordUtil; -import com.keybox.manage.util.RefreshAuthKeyUtil; +package io.bastillion.manage.control; + +import io.bastillion.common.util.AuthUtil; +import io.bastillion.manage.db.PublicKeyDB; +import io.bastillion.manage.db.UserDB; +import io.bastillion.manage.model.Auth; +import io.bastillion.manage.model.SortedSet; +import io.bastillion.manage.model.User; +import io.bastillion.manage.util.LicenseUtil; +import io.bastillion.manage.util.PasswordUtil; +import io.bastillion.manage.util.RefreshAuthKeyUtil; import loophole.mvc.annotation.Kontrol; import loophole.mvc.annotation.MethodType; import loophole.mvc.annotation.Model; @@ -73,6 +74,7 @@ public String viewUsers() { @Kontrol(path = "/manage/saveUser", method = MethodType.POST) public String saveUser() { + String retVal = "redirect:/manage/viewUsers.ktrl?sortedSet.orderByDirection=" + sortedSet.getOrderByDirection() + "&sortedSet.orderByField=" + sortedSet.getOrderByField(); if (user.getId() != null) { if (user.getPassword() == null || user.getPassword().trim().equals("")) { @@ -85,11 +87,19 @@ public String saveUser() { UserDB.resetSharedSecret(user.getId()); } } else { - UserDB.insertUser(user); - } - return "redirect:/manage/viewUsers.ktrl?sortedSet.orderByDirection=" + sortedSet.getOrderByDirection() + "&sortedSet.orderByField=" + sortedSet.getOrderByField(); + if(LicenseUtil.isValid() || UserDB.getUserSet(sortedSet).getItemList().size() < 6) { + UserDB.insertUser(user); + } else { + addError("Users can no longer be added without a valid license"); + userId = AuthUtil.getUserId(getRequest().getSession()); + sortedSet = UserDB.getUserSet(sortedSet); + + retVal="/manage/view_users.html"; + } + } + return retVal; } @Kontrol(path = "/manage/deleteUser", method = MethodType.GET) diff --git a/src/main/java/com/keybox/manage/db/AuthDB.java b/src/main/java/io/bastillion/manage/db/AuthDB.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/db/AuthDB.java rename to src/main/java/io/bastillion/manage/db/AuthDB.java index 5ce13a4d..a4c23fd9 --- a/src/main/java/com/keybox/manage/db/AuthDB.java +++ b/src/main/java/io/bastillion/manage/db/AuthDB.java @@ -25,13 +25,13 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.manage.model.Auth; -import com.keybox.manage.model.User; -import com.keybox.manage.util.DBUtils; -import com.keybox.manage.util.EncryptionUtil; -import com.keybox.manage.util.ExternalAuthUtil; +import io.bastillion.manage.model.Auth; +import io.bastillion.manage.model.User; +import io.bastillion.manage.util.DBUtils; +import io.bastillion.manage.util.EncryptionUtil; +import io.bastillion.manage.util.ExternalAuthUtil; import org.apache.commons.lang3.StringUtils; import java.sql.Connection; diff --git a/src/main/java/com/keybox/manage/db/PrivateKeyDB.java b/src/main/java/io/bastillion/manage/db/PrivateKeyDB.java old mode 100755 new mode 100644 similarity index 94% rename from src/main/java/com/keybox/manage/db/PrivateKeyDB.java rename to src/main/java/io/bastillion/manage/db/PrivateKeyDB.java index 2600143e..0baca141 --- a/src/main/java/com/keybox/manage/db/PrivateKeyDB.java +++ b/src/main/java/io/bastillion/manage/db/PrivateKeyDB.java @@ -25,15 +25,16 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.manage.model.ApplicationKey; -import com.keybox.manage.util.DBUtils; -import com.keybox.manage.util.EncryptionUtil; +import io.bastillion.manage.model.ApplicationKey; +import io.bastillion.manage.util.DBUtils; +import io.bastillion.manage.util.EncryptionUtil; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/keybox/manage/db/ProfileDB.java b/src/main/java/io/bastillion/manage/db/ProfileDB.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/db/ProfileDB.java rename to src/main/java/io/bastillion/manage/db/ProfileDB.java index edcbb7dd..48456a6e --- a/src/main/java/com/keybox/manage/db/ProfileDB.java +++ b/src/main/java/io/bastillion/manage/db/ProfileDB.java @@ -25,11 +25,11 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.manage.model.Profile; -import com.keybox.manage.model.SortedSet; -import com.keybox.manage.util.DBUtils; +import io.bastillion.manage.model.Profile; +import io.bastillion.manage.model.SortedSet; +import io.bastillion.manage.util.DBUtils; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/src/main/java/com/keybox/manage/db/ProfileSystemsDB.java b/src/main/java/io/bastillion/manage/db/ProfileSystemsDB.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/db/ProfileSystemsDB.java rename to src/main/java/io/bastillion/manage/db/ProfileSystemsDB.java index d2a906bd..27a3f80e --- a/src/main/java/com/keybox/manage/db/ProfileSystemsDB.java +++ b/src/main/java/io/bastillion/manage/db/ProfileSystemsDB.java @@ -25,16 +25,17 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.manage.model.HostSystem; -import com.keybox.manage.util.DBUtils; +import io.bastillion.manage.model.HostSystem; +import io.bastillion.manage.util.DBUtils; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/keybox/manage/db/PublicKeyDB.java b/src/main/java/io/bastillion/manage/db/PublicKeyDB.java similarity index 99% rename from src/main/java/com/keybox/manage/db/PublicKeyDB.java rename to src/main/java/io/bastillion/manage/db/PublicKeyDB.java index f710c248..f4916309 100644 --- a/src/main/java/com/keybox/manage/db/PublicKeyDB.java +++ b/src/main/java/io/bastillion/manage/db/PublicKeyDB.java @@ -25,12 +25,12 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.manage.model.PublicKey; -import com.keybox.manage.model.SortedSet; -import com.keybox.manage.util.DBUtils; -import com.keybox.manage.util.SSHUtil; +import io.bastillion.manage.model.PublicKey; +import io.bastillion.manage.model.SortedSet; +import io.bastillion.manage.util.DBUtils; +import io.bastillion.manage.util.SSHUtil; import org.apache.commons.lang3.StringUtils; import java.sql.Connection; diff --git a/src/main/java/com/keybox/manage/db/ScriptDB.java b/src/main/java/io/bastillion/manage/db/ScriptDB.java old mode 100755 new mode 100644 similarity index 97% rename from src/main/java/com/keybox/manage/db/ScriptDB.java rename to src/main/java/io/bastillion/manage/db/ScriptDB.java index 3f3e4791..ece1ddea --- a/src/main/java/com/keybox/manage/db/ScriptDB.java +++ b/src/main/java/io/bastillion/manage/db/ScriptDB.java @@ -25,17 +25,18 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.manage.model.Script; -import com.keybox.manage.model.SortedSet; -import com.keybox.manage.util.DBUtils; +import io.bastillion.manage.model.Script; +import io.bastillion.manage.model.SortedSet; +import io.bastillion.manage.util.DBUtils; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/keybox/manage/db/SessionAuditDB.java b/src/main/java/io/bastillion/manage/db/SessionAuditDB.java similarity index 98% rename from src/main/java/com/keybox/manage/db/SessionAuditDB.java rename to src/main/java/io/bastillion/manage/db/SessionAuditDB.java index 5bcd02dc..03d5ef5c 100644 --- a/src/main/java/com/keybox/manage/db/SessionAuditDB.java +++ b/src/main/java/io/bastillion/manage/db/SessionAuditDB.java @@ -25,12 +25,13 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.common.util.AppConfig; -import com.keybox.manage.model.*; -import com.keybox.manage.util.DBUtils; +import io.bastillion.common.util.AppConfig; +import io.bastillion.manage.model.*; +import io.bastillion.manage.util.DBUtils; +import io.bastillion.manage.model.*; import org.apache.commons.lang3.StringUtils; import java.sql.Connection; diff --git a/src/main/java/com/keybox/manage/db/SystemDB.java b/src/main/java/io/bastillion/manage/db/SystemDB.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/db/SystemDB.java rename to src/main/java/io/bastillion/manage/db/SystemDB.java index ddce9071..67794559 --- a/src/main/java/com/keybox/manage/db/SystemDB.java +++ b/src/main/java/io/bastillion/manage/db/SystemDB.java @@ -25,11 +25,11 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.manage.model.HostSystem; -import com.keybox.manage.model.SortedSet; -import com.keybox.manage.util.DBUtils; +import io.bastillion.manage.model.HostSystem; +import io.bastillion.manage.model.SortedSet; +import io.bastillion.manage.util.DBUtils; import org.apache.commons.lang3.StringUtils; import java.sql.Connection; diff --git a/src/main/java/com/keybox/manage/db/SystemStatusDB.java b/src/main/java/io/bastillion/manage/db/SystemStatusDB.java old mode 100755 new mode 100644 similarity index 97% rename from src/main/java/com/keybox/manage/db/SystemStatusDB.java rename to src/main/java/io/bastillion/manage/db/SystemStatusDB.java index 2c90a491..c74634a8 --- a/src/main/java/com/keybox/manage/db/SystemStatusDB.java +++ b/src/main/java/io/bastillion/manage/db/SystemStatusDB.java @@ -25,14 +25,12 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.model.Auth; -import com.keybox.manage.model.HostSystem; -import com.keybox.manage.model.SortedSet; -import com.keybox.manage.util.DBUtils; -import org.apache.commons.lang3.StringUtils; +import io.bastillion.manage.model.Auth; +import io.bastillion.manage.model.HostSystem; +import io.bastillion.manage.model.SortedSet; +import io.bastillion.manage.util.DBUtils; import java.sql.Connection; @@ -40,6 +38,7 @@ import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/keybox/manage/db/UserDB.java b/src/main/java/io/bastillion/manage/db/UserDB.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/db/UserDB.java rename to src/main/java/io/bastillion/manage/db/UserDB.java index e848a14e..6be8fd4b --- a/src/main/java/com/keybox/manage/db/UserDB.java +++ b/src/main/java/io/bastillion/manage/db/UserDB.java @@ -25,12 +25,12 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.manage.model.SortedSet; -import com.keybox.manage.model.User; -import com.keybox.manage.util.DBUtils; -import com.keybox.manage.util.EncryptionUtil; +import io.bastillion.manage.model.SortedSet; +import io.bastillion.manage.model.User; +import io.bastillion.manage.util.DBUtils; +import io.bastillion.manage.util.EncryptionUtil; import org.apache.commons.lang3.StringUtils; import java.sql.Connection; @@ -268,7 +268,7 @@ public static Long insertUser(Connection con, User user) { stmt.setString(5, user.getAuthType()); stmt.setString(6, user.getUserType()); if(StringUtils.isNotEmpty(user.getPassword())) { - String salt=EncryptionUtil.generateSalt(); + String salt= EncryptionUtil.generateSalt(); stmt.setString(7, EncryptionUtil.hash(user.getPassword() + salt)); stmt.setString(8, salt); }else { diff --git a/src/main/java/com/keybox/manage/db/UserProfileDB.java b/src/main/java/io/bastillion/manage/db/UserProfileDB.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/db/UserProfileDB.java rename to src/main/java/io/bastillion/manage/db/UserProfileDB.java index 8c7f0295..4657fca1 --- a/src/main/java/com/keybox/manage/db/UserProfileDB.java +++ b/src/main/java/io/bastillion/manage/db/UserProfileDB.java @@ -25,10 +25,10 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.manage.model.Profile; -import com.keybox.manage.util.DBUtils; +import io.bastillion.manage.model.Profile; +import io.bastillion.manage.util.DBUtils; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/src/main/java/com/keybox/manage/db/UserThemeDB.java b/src/main/java/io/bastillion/manage/db/UserThemeDB.java similarity index 97% rename from src/main/java/com/keybox/manage/db/UserThemeDB.java rename to src/main/java/io/bastillion/manage/db/UserThemeDB.java index 4eba4b5e..9600cbca 100644 --- a/src/main/java/com/keybox/manage/db/UserThemeDB.java +++ b/src/main/java/io/bastillion/manage/db/UserThemeDB.java @@ -25,10 +25,10 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.db; +package io.bastillion.manage.db; -import com.keybox.manage.model.UserSettings; -import com.keybox.manage.util.DBUtils; +import io.bastillion.manage.model.UserSettings; +import io.bastillion.manage.util.DBUtils; import org.apache.commons.lang3.StringUtils; import java.sql.Connection; diff --git a/src/main/java/com/keybox/manage/model/ApplicationKey.java b/src/main/java/io/bastillion/manage/model/ApplicationKey.java similarity index 98% rename from src/main/java/com/keybox/manage/model/ApplicationKey.java rename to src/main/java/io/bastillion/manage/model/ApplicationKey.java index 7e5f8eb2..7b98b7ab 100644 --- a/src/main/java/com/keybox/manage/model/ApplicationKey.java +++ b/src/main/java/io/bastillion/manage/model/ApplicationKey.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; /** * Value object for applications ssh keys diff --git a/src/main/java/com/keybox/manage/model/AuditWrapper.java b/src/main/java/io/bastillion/manage/model/AuditWrapper.java similarity index 98% rename from src/main/java/com/keybox/manage/model/AuditWrapper.java rename to src/main/java/io/bastillion/manage/model/AuditWrapper.java index a529fcef..cdd071a5 100644 --- a/src/main/java/com/keybox/manage/model/AuditWrapper.java +++ b/src/main/java/io/bastillion/manage/model/AuditWrapper.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; public class AuditWrapper { diff --git a/src/main/java/com/keybox/manage/model/Auth.java b/src/main/java/io/bastillion/manage/model/Auth.java old mode 100755 new mode 100644 similarity index 99% rename from src/main/java/com/keybox/manage/model/Auth.java rename to src/main/java/io/bastillion/manage/model/Auth.java index bbbae4c1..bda274dc --- a/src/main/java/com/keybox/manage/model/Auth.java +++ b/src/main/java/io/bastillion/manage/model/Auth.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; /** * Value object that contains login information diff --git a/src/main/java/com/keybox/manage/model/HostSystem.java b/src/main/java/io/bastillion/manage/model/HostSystem.java old mode 100755 new mode 100644 similarity index 99% rename from src/main/java/com/keybox/manage/model/HostSystem.java rename to src/main/java/io/bastillion/manage/model/HostSystem.java index e7c810a9..3244d571 --- a/src/main/java/com/keybox/manage/model/HostSystem.java +++ b/src/main/java/io/bastillion/manage/model/HostSystem.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; import java.util.List; diff --git a/src/main/java/com/keybox/manage/model/Profile.java b/src/main/java/io/bastillion/manage/model/Profile.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/model/Profile.java rename to src/main/java/io/bastillion/manage/model/Profile.java index e03041db..fcb9486b --- a/src/main/java/com/keybox/manage/model/Profile.java +++ b/src/main/java/io/bastillion/manage/model/Profile.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; import java.util.List; diff --git a/src/main/java/com/keybox/manage/model/PublicKey.java b/src/main/java/io/bastillion/manage/model/PublicKey.java similarity index 99% rename from src/main/java/com/keybox/manage/model/PublicKey.java rename to src/main/java/io/bastillion/manage/model/PublicKey.java index 8be1c8fe..b32cb795 100644 --- a/src/main/java/com/keybox/manage/model/PublicKey.java +++ b/src/main/java/io/bastillion/manage/model/PublicKey.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; import java.util.Date; diff --git a/src/main/java/com/keybox/manage/model/SchSession.java b/src/main/java/io/bastillion/manage/model/SchSession.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/model/SchSession.java rename to src/main/java/io/bastillion/manage/model/SchSession.java index d17d5ce1..f0374834 --- a/src/main/java/com/keybox/manage/model/SchSession.java +++ b/src/main/java/io/bastillion/manage/model/SchSession.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; import com.jcraft.jsch.Channel; import com.jcraft.jsch.Session; diff --git a/src/main/java/com/keybox/manage/model/Script.java b/src/main/java/io/bastillion/manage/model/Script.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/model/Script.java rename to src/main/java/io/bastillion/manage/model/Script.java index fb0a2eaf..a4b0baa0 --- a/src/main/java/com/keybox/manage/model/Script.java +++ b/src/main/java/io/bastillion/manage/model/Script.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; /** * Value object that contains script information diff --git a/src/main/java/com/keybox/manage/model/SessionAudit.java b/src/main/java/io/bastillion/manage/model/SessionAudit.java similarity index 98% rename from src/main/java/com/keybox/manage/model/SessionAudit.java rename to src/main/java/io/bastillion/manage/model/SessionAudit.java index 8fe4672f..7cb7f441 100644 --- a/src/main/java/com/keybox/manage/model/SessionAudit.java +++ b/src/main/java/io/bastillion/manage/model/SessionAudit.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; import java.util.Date; diff --git a/src/main/java/com/keybox/manage/model/SessionOutput.java b/src/main/java/io/bastillion/manage/model/SessionOutput.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/model/SessionOutput.java rename to src/main/java/io/bastillion/manage/model/SessionOutput.java index 3f4b99ad..06dcf4be --- a/src/main/java/com/keybox/manage/model/SessionOutput.java +++ b/src/main/java/io/bastillion/manage/model/SessionOutput.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; /** diff --git a/src/main/java/com/keybox/manage/model/SortedSet.java b/src/main/java/io/bastillion/manage/model/SortedSet.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/model/SortedSet.java rename to src/main/java/io/bastillion/manage/model/SortedSet.java index 7b3b71e9..c1fd26c0 --- a/src/main/java/com/keybox/manage/model/SortedSet.java +++ b/src/main/java/io/bastillion/manage/model/SortedSet.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; import java.util.HashMap; import java.util.List; diff --git a/src/main/java/com/keybox/manage/model/User.java b/src/main/java/io/bastillion/manage/model/User.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/model/User.java rename to src/main/java/io/bastillion/manage/model/User.java index 8bccf413..b066b4bc --- a/src/main/java/com/keybox/manage/model/User.java +++ b/src/main/java/io/bastillion/manage/model/User.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; import java.util.List; diff --git a/src/main/java/com/keybox/manage/model/UserSchSessions.java b/src/main/java/io/bastillion/manage/model/UserSchSessions.java similarity index 98% rename from src/main/java/com/keybox/manage/model/UserSchSessions.java rename to src/main/java/io/bastillion/manage/model/UserSchSessions.java index 3fb9739a..7f0ec9e6 100644 --- a/src/main/java/com/keybox/manage/model/UserSchSessions.java +++ b/src/main/java/io/bastillion/manage/model/UserSchSessions.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; import java.util.Map; diff --git a/src/main/java/com/keybox/manage/model/UserSessionsOutput.java b/src/main/java/io/bastillion/manage/model/UserSessionsOutput.java similarity index 98% rename from src/main/java/com/keybox/manage/model/UserSessionsOutput.java rename to src/main/java/io/bastillion/manage/model/UserSessionsOutput.java index ec7e5524..12b06742 100644 --- a/src/main/java/com/keybox/manage/model/UserSessionsOutput.java +++ b/src/main/java/io/bastillion/manage/model/UserSessionsOutput.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/com/keybox/manage/model/UserSettings.java b/src/main/java/io/bastillion/manage/model/UserSettings.java similarity index 98% rename from src/main/java/com/keybox/manage/model/UserSettings.java rename to src/main/java/io/bastillion/manage/model/UserSettings.java index cbc3c773..d614cc85 100644 --- a/src/main/java/com/keybox/manage/model/UserSettings.java +++ b/src/main/java/io/bastillion/manage/model/UserSettings.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.model; +package io.bastillion.manage.model; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/com/keybox/manage/socket/GetHttpSessionConfigurator.java b/src/main/java/io/bastillion/manage/socket/GetHttpSessionConfigurator.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/socket/GetHttpSessionConfigurator.java rename to src/main/java/io/bastillion/manage/socket/GetHttpSessionConfigurator.java index 2aef956c..59084f7b --- a/src/main/java/com/keybox/manage/socket/GetHttpSessionConfigurator.java +++ b/src/main/java/io/bastillion/manage/socket/GetHttpSessionConfigurator.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.socket; +package io.bastillion.manage.socket; import javax.servlet.http.HttpSession; import javax.websocket.HandshakeResponse; diff --git a/src/main/java/com/keybox/manage/socket/SecureShellWS.java b/src/main/java/io/bastillion/manage/socket/SecureShellWS.java similarity index 94% rename from src/main/java/com/keybox/manage/socket/SecureShellWS.java rename to src/main/java/io/bastillion/manage/socket/SecureShellWS.java index 90ff7845..c64287cb 100644 --- a/src/main/java/com/keybox/manage/socket/SecureShellWS.java +++ b/src/main/java/io/bastillion/manage/socket/SecureShellWS.java @@ -1,14 +1,14 @@ -package com.keybox.manage.socket; +package io.bastillion.manage.socket; import com.google.gson.Gson; -import com.keybox.common.util.AppConfig; -import com.keybox.common.util.AuthUtil; -import com.keybox.manage.control.SecureShellKtrl; -import com.keybox.manage.db.UserDB; -import com.keybox.manage.model.SchSession; -import com.keybox.manage.model.UserSchSessions; -import com.keybox.manage.task.SentOutputTask; -import com.keybox.manage.util.SessionOutputUtil; +import io.bastillion.common.util.AppConfig; +import io.bastillion.common.util.AuthUtil; +import io.bastillion.manage.control.SecureShellKtrl; +import io.bastillion.manage.db.UserDB; +import io.bastillion.manage.model.SchSession; +import io.bastillion.manage.model.UserSchSessions; +import io.bastillion.manage.task.SentOutputTask; +import io.bastillion.manage.util.SessionOutputUtil; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/keybox/manage/task/SecureShellTask.java b/src/main/java/io/bastillion/manage/task/SecureShellTask.java old mode 100755 new mode 100644 similarity index 95% rename from src/main/java/com/keybox/manage/task/SecureShellTask.java rename to src/main/java/io/bastillion/manage/task/SecureShellTask.java index c13875e4..46dbc4ca --- a/src/main/java/com/keybox/manage/task/SecureShellTask.java +++ b/src/main/java/io/bastillion/manage/task/SecureShellTask.java @@ -25,14 +25,15 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.task; +package io.bastillion.manage.task; -import com.keybox.manage.util.SessionOutputUtil; -import com.keybox.manage.model.SessionOutput; +import io.bastillion.manage.util.SessionOutputUtil; +import io.bastillion.manage.model.SessionOutput; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/keybox/manage/task/SentOutputTask.java b/src/main/java/io/bastillion/manage/task/SentOutputTask.java old mode 100755 new mode 100644 similarity index 92% rename from src/main/java/com/keybox/manage/task/SentOutputTask.java rename to src/main/java/io/bastillion/manage/task/SentOutputTask.java index 0d0ff2b2..bed57194 --- a/src/main/java/com/keybox/manage/task/SentOutputTask.java +++ b/src/main/java/io/bastillion/manage/task/SentOutputTask.java @@ -25,17 +25,18 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.task; +package io.bastillion.manage.task; import com.google.gson.Gson; -import com.keybox.manage.model.SessionOutput; -import com.keybox.manage.model.User; -import com.keybox.manage.util.DBUtils; -import com.keybox.manage.util.SessionOutputUtil; +import io.bastillion.manage.model.SessionOutput; +import io.bastillion.manage.model.User; +import io.bastillion.manage.util.DBUtils; +import io.bastillion.manage.util.SessionOutputUtil; import javax.websocket.Session; import java.sql.Connection; import java.util.List; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/keybox/manage/util/DBUtils.java b/src/main/java/io/bastillion/manage/util/DBUtils.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/util/DBUtils.java rename to src/main/java/io/bastillion/manage/util/DBUtils.java index 0ade7066..c24fdd66 --- a/src/main/java/com/keybox/manage/util/DBUtils.java +++ b/src/main/java/io/bastillion/manage/util/DBUtils.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.util; +package io.bastillion.manage.util; import java.sql.Connection; import java.sql.ResultSet; diff --git a/src/main/java/com/keybox/manage/util/DSPool.java b/src/main/java/io/bastillion/manage/util/DSPool.java similarity index 97% rename from src/main/java/com/keybox/manage/util/DSPool.java rename to src/main/java/io/bastillion/manage/util/DSPool.java index 402f2c9f..81be01d4 100644 --- a/src/main/java/com/keybox/manage/util/DSPool.java +++ b/src/main/java/io/bastillion/manage/util/DSPool.java @@ -25,11 +25,11 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.util; +package io.bastillion.manage.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.keybox.common.util.AppConfig; +import io.bastillion.common.util.AppConfig; import org.apache.commons.dbcp2.BasicDataSource; /** diff --git a/src/main/java/com/keybox/manage/util/EncryptionUtil.java b/src/main/java/io/bastillion/manage/util/EncryptionUtil.java old mode 100755 new mode 100644 similarity index 89% rename from src/main/java/com/keybox/manage/util/EncryptionUtil.java rename to src/main/java/io/bastillion/manage/util/EncryptionUtil.java index 1cd6a9b0..ae51cc3f --- a/src/main/java/com/keybox/manage/util/EncryptionUtil.java +++ b/src/main/java/io/bastillion/manage/util/EncryptionUtil.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.util; +package io.bastillion.manage.util; import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang3.StringUtils; @@ -100,10 +100,11 @@ public static String hash(String str) { /** * return encrypted value of string * + * @param key secret key * @param str unencrypted string * @return encrypted string */ - public static String encrypt(String str) { + public static String encrypt(byte[] key, String str) { String retVal = null; if (str != null && str.length() > 0) { @@ -123,10 +124,11 @@ public static String encrypt(String str) { /** * return decrypted value of encrypted string * + * @param key secret key * @param str encrypted string * @return decrypted string */ - public static String decrypt(String str) { + public static String decrypt(byte[] key, String str) { String retVal = null; if (str != null && str.length() > 0) { try { @@ -142,5 +144,25 @@ public static String decrypt(String str) { return retVal; } + /** + * return encrypted value of string + * + * @param str unencrypted string + * @return encrypted string + */ + public static String encrypt(String str) { + return encrypt(key, str); + } + + /** + * return decrypted value of encrypted string + * + * @param str encrypted string + * @return decrypted string + */ + public static String decrypt(String str) { + return decrypt(key, str); + } + } diff --git a/src/main/java/com/keybox/manage/util/ExternalAuthUtil.java b/src/main/java/io/bastillion/manage/util/ExternalAuthUtil.java similarity index 98% rename from src/main/java/com/keybox/manage/util/ExternalAuthUtil.java rename to src/main/java/io/bastillion/manage/util/ExternalAuthUtil.java index e96a77a0..48adc8a0 100644 --- a/src/main/java/com/keybox/manage/util/ExternalAuthUtil.java +++ b/src/main/java/io/bastillion/manage/util/ExternalAuthUtil.java @@ -25,14 +25,14 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.util; - -import com.keybox.common.util.AppConfig; -import com.keybox.manage.db.AuthDB; -import com.keybox.manage.db.UserDB; -import com.keybox.manage.db.UserProfileDB; -import com.keybox.manage.model.Auth; -import com.keybox.manage.model.User; +package io.bastillion.manage.util; + +import io.bastillion.common.util.AppConfig; +import io.bastillion.manage.db.AuthDB; +import io.bastillion.manage.db.UserDB; +import io.bastillion.manage.db.UserProfileDB; +import io.bastillion.manage.model.Auth; +import io.bastillion.manage.model.User; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/keybox/manage/util/KeyStoreUtil.java b/src/main/java/io/bastillion/manage/util/KeyStoreUtil.java similarity index 97% rename from src/main/java/com/keybox/manage/util/KeyStoreUtil.java rename to src/main/java/io/bastillion/manage/util/KeyStoreUtil.java index dcacbb7a..10938718 100644 --- a/src/main/java/com/keybox/manage/util/KeyStoreUtil.java +++ b/src/main/java/io/bastillion/manage/util/KeyStoreUtil.java @@ -25,11 +25,10 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.util; +package io.bastillion.manage.util; -import com.keybox.common.util.AppConfig; +import io.bastillion.common.util.AppConfig; import org.apache.commons.io.FileUtils; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,7 +48,7 @@ public class KeyStoreUtil { private static KeyStore keyStore = null; private static final String keyStoreFile = AppConfig.CONFIG_DIR - + "/keybox.jceks"; + + "/bastillion.jceks"; private static final char[] KEYSTORE_PASS = new char[]{ 'G', '~', 'r', 'x', 'Z', 'E', 'w', 'f', 'a', '[', '!', 'f', 'Z', 'd', '*', 'L', '8', 'm', 'h', 'u', '#', 'j', '9', ':', '~', ';', 'U', '>', 'O', 'i', '8', 'r', 'C', '}', 'f', 't', '%', '[', 'H', 'h', 'M', '&', diff --git a/src/main/java/com/keybox/manage/util/OTPUtil.java b/src/main/java/io/bastillion/manage/util/OTPUtil.java similarity index 99% rename from src/main/java/com/keybox/manage/util/OTPUtil.java rename to src/main/java/io/bastillion/manage/util/OTPUtil.java index d73dd5cc..567c5373 100644 --- a/src/main/java/com/keybox/manage/util/OTPUtil.java +++ b/src/main/java/io/bastillion/manage/util/OTPUtil.java @@ -25,7 +25,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.util; +package io.bastillion.manage.util; import org.apache.commons.codec.binary.Base32; diff --git a/src/main/java/com/keybox/manage/util/PasswordUtil.java b/src/main/java/io/bastillion/manage/util/PasswordUtil.java similarity index 96% rename from src/main/java/com/keybox/manage/util/PasswordUtil.java rename to src/main/java/io/bastillion/manage/util/PasswordUtil.java index a469e82a..824e519e 100644 --- a/src/main/java/com/keybox/manage/util/PasswordUtil.java +++ b/src/main/java/io/bastillion/manage/util/PasswordUtil.java @@ -25,9 +25,9 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.util; +package io.bastillion.manage.util; -import com.keybox.common.util.AppConfig; +import io.bastillion.common.util.AppConfig; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/src/main/java/com/keybox/manage/util/RefreshAuthKeyUtil.java b/src/main/java/io/bastillion/manage/util/RefreshAuthKeyUtil.java similarity index 98% rename from src/main/java/com/keybox/manage/util/RefreshAuthKeyUtil.java rename to src/main/java/io/bastillion/manage/util/RefreshAuthKeyUtil.java index 3c151d3b..bed2fa92 100644 --- a/src/main/java/com/keybox/manage/util/RefreshAuthKeyUtil.java +++ b/src/main/java/io/bastillion/manage/util/RefreshAuthKeyUtil.java @@ -25,9 +25,9 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.util; +package io.bastillion.manage.util; -import com.keybox.common.util.AppConfig; +import io.bastillion.common.util.AppConfig; import java.util.Timer; import java.util.TimerTask; diff --git a/src/main/java/com/keybox/manage/util/SSHUtil.java b/src/main/java/io/bastillion/manage/util/SSHUtil.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/keybox/manage/util/SSHUtil.java rename to src/main/java/io/bastillion/manage/util/SSHUtil.java index eefa13fe..692f6dfb --- a/src/main/java/com/keybox/manage/util/SSHUtil.java +++ b/src/main/java/io/bastillion/manage/util/SSHUtil.java @@ -25,13 +25,15 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.util; +package io.bastillion.manage.util; import com.jcraft.jsch.*; -import com.keybox.common.util.AppConfig; -import com.keybox.manage.db.*; -import com.keybox.manage.model.*; -import com.keybox.manage.task.SecureShellTask; +import io.bastillion.common.util.AppConfig; +import io.bastillion.manage.db.*; +import io.bastillion.manage.model.*; +import io.bastillion.manage.db.*; +import io.bastillion.manage.task.SecureShellTask; +import io.bastillion.manage.model.*; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; @@ -197,7 +199,7 @@ public static String keyGen(String passphrase) { } else if ("ecdsa".equals(SSHUtil.KEY_TYPE)) { type = KeyPair.ECDSA; } - String comment = "keybox@global_key"; + String comment = "bastillion@global_key"; JSch jsch = new JSch(); diff --git a/src/main/java/com/keybox/manage/util/SessionOutputSerializer.java b/src/main/java/io/bastillion/manage/util/SessionOutputSerializer.java similarity index 97% rename from src/main/java/com/keybox/manage/util/SessionOutputSerializer.java rename to src/main/java/io/bastillion/manage/util/SessionOutputSerializer.java index 633967b0..5e68e894 100644 --- a/src/main/java/com/keybox/manage/util/SessionOutputSerializer.java +++ b/src/main/java/io/bastillion/manage/util/SessionOutputSerializer.java @@ -25,13 +25,14 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.util; +package io.bastillion.manage.util; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; -import com.keybox.manage.model.AuditWrapper; +import io.bastillion.manage.model.AuditWrapper; + import java.lang.reflect.Type; import java.util.Date; diff --git a/src/main/java/com/keybox/manage/util/SessionOutputUtil.java b/src/main/java/io/bastillion/manage/util/SessionOutputUtil.java old mode 100755 new mode 100644 similarity index 94% rename from src/main/java/com/keybox/manage/util/SessionOutputUtil.java rename to src/main/java/io/bastillion/manage/util/SessionOutputUtil.java index 17e6e494..56eaeea3 --- a/src/main/java/com/keybox/manage/util/SessionOutputUtil.java +++ b/src/main/java/io/bastillion/manage/util/SessionOutputUtil.java @@ -25,16 +25,16 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ -package com.keybox.manage.util; +package io.bastillion.manage.util; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.keybox.common.util.AppConfig; -import com.keybox.manage.db.SessionAuditDB; -import com.keybox.manage.model.AuditWrapper; -import com.keybox.manage.model.SessionOutput; -import com.keybox.manage.model.User; -import com.keybox.manage.model.UserSessionsOutput; +import io.bastillion.common.util.AppConfig; +import io.bastillion.manage.db.SessionAuditDB; +import io.bastillion.manage.model.AuditWrapper; +import io.bastillion.manage.model.SessionOutput; +import io.bastillion.manage.model.User; +import io.bastillion.manage.model.UserSessionsOutput; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.commons.lang3.StringUtils; @@ -53,7 +53,7 @@ public class SessionOutputUtil { private static Map userSessionsOutputMap = new ConcurrentHashMap<>(); public final static boolean enableInternalAudit = "true".equals(AppConfig.getProperty("enableInternalAudit")); private static Gson gson = new GsonBuilder().registerTypeAdapter(AuditWrapper.class, new SessionOutputSerializer()).create(); - private static Logger systemAuditLogger = LoggerFactory.getLogger("com.keybox.manage.util.SystemAudit"); + private static Logger systemAuditLogger = LoggerFactory.getLogger("io.bastillion.manage.util.SystemAudit"); private SessionOutputUtil() { } diff --git a/src/main/resources/KeyBoxConfig.properties b/src/main/resources/BastillionConfig.properties old mode 100755 new mode 100644 similarity index 90% rename from src/main/resources/KeyBoxConfig.properties rename to src/main/resources/BastillionConfig.properties index e833d5f3..ec11f901 --- a/src/main/resources/KeyBoxConfig.properties +++ b/src/main/resources/BastillionConfig.properties @@ -1,5 +1,5 @@ # -# KeyBox Configuration Options +# Bastillion Configuration Options # # #set to true to regenerate and import SSH keys @@ -26,7 +26,7 @@ websocketTimeout=0 agentForwarding=false #enable two-factor authentication with a one-time password - 'required', 'optional', or 'disabled' oneTimePassword=optional -#set to false to disable key management. If false, the KeyBox public key will be appended to the authorized_keys file (instead of it being overwritten completely). +#set to false to disable key management. If false, the Bastillion public key will be appended to the authorized_keys file (instead of it being overwritten completely). keyManagementEnabled=true #set to true to generate keys when added/managed by users and enforce strong passphrases set to false to allow users to set their own public key forceUserKeyGeneration=true @@ -47,13 +47,13 @@ use256EncryptionKey=false #Database and connection pool settings #Database user -dbUser=keybox +dbUser=bastillion #Database password dbPassword= #Database JDBC driver dbDriver=org.h2.Driver #Connection URL to the DB -dbConnectionURL=jdbc:h2:keydb/keybox;CIPHER=AES; +dbConnectionURL=jdbc:h2:keydb/bastillion;CIPHER=AES; #Max connections in the connection pool maxActive=25 #When true, objects will be validated before being returned by the connection pool diff --git a/src/main/resources/VERSION.txt b/src/main/resources/VERSION.txt index 2dca1c00..2c51149d 100644 --- a/src/main/resources/VERSION.txt +++ b/src/main/resources/VERSION.txt @@ -1 +1 @@ -KeyBox - Version: ${version} \ No newline at end of file +Bastillion - Version: ${version} \ No newline at end of file diff --git a/src/main/resources/jaas.conf b/src/main/resources/jaas.conf index 7fd3cbf4..23c79320 100644 --- a/src/main/resources/jaas.conf +++ b/src/main/resources/jaas.conf @@ -3,8 +3,8 @@ ldap-ol { //openldap auth first example config com.sun.security.auth.module.LdapLoginModule REQUIRED - userProvider="ldap://:389/ou=users,dc=keybox,dc=com" - authIdentity="uid={USERNAME},ou=users,dc=keybox,dc=com" + userProvider="ldap://:389/ou=users,dc=bastillion,dc=com" + authIdentity="uid={USERNAME},ou=users,dc=bastillion,dc=com" userFilter="(&(uid={USERNAME})(objectClass=inetOrgPerson))" authzIdentity="{cn}" //set this to return full name useSSL=false @@ -37,12 +37,12 @@ ldap-ol-with-roles { bindPassword="" authenticationMethod="simple" forceBindingLogin="false" - userBaseDn="ou=users,dc=keybox,dc=com" + userBaseDn="ou=users,dc=bastillion,dc=com" userRdnAttribute="uid" userIdAttribute="uid" userPasswordAttribute="userPassword" userObjectClass="inetOrgPerson" - roleBaseDn="ou=groups,dc=keybox,dc=com" + roleBaseDn="ou=groups,dc=bastillion,dc=com" roleNameAttribute="cn" roleMemberAttribute="member" roleObjectClass="groupOfNames"; diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml index f6bef71e..2c21dca2 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -9,7 +9,7 @@ @@ -22,11 +22,11 @@ - + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 8a52e5f5..525ccaa9 100755 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -11,7 +11,7 @@ AuthFilter - com.keybox.common.filter.AuthFilter + io.bastillion.common.filter.AuthFilter diff --git a/src/main/webapp/_res/css/keybox.css b/src/main/webapp/_res/css/bastillion.css old mode 100755 new mode 100644 similarity index 100% rename from src/main/webapp/_res/css/keybox.css rename to src/main/webapp/_res/css/bastillion.css diff --git a/src/main/webapp/_res/inc/header.html b/src/main/webapp/_res/inc/header.html index fed34d55..e22fe0e9 100644 --- a/src/main/webapp/_res/inc/header.html +++ b/src/main/webapp/_res/inc/header.html @@ -34,8 +34,8 @@ - - + + - KeyBox - Main Menu + Bastillion - Main Menu @@ -107,7 +107,7 @@ Create scripts to be executed on selected systems simultaneously through a web-terminal. - + Manage SSH Keys @@ -122,7 +122,7 @@ Set additional public SSH keys for current user. - + Audit Sessions diff --git a/src/main/webapp/admin/secure_shell.html b/src/main/webapp/admin/secure_shell.html index bbc1e949..0387f4e0 100644 --- a/src/main/webapp/admin/secure_shell.html +++ b/src/main/webapp/admin/secure_shell.html @@ -538,7 +538,7 @@ - KeyBox - Composite Terms + Bastillion - Composite Terms @@ -549,10 +549,10 @@