Update NewBoxWizard.cpp

This commit is contained in:
DavidXanatos 2023-04-15 15:14:52 +02:00
parent 4991418040
commit 9bc4ee31d0
1 changed files with 20 additions and 0 deletions

View File

@ -125,6 +125,9 @@ SB_STATUS CNewBoxWizard::TryToCreateBox()
if(field("msiServer").toBool())
pBox->SetBool("MsiInstallerExemptions", true);
if(field("boxToken").toBool())
pBox->SetBool("SandboxieLogon", true);
if (field("boxVersion").toInt() == 1) {
if (theConf->GetBool("Options/WarnDeleteV2", true)) {
bool State = false;
@ -225,6 +228,7 @@ CBoxTypePage::CBoxTypePage(bool bAlowTemp, QWidget *parent)
registerField("autoRemove", pTemp);
m_pAdvanced = new QCheckBox(tr("Configure advanced options"));
m_pAdvanced->setChecked(theConf->GetBool("Options/AdvancedBoxWizard", false));
layout->addWidget(m_pAdvanced, row++, 2);
connect(m_pAdvanced, SIGNAL(toggled(bool)), this, SLOT(OnAdvanced()));
@ -460,6 +464,16 @@ CAdvancedPage::CAdvancedPage(QWidget *parent)
layout->addWidget(m_pMSIServer, row++, 1, 1, 3);
registerField("msiServer", m_pMSIServer);
QLabel* pBoxLabel = new QLabel(tr("Box Options"), this);
pBoxLabel->setFont(fnt);
layout->addWidget(pBoxLabel, row++, 0);
QCheckBox* pBoxToken = new QCheckBox(tr("Use a Sandboxie login instead of an anonymous token (experimental)"));
pBoxToken->setToolTip(tr("Using a custom Sandboxie Token allows to isolate individual sandboxes from each other better, and it shows in the user column of task managers the name of the box a process belongs to. Some 3rd party security solutions may however have problems with custom tokens."));
pBoxToken->setChecked(theConf->GetBool("BoxDefaults/BoxToken", false));
layout->addWidget(pBoxToken, row++, 1, 1, 3);
registerField("boxToken", pBoxToken);
setLayout(layout);
@ -469,6 +483,7 @@ CAdvancedPage::CAdvancedPage(QWidget *parent)
#endif
AddIconToLabel(pNetLabel, CSandMan::GetIcon("Network").pixmap(size,size));
AddIconToLabel(pAdminLabel, CSandMan::GetIcon("Shield9").pixmap(size,size));
AddIconToLabel(pBoxLabel, CSandMan::GetIcon("Sandbox").pixmap(size,size));
}
int CAdvancedPage::nextId() const
@ -556,6 +571,8 @@ void CSummaryPage::initializePage()
m_pSummary->append(tr("\nThis box will run the MSIServer (*.msi installer service) with a system token, this improves the compatibility but reduces the security isolation."));
else if(field("fakeAdmin").toBool())
m_pSummary->append(tr("\nProcesses in this box will think they are run with administrative privileges, without actually having them, hence installers can be used even in a security hardened box."));
else if(field("boxToken").toBool())
m_pSummary->append(tr("\nProcesses in this box will be running with a custom process token indicating the sandbox thay belong to."));
m_pSetDefault->setVisible(((CNewBoxWizard*)wizard())->m_bAdvanced);
}
@ -577,9 +594,12 @@ bool CSummaryPage::validatePage()
theConf->SetValue("BoxDefaults/FakeAdmin", field("fakeAdmin").toBool());
theConf->SetValue("BoxDefaults/MsiExemptions", field("msiServer").toBool());
theConf->SetValue("BoxDefaults/BoxToken", field("boxToken").toBool());
}
theConf->SetValue("Options/InstantBoxWizard", m_pSetInstant->isChecked());
theConf->SetValue("Options/AdvancedBoxWizard", ((CNewBoxWizard*)wizard())->m_bAdvanced);
SB_STATUS Status = ((CNewBoxWizard*)wizard())->TryToCreateBox();
if (Status.IsError()) {