-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11874 from mpurg/ubuntu_dconf_enable_profiles
Enable dconf profiles in Ubuntu CIS/STIG profiles
- Loading branch information
Showing
12 changed files
with
144 additions
and
5 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
linux_os/guide/system/software/gnome/enable_dconf_user_profile/bash/shared.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# platform = multi_platform_sle,multi_platform_ubuntu | ||
# platform = multi_platform_sle | ||
|
||
echo -e 'user-db:user\nsystem-db:gdm' > /etc/dconf/profile/gdm |
18 changes: 18 additions & 0 deletions
18
linux_os/guide/system/software/gnome/enable_dconf_user_profile/bash/ubuntu.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# platform = multi_platform_ubuntu | ||
|
||
# configure two dconf profiles: | ||
# - gdm: required for banner/user_list settings | ||
# - use': required for screenlock,automount,ctrlaltdel,... settings | ||
gdm_profile_path=/etc/dconf/profile/gdm | ||
user_profile_path=/etc/dconf/profile/user | ||
|
||
mkdir -p /etc/dconf/profile | ||
[[ -e "$gdm_profile_path" ]] || echo > "$gdm_profile_path" | ||
[[ -e "$user_profile_path" ]] || echo > "$user_profile_path" | ||
|
||
if ! grep -Pzq "(?s)^\s*user-db:user.*\n\s*system-db:gdm" "$gdm_profile_path"; then | ||
sed -i --follow-symlinks "1s/^/user-db:user\nsystem-db:gdm\n/" "$gdm_profile_path" | ||
fi | ||
if ! grep -Pzq "(?s)^\s*user-db:user.*\n\s*system-db:local" "$user_profile_path"; then | ||
sed -i --follow-symlinks "1s/^/user-db:user\nsystem-db:local\n/" "$user_profile_path" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
linux_os/guide/system/software/gnome/enable_dconf_user_profile/oval/ubuntu.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<def-group> | ||
<definition class="compliance" id="{{{ rule_id }}}" version="1"> | ||
{{{ oval_metadata("The DConf User and gdm profiles should have the correct DB configured.") }}} | ||
<criteria operator="OR"> | ||
<extend_definition comment="dconf installed" definition_ref="package_dconf_installed" negate="true" /> | ||
<criteria operator="AND"> | ||
<criterion comment="dconf gdm profile exists" test_ref="test_dconf_gdm_profile" /> | ||
<criterion comment="dconf user profile exists" test_ref="test_dconf_user_profile" /> | ||
</criteria> | ||
</criteria> | ||
</definition> | ||
|
||
<ind:textfilecontent54_test check="all" check_existence="all_exist" | ||
comment="dconf gdm profile exists and uses gdm.d database" | ||
id="test_dconf_gdm_profile" version="1"> | ||
<ind:object object_ref="obj_dconf_gdm_profile" /> | ||
</ind:textfilecontent54_test> | ||
|
||
<ind:textfilecontent54_object id="obj_dconf_gdm_profile" version="1"> | ||
<ind:filepath>/etc/dconf/profile/gdm</ind:filepath> | ||
<ind:pattern operation="pattern match">(?ms)^\s*user-db:user\s*.*\n\s*system-db:gdm\s*$</ind:pattern> | ||
<ind:instance datatype="int">1</ind:instance> | ||
</ind:textfilecontent54_object> | ||
|
||
<ind:textfilecontent54_test check="all" check_existence="all_exist" | ||
comment="dconf user profile exists and uses local.d database" | ||
id="test_dconf_user_profile" version="1"> | ||
<ind:object object_ref="obj_dconf_user_profile" /> | ||
</ind:textfilecontent54_test> | ||
|
||
<ind:textfilecontent54_object id="obj_dconf_user_profile" version="1"> | ||
<ind:filepath>/etc/dconf/profile/user</ind:filepath> | ||
<ind:pattern operation="pattern match">(?ms)^\s*user-db:user\s*.*\n\s*system-db:local\s*$</ind:pattern> | ||
<ind:instance datatype="int">1</ind:instance> | ||
</ind:textfilecontent54_object> | ||
|
||
</def-group> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
linux_os/guide/system/software/gnome/enable_dconf_user_profile/tests/commented.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
cat > /etc/dconf/profile/gdm <<EOF | ||
#user-db:user | ||
system-db:gdm | ||
EOF | ||
|
||
cat > /etc/dconf/profile/user <<EOF | ||
user-db:user | ||
#system-db:local | ||
EOF |
12 changes: 12 additions & 0 deletions
12
linux_os/guide/system/software/gnome/enable_dconf_user_profile/tests/correct.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
cat > /etc/dconf/profile/gdm <<EOF | ||
user-db:user | ||
system-db:gdm | ||
EOF | ||
|
||
cat > /etc/dconf/profile/user <<EOF | ||
user-db:user | ||
system-db:local | ||
EOF |
22 changes: 22 additions & 0 deletions
22
linux_os/guide/system/software/gnome/enable_dconf_user_profile/tests/correct_messy.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
cat > /etc/dconf/profile/gdm <<EOF | ||
# this | ||
user-db:user | ||
# is | ||
# really | ||
# messy | ||
# system-db:gdm | ||
system-db:gdm | ||
# stuff | ||
EOF | ||
|
||
cat > /etc/dconf/profile/user <<EOF | ||
user-db:user | ||
system-db:site | ||
system-db:distro | ||
system-db:local | ||
EOF |
5 changes: 5 additions & 0 deletions
5
linux_os/guide/system/software/gnome/enable_dconf_user_profile/tests/missing.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
rm -f /etc/dconf/profile/gdm | ||
rm -f /etc/dconf/profile/user |
12 changes: 12 additions & 0 deletions
12
linux_os/guide/system/software/gnome/enable_dconf_user_profile/tests/wrong.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
cat > /etc/dconf/profile/gdm <<EOF | ||
user-db:user | ||
system-db:local | ||
EOF | ||
|
||
cat > /etc/dconf/profile/user <<EOF | ||
user-db:user | ||
system-db:gdm | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters