Commit fa8bcb9c authored by Tristan A Spakes's avatar Tristan A Spakes

ver. 1.3.2 Baobab, gnome-software, and gnome-screensaver checkpoints should be...

ver. 1.3.2 Baobab, gnome-software, and gnome-screensaver checkpoints should be working. temporary digest mapping should be working, but need to test
parent 3ca6dfe7
Pipeline #26096 passed with stages
in 1 minute and 7 seconds
......@@ -10,6 +10,7 @@
<script src="../miscjs/openURL.js"></script>
<script src="../miscjs/launchBomgar.js"></script>
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../softwareManagement/softwareCheckpoint/softwareCheckpoint.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="./yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
<script src="./badgeMinder/badgeInstallCheckpoint/badgeInstallCheckpoint.js"></script>
......@@ -17,6 +18,7 @@
<script src="../fileSystemManagement/addPassphrase/addPassphrase.js"></script>
<script src="../fileSystemManagement/removePassphrase/removePassphrase.js"></script>
<script src="../fileSystemManagement/driveHealthCheck/driveHealthCheck.js"></script>
<script src="../fileSystemManagement/baobabCheckpoint/baobabCheckpoint.js"></script>
<script src="../miscjs/installedCheck.js"></script>
</head>
<body>
......
......@@ -58,3 +58,13 @@ input[type=submit] {
background-color: Gray;
cursor: pointer;
}
#tempMFARegistrationUserSelect {
margin-bottom: 4.5vh;
width: 25vw;
}
.tempMFARegistrationLine {
display: flex;
flex-direction: row;
height: 15vh;
}
......@@ -7,8 +7,15 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<script src="./tempMFARegistration.js"></script>
</head>
<body>
<body onload="tempMFARegistrationLoad()">
<div id="tempMFARegistrationPage">
<div class="tempMFARegistrationLine">
<div id="tempMFARegistrationText">
Select a user:
</div>
<select id="tempMFARegistrationUserSelect">
</select>
</div>
<div id="tempMFARegistrationText">
Please ensure that there is one smart card inserted before clicking 'Register'
</div>
......
......@@ -7,6 +7,29 @@ const remote = require('electron').remote
function tempMFARegistration() {
ipcRenderer.send('log', 'ORNL Toolbox: Submitted MFA temporary registration request', 'info')
uid = document.getElementById('tempMFARegistrationUserSelect').value
try { //Check for entry in digest mapping file
var path = remote.app.getPath('exe') //Grabs the path to the executable
path = path.substring(0, path.length - 11) + 'resources/app/badgeManagement/tempMFARegistration/tempMFARegistration.bash'
alert('Please insert an unregistered smart card before proceeding. Ensure it is the only smart card plugged in.')
checkSmartCard()
//Grab the unregistered smart card mapping to be added
var entry = execSync(`echo "${uid}\"" | cat ${path} - | tr '\n' ' ' | bash`, (error, stdout, stderr) => {})
alert('Please remove the unregistered smart card and then insert a registered smart card. Ensure it is the only smart card plugged in.')
checkSmartCard()
execSync(`pkexec echo ${entry} >> /etc/pam_pkcs11/digest_mapping`, () => {})
} catch(error) {
error = error.toString()
console.error(error)
alert('An error occured during the registration process')
ipcRenderer.send('log', 'ORNL Toolbox: An error occured during the registration process - request aborted', 'err')
return
}
ipcRenderer.send('log', 'ORNL Toolbox: Completed MFA temporary registration request', 'info')
}
function checkSmartCard() {
try { //Scan for active smart card slots for inserted smart cards
var cardCheck = execSync(`pkcs11-tool -T | grep "Slot"`, (error, stdout, stderr) => {})
cardCheck = cardCheck.toString()
......@@ -36,18 +59,24 @@ function tempMFARegistration() {
} else {
ipcRenderer.send('log', 'ORNL Toolbox: 1 smart card found inserted', 'info')
}
}
try { //Check for entry in digest mapping file
var path = remote.app.getPath('exe') //Grabs the path to the executable
path = path.substring(0, path.length - 11) + 'resources/app/badgeManagement/tempMFARegistration/tempMFARegistration.bash'
var inDigest = execSync(`cat ${path} | pkexec bash`, (error, stdout, stderr) => {
alert('test')
})
} catch(error) {
error = error.toString()
alert(error)
return
}
function tempMFARegistrationLoad() { //Loading the users
if(!execSync) var execSync = require('child_process').execSync
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
ipcRenderer.send('log', 'ORNL Toolbox: Completed MFA temporary registration request', 'info')
//Adding the options of the dropdown menu
var optionValue = 1
var dropdownString = '<option value="0" disabled selected>User</option>'
var users = execSync('ls /home', () => {})
users = users.toString()
userArray = users.split('\n')
for(i = 0; i < userArray.length; i++) {
//Skip blanks and users that are not UIDs
if(userArray[i].trim() == "" || (userArray[i].trim()).length != 3) continue
dropdownString = dropdownString + '\n' + `<option value="${optionValue}">${userArray[i]}</option>`
optionValue++
}
document.getElementById('tempMFARegistrationUserSelect').innerHTML = dropdownString;
ipcRenderer.send('log', `ORNL Toolbox: List of users loaded`, 'info')
}
#!/bin/bash
echo "$(pkcs15-tool -r 1 --rfc4716 2>/dev/null | openssl x509 -noout \
-fingerprint -sha1 -inform pem | grep -Po '(?<==).*(?=$)') -> t0y" \
>> /etc/pam_pkcs11/digest_mapping
echo "$(pkcs15-tool -r 1 --rfc4716 2>/dev/null | openssl x509 -noout -fingerprint -sha1 -inform pem | grep -Po '(?<==).*(?=$)') ->
......@@ -6,7 +6,7 @@ if [[ ${CI_COMMIT_REF_NAME} == 'master' ]]; then
else
BRANCH="-${CI_COMMIT_REF_NAME}"
fi
VERSION_NUMBER='1.3.1'
VERSION_NUMBER='1.3.2'
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh epel-release-latest-7.noarch.rpm
sudo yum -y install nodejs npm ruby-devel gcc make rpm-build rubygems
......
/* Prevents highlighting of text, dragging of images, etc. */
*, *::after, *::before {
margin: 0;
padding: 0;
-webkit-user-select: none;
-webkit-user-drag: none;
-webkit-app-region: no-drag;
font-family: 'Montserrat', sans-serif;
}
div {
-webkit-user-select: none;
-webkit-user-drag: none;
-webkit-app-region: no-drag;
font-family: 'Montserrat', sans-serif;
}
/* Horizontal line formatting */
hr {
display: block;
margin-top: 0.15em;
margin-bottom: 0.15em;
}
/* For submission buttons */
input[type=submit] {
padding: 0;
border: none;
background: none;
font-size: 21px;
}
#baobabCheckpointPage {
display: flex;
height: 100vh;
flex-direction: column;
justify-content: center;
align-items: center;
}
#baobabCheckpointText {
font-size: 16px;
text-align: center;
margin-bottom: 25px;
margin-left: 12px;
margin-right: 12px;
}
.baobabCheckpointButtonsContent {
width: 100vw;
height: 10vh;
display: flex;
flex-direction: row;
justify-content: center;
}
.baobabCheckpointButtons {
text-align: center;
align-items: center;
width: 22vw;
height: 18vh;
margin-right: 12.5px;
margin-left: 12.5px;
background-color: #007833 !important;
border-radius: 8px;
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2), 0 4px 8px 0 rgba(0,0,0,0.19);
color: White;
}
.baobabCheckpointButtons:hover {
background-color: Gray !important;
cursor: pointer;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Baobab Checkpoint</title>
<link rel="stylesheet" href="./baobabCheckpoint.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<script src="../../miscjs/addWindow.js"></script>
<script src="../localDriveUsage/localDriveUsage.js"></script>
<script src="./baobabCheckpointConfirm.js"></script>
<script src="../../miscjs/installedCheck.js"></script>
</head>
<body>
<div id="baobabCheckpointPage">
<div id="baobabCheckpointText">
Baobab is not currently installed. 'Local Drive Usage' opens
the Disk Usage Analyzer which requires baobab. Would you like to
install it?
</div>
<div class="baobabCheckpointButtonsContent">
<span title="Click 'Install' to install baobab, which is required for 'Local Drive Usage'">
<input type="submit" class="baobabCheckpointButtons" value="Install" onclick="baobabCheckpointConfirm()">
</span>
<span title="Click 'Close' to close this current window and decline the installation.">
<input type="submit" class="baobabCheckpointButtons" value="Close" onclick="baobabClose()">
</span>
</div>
</div>
</body>
</html>
function baobabCheckpoint() {
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
if(!execSync) var execSync = require('child_process').execSync
ipcRenderer.send('log', 'ORNL Toolbox: Submitted baobab checkpoint request', 'info')
var os
try { //Detect OS
execSync('grep Ubuntu /etc/os-release')
os = "Ubuntu"
ipcRenderer.send('log', 'ORNL Toolbox: OS determined to be Ubuntu', 'info')
} catch(error) {
//"Ubuntu" not found in file
os = "RHEL"
ipcRenderer.send('log', 'ORNL Toolbox: OS determined to be RHEL', 'info')
}
try {
if(os == "Ubuntu") {
package = execSync(`apt -qq list --installed baobab`)
} else {
package = execSync(`yum list installed baobab | grep baobab`)
}
} catch(error) {
error = error.toString()
if(os != "Ubuntu" && error.includes("No matching Packages to list")) {
package = ""
} else {
alert(error)
ipcRenderer.send('log', 'ORNL Toolbox: Failed while checking for baobab - request aborted', 'err')
return
}
}
ipcRenderer.send('log', 'ORNL Toolbox: Completed baobab checkpoint request', 'info')
if(package == "") {
addWinMain('./fileSystemManagement/baobabCheckpoint/baobabCheckpoint.html', 'Baobab Checkpoint', 400, 175)
} else {
openDiskUsageAnalyzer()
}
}
function baobabCheckpointConfirm() {
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
if(!execSync) var execSync = require('child_process').execSync
ipcRenderer.send('log', 'ORNL Toolbox: Submitted install request for baobab', 'info')
var os
try { //Detect OS
execSync('grep Ubuntu /etc/os-release')
os = "Ubuntu"
ipcRenderer.send('log', 'ORNL Toolbox: OS determined to be Ubuntu', 'info')
} catch(error) {
//"Ubuntu" not found in file
os = "RHEL"
ipcRenderer.send('log', 'ORNL Toolbox: OS determined to be RHEL', 'info')
}
try { //Install baobab
if(os == "Ubuntu") {
execSync(`pkexec apt install baobab`)
} else {
execSync(`pkexec yum -y install baobab`)
}
} catch(error) {
error = error.toString()
if(error.includes("Request dismissed")) {
ipcRenderer.send('log', 'ORNL Toolbox: Request canceled by user', 'err')
baobabClose()
return
} else {
ipcRenderer.send('log', 'ORNL Toolbox: Failed to install baobab - request aborted', 'err')
console.error(error)
alert(error)
baobabClose()
}
}
alert('Baobab successfully installed')
ipcRenderer.send('log', 'ORNL Toolbox: Completed install request for baobab', 'info')
//Open baobab
openDiskUsageAnalyzer()
baobabClose()
}
function baobabClose() {
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
ipcRenderer.send('close minor window')
ipcRenderer.send('log', `ORNL Toolbox: Baobab checkpoint closed`, 'info')
}
......@@ -10,10 +10,12 @@
<script src="../miscjs/openURL.js"></script>
<script src="../miscjs/launchBomgar.js"></script>
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../softwareManagement/softwareCheckpoint/softwareCheckpoint.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="../badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
<script src="../badgeManagement/badgeMinder/badgeInstallCheckpoint/badgeInstallCheckpoint.js"></script>
<script src="./localDriveUsage/localDriveUsage.js"></script>
<script src="./baobabCheckpoint/baobabCheckpoint.js"></script>
<script src="./addPassphrase/addPassphrase.js"></script>
<script src="./removePassphrase/removePassphrase.js"></script>
<script src="../miscjs/notImplemented.js"></script>
......@@ -47,7 +49,7 @@
<div id="buttons" onclick="addWinMain('./fileSystemManagement/registerRecoveryKey/registerRecoveryKey.html', 'Register Recovery Key', 325, 180)"><font color="white">Register Recovery Key</font></div>
</span>
<span title="Opens the Disk Usage Analyzer application for seeing the current contents of system drives">
<div id="buttons" onclick="openDiskUsageAnalyzer()"><font color="white">Local Drive Usage</font></div>
<div id="buttons" onclick="baobabCheckpoint()"><font color="white">Local Drive Usage</font></div>
</span>
<span title="">
<div id="buttons" onclick="driveHealthCheck()"><font color="white">Drive Health Check</font></div>
......
function openDiskUsageAnalyzer() { //Open Disk Usage Analyzer application
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
if(!exec) var exec = require('child_process').exec
ipcRenderer.send('log', 'ORNL Toolbox: Submitted Local Drive Usage request', 'info')
......
......@@ -13,6 +13,7 @@
<script src="./its/its.js"></script>
<script src="./softwareManagement/softwareManagement.js"></script>
<script src="./softwareManagement/openSoftware/openSoftware.js"></script>
<script src="./softwareManagement/softwareCheckpoint/softwareCheckpoint.js"></script>
<script src="./miscjs/openURL.js"></script>
<script src="./miscjs/launchBomgar.js"></script>
<script src="./badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
......@@ -27,6 +28,7 @@
<script src="./fileSystemManagement/addPassphrase/addPassphrase.js"></script>
<script src="./fileSystemManagement/removePassphrase/removePassphrase.js"></script>
<script src="./fileSystemManagement/driveHealthCheck/driveHealthCheck.js"></script>
<script src="./fileSystemManagement/baobabCheckpoint/baobabCheckpoint.js"></script>
<script src="./miscjs/installedCheck.js"></script>
</head>
<body onload="load()">
......
......@@ -10,6 +10,7 @@
<script src="../miscjs/openURL.js"></script>
<script src="../miscjs/launchBomgar.js"></script>
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../softwareManagement/softwareCheckpoint/softwareCheckpoint.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="../badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
<script src="../badgeManagement/badgeMinder/badgeInstallCheckpoint/badgeInstallCheckpoint.js"></script>
......@@ -17,6 +18,7 @@
<script src="../fileSystemManagement/addPassphrase/addPassphrase.js"></script>
<script src="../fileSystemManagement/removePassphrase/removePassphrase.js"></script>
<script src="../fileSystemManagement/driveHealthCheck/driveHealthCheck.js"></script>
<script src="../fileSystemManagement/baobabCheckpoint/baobabCheckpoint.js"></script>
</head>
<body>
<div class="heading">
......
......@@ -37,7 +37,7 @@ ipcRenderer.on('launchBomgar', () => {
})
ipcRenderer.on('openInstaller', () => {
openSoftware(0)
softwareCheckpoint()
})
ipcRenderer.on('openUpdater', () => {
......@@ -45,7 +45,7 @@ ipcRenderer.on('openUpdater', () => {
})
ipcRenderer.on('openDriveUsage', () => {
openDiskUsageAnalyzer()
baobabCheckpoint()
})
ipcRenderer.on('openAbout', () => {
......
......@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Badge Minder Checkpoint</title>
<title>Software Checkpoint</title>
<link rel="stylesheet" href="./softwareCheckpoint.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<script src="../../miscjs/addWindow.js"></script>
......@@ -17,7 +17,7 @@
Gnome-Software. Would you like to install it?
</div>
<div class="softwareCheckpointButtonsContent">
<span title="Click 'Install' to install gnome-screensaver, which is required for Badge Minder">
<span title="Click 'Install' to install gnome-software, which is required for 'Install Software'">
<input type="submit" class="softwareCheckpointButtons" value="Install" onclick="softwareCheckpointConfirm()">
</span>
<span title="Click 'Close' to close this current window and decline the installation.">
......
......@@ -19,6 +19,7 @@
<script src="../fileSystemManagement/addPassphrase/addPassphrase.js"></script>
<script src="../fileSystemManagement/removePassphrase/removePassphrase.js"></script>
<script src="../fileSystemManagement/driveHealthCheck/driveHealthCheck.js"></script>
<script src="../fileSystemManagement/baobabCheckpoint/baobabCheckpoint.js"></script>
<script src="../miscjs/installedCheck.js"></script>
</head>
<body onload="loadSoftwareBadges()">
......
......@@ -29,6 +29,7 @@ function sudoManagement() { //Save checkbox setting for the selected user
function sudoManagementLoad() { //Loading the users
if(!execSync) var execSync = require('child_process').execSync
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
//Adding the options of the dropdown menu
var optionValue = 1
......@@ -48,6 +49,7 @@ function sudoManagementLoad() { //Loading the users
//Checking if user is sudo and checking the box if so
function sudoManagementCheckIfSudo() {
if(!execSync) var execSync = require('child_process').execSync
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
//Grab the user
var dropdown = document.getElementById('sudoManagementUserSelect')
......
......@@ -10,6 +10,7 @@
<script src="../miscjs/openURL.js"></script>
<script src="../miscjs/launchBomgar.js"></script>
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../softwareManagement/softwareCheckpoint/softwareCheckpoint.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="../badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
<script src="../badgeManagement/badgeMinder/badgeInstallCheckpoint/badgeInstallCheckpoint.js"></script>
......@@ -17,6 +18,7 @@
<script src="../fileSystemManagement/addPassphrase/addPassphrase.js"></script>
<script src="../fileSystemManagement/removePassphrase/removePassphrase.js"></script>
<script src="../fileSystemManagement/driveHealthCheck/driveHealthCheck.js"></script>
<script src="../fileSystemManagement/baobabCheckpoint/baobabCheckpoint.js"></script>
<script src="../miscjs/installedCheck.js"></script>
</head>
<body>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment