Skip to content

Commit

Permalink
improved current implementation
Browse files Browse the repository at this point in the history
improved current implementation of policy deployment page.
  • Loading branch information
HotCakeX committed Dec 22, 2024
1 parent e43d30c commit d49149f
Show file tree
Hide file tree
Showing 4 changed files with 358 additions and 138 deletions.
3 changes: 3 additions & 0 deletions AppControl Manager/Pages/CreatePolicy.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,9 @@ private async void RecommendedDriverBlockRulesScheduledAutoUpdate_Click(object s

RecommendedDriverBlockRulesInfoBar.IsClosable = true;

// Expand the settings card to make the InfoBar visible
RecommendedDriverBlockRulesSettings.IsExpanded = true;

if (errorsOccurred)
{
RecommendedDriverBlockRulesInfoBar.Severity = InfoBarSeverity.Error;
Expand Down
2 changes: 1 addition & 1 deletion AppControl Manager/Pages/CreateSupplementalPolicy.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ await Task.Run(() =>

foreach (string certificate in CertificatesBasedCertFilePaths)
{
// Create a certificate object from the .cer file
// Create a certificate object from the .cer file
X509Certificate2 CertObject = X509CertificateLoader.LoadCertificateFromFile(certificate);

// Create rule for the certificate based on the first element in its chain
Expand Down
163 changes: 123 additions & 40 deletions AppControl Manager/Pages/Deployment.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:tk7controls="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:animatedvisuals="using:AnimatedVisuals"
mc:Ignorable="d">

<Page.Resources>
Expand All @@ -29,7 +30,6 @@
<ScrollViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
Expand All @@ -50,72 +50,155 @@
<controls:WrapPanel Grid.Row="0" VerticalSpacing="4" HorizontalSpacing="4" Orientation="Vertical" Margin="6,10,6,10">

<TextBlock
TextWrapping="WrapWholeWords"
Style="{StaticResource BodyTextBlockStyle}">

<Span>
Deploy <Bold>unsigned</Bold> <Run Foreground="{ThemeResource SystemAccentColor}">App Control</Run> Policies.
</Span>
TextWrapping="WrapWholeWords"
Style="{StaticResource BodyTextBlockStyle}">
<Span>
Deploy <Bold>any type </Bold> of <Run Foreground="{ThemeResource SystemAccentColor}">App Control</Run> Policy.
</Span>
</TextBlock>

<HyperlinkButton Content="Guide" NavigateUri="https://github.com/HotCakeX/Harden-Windows-Security/wiki/Deploy-App-Control-Policy" />

</controls:WrapPanel>

<Button Grid.Row="1" HorizontalAlignment="Center" x:Name="DeployButton"
HorizontalContentAlignment="Center" Margin="15" Click="DeployButton_Click">
<Button.Content>
<StackPanel Orientation="Horizontal">
<ProgressRing Visibility="Collapsed" x:Name="ProgressRing" Margin="5,5,15,5" Value="0" IsIndeterminate="True" Minimum="0" Maximum="100"/>

<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<FontIcon Glyph="&#xE8B6;" Margin="5" />
<TextBlock Text="Deploy" Margin="5"/>
</StackPanel>

</StackPanel>
</Button.Content>
</Button>

<TeachingTip x:Name="DeployButtonTeachingTip"
Target="{x:Bind DeployButton}"
Title="No File was selected"
Subtitle="You need to select some files to deploy first.">
</TeachingTip>

<InfoBar
x:Name="StatusInfoBar"
IsOpen="False"
Visibility="Collapsed"
Severity="Informational"
Grid.Row="2">

Grid.Row="1">
<InfoBar.Content>
<ProgressBar Margin="0,0,0,15" Visibility="Collapsed" x:Name="MainProgressRing" Value="0" IsIndeterminate="True" Minimum="0" Maximum="100"/>
</InfoBar.Content>
</InfoBar>


<StackPanel HorizontalAlignment="Stretch"
Spacing="{StaticResource SettingsCardSpacing}" Grid.Row="3" Margin="0,40,0,0">
Spacing="{StaticResource SettingsCardSpacing}" Grid.Row="2" Margin="0,40,0,0">

<win:StackPanel.ChildrenTransitions>
<win:EntranceThemeTransition FromVerticalOffset="50" />
<win:RepositionThemeTransition IsStaggeringEnabled="False" />
</win:StackPanel.ChildrenTransitions>

<controls:SettingsCard x:Name="BrowseForXMLPolicyFilesSettingsCard"
Description="Browse for XML policy file(s) to deploy on the system"
Header="Select XML policy file(s)"
HeaderIcon="{ui:FontIcon Glyph=&#xE8E5;}" IsClickEnabled="True" IsActionIconVisible="False" Click="BrowseForXMLPolicyFilesSettingsCard_Click">
<controls:SettingsCard
Description="Browse for unsigned XML policy file(s) to deploy on the system"
Header="Select unsigned XML policy file(s)"
HeaderIcon="{ui:FontIcon Glyph=&#xE8E5;}" IsClickEnabled="False" IsActionIconVisible="False">

<controls:WrapPanel HorizontalSpacing="15" VerticalSpacing="15">

<Button x:Name="BrowseForXMLPolicyFilesButton" Click="BrowseForXMLPolicyFilesButton_Click">
<Button.Content>
<controls:WrapPanel Orientation="Horizontal">

<AnimatedIcon x:Name="UnsignedXMLFilesLightAnimatedIcon" Height="20" Margin="0,0,5,0" Width="20">
<AnimatedIcon.Source>
<animatedvisuals:Light/>
</AnimatedIcon.Source>
</AnimatedIcon>

<TextBlock Text="Browse" />

</controls:WrapPanel>
</Button.Content>

<Button.Flyout>
<Flyout x:Name="BrowseForXMLPolicyFilesButton_Flyout">

<controls:WrapPanel Orientation="Vertical" HorizontalSpacing="15" VerticalSpacing="15">

<Button Content="Clear" Click="BrowseForXMLPolicyFilesButton_Flyout_Clear_Click" />

<TextBlock Text="View the XML files you selected." TextWrapping="WrapWholeWords" />

<TextBox x:Name="BrowseForXMLPolicyFilesButton_SelectedFilesTextBox"
TextWrapping="Wrap" AcceptsReturn="True" IsSpellCheckEnabled="False"
SelectionHighlightColor="Pink" MinWidth="400" IsReadOnly="True" />

</controls:WrapPanel>

</Flyout>
</Button.Flyout>

</Button>

<Button Content="Browse" x:Name="BrowseForXMLPolicyFilesButton" Click="BrowseForXMLPolicyFilesButton_Click" />
<Button HorizontalAlignment="Center" x:Name="DeployUnsignedXMLButton"
HorizontalContentAlignment="Center" Click="DeployUnsignedXMLButton_Click">
<Button.Content>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<FontIcon Glyph="&#xE8B6;" Margin="0,0,8,0" />
<TextBlock Text="Deploy"/>
</StackPanel>
</StackPanel>
</Button.Content>

</Button>

<TeachingTip x:Name="DeployUnsignedXMLButtonTeachingTip"
Target="{x:Bind DeployUnsignedXMLButton}"
Title="No File was selected"
Subtitle="You need to select unsigned XML files to deploy first.">
</TeachingTip>

</controls:WrapPanel>

</controls:SettingsCard>

<controls:SettingsCard x:Name="BrowseForCIPBinaryFilesSettingsCard"
Description="Browse for CIP Binary file(s) to deploy on the system"
Header="Select CIP Binary file(s)"
HeaderIcon="{ui:FontIcon Glyph=&#xE8E5;}" IsClickEnabled="True" IsActionIconVisible="False" Click="BrowseForCIPBinaryFilesSettingsCard_Click" >
<controls:SettingsCard
Description="Browse for CIP Binary file(s) to deploy on the system"
Header="Select CIP Binary file(s)"
HeaderIcon="{ui:FontIcon Glyph=&#xE8E5;}" IsClickEnabled="False" IsActionIconVisible="False" >

<controls:WrapPanel HorizontalSpacing="15" VerticalSpacing="15">

<Button x:Name="BrowseForCIPBinaryFilesButton" Content="Browse" Click="BrowseForCIPBinaryFilesButton_Click">

<Button.Flyout>
<Flyout x:Name="BrowseForCIPBinaryFilesButton_Flyout">

<controls:WrapPanel Orientation="Vertical" HorizontalSpacing="15" VerticalSpacing="15">

<Button Content="Clear" Click="BrowseForCIPBinaryFilesButton_Flyout_Clear_Click" />

<TextBlock Text="View the CIP files you selected." TextWrapping="WrapWholeWords" />

<TextBox x:Name="BrowseForCIPBinaryFilesButton_SelectedFilesTextBox"
TextWrapping="Wrap" AcceptsReturn="True" IsSpellCheckEnabled="False"
SelectionHighlightColor="Pink" MinWidth="400" IsReadOnly="True" />

</controls:WrapPanel>

</Flyout>
</Button.Flyout>

</Button>


<Button HorizontalAlignment="Center" x:Name="DeployCIPButton"
HorizontalContentAlignment="Center" Click="DeployCIPButton_Click">
<Button.Content>
<StackPanel Orientation="Horizontal">

<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<FontIcon Glyph="&#xE8B6;" Margin="0,0,8,0" />
<TextBlock Text="Deploy"/>
</StackPanel>

</StackPanel>
</Button.Content>

</Button>

<TeachingTip x:Name="DeployCIPButtonTeachingTip"
Target="{x:Bind DeployCIPButton}"
Title="No File was selected"
Subtitle="You need to select CIP files to deploy first.">
</TeachingTip>

<Button Content="Browse" x:Name="BrowseForCIPBinaryFilesButton" Click="BrowseForCIPBinaryFilesButton_Click" />
</controls:WrapPanel>

</controls:SettingsCard>

Expand Down
Loading

0 comments on commit d49149f

Please sign in to comment.