Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration patches for himmelblau on Debian #223

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions platform/debian/himmelblau_sshd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
KbdInteractiveAuthentication yes
15 changes: 11 additions & 4 deletions platform/debian/scripts/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -e

# Apply the patch that allows pam_himmelblau to r/w the himmelblaud socket
patch -F 2 /etc/apparmor.d/unix-chkpwd << 'EOF'
# Define the patch content using cat command
UNIX_CHKPWD_PATCH=$(cat << 'EOF'
--- /etc/apparmor.d/unix-chkpwd 2024-10-07 13:41:33.143303700 -0600
+++ /etc/apparmor.d/unix-chkpwd 2024-10-07 13:36:55.740827834 -0600
@@ -11,7 +11,7 @@
Expand All @@ -16,6 +16,13 @@ patch -F 2 /etc/apparmor.d/unix-chkpwd << 'EOF'
include <abstractions/nameservice>

EOF
)

# Reload the AppArmor profile to apply the changes
sudo apparmor_parser -r /etc/apparmor.d/unix-chkpwd
# Check if the file /etc/apparmor.d/unix-chkpwd exists
if [[ -f /etc/apparmor.d/unix-chkpwd ]]; then
# Apply the patch using the patch command
echo "$UNIX_CHKPWD_PATCH" | patch --fuzz 2 --silent --forward -p0 /etc/apparmor.d/unix-chkpwd

# Reload the AppArmor profile to apply the changes
sudo apparmor_parser -r /etc/apparmor.d/unix-chkpwd
fi
19 changes: 13 additions & 6 deletions platform/debian/scripts/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

set -e

# Unapply the patch from /etc/apparmor.d/unix-chkpwd
patch -F 2 -R /etc/apparmor.d/unix-chkpwd << 'EOF'
--- /etc/apparmor.d/unix-chkpwd 2024-10-07 13:36:55.740827834 -0600
+++ /etc/apparmor.d/unix-chkpwd 2024-10-07 13:41:33.143303700 -0600
# Define the patch content using cat command
UNIX_CHKPWD_PATCH=$(cat << 'EOF'
--- /etc/apparmor.d/unix-chkpwd 2024-10-07 13:41:33.143303700 -0600
+++ /etc/apparmor.d/unix-chkpwd 2024-10-07 13:36:55.740827834 -0600
@@ -11,7 +11,7 @@

include <tunables/global>
Expand All @@ -16,6 +16,13 @@ patch -F 2 -R /etc/apparmor.d/unix-chkpwd << 'EOF'
include <abstractions/nameservice>

EOF
)

# Reload the AppArmor profile to apply the changes
sudo apparmor_parser -r /etc/apparmor.d/unix-chkpwd
# Check if the file /etc/apparmor.d/unix-chkpwd exists
if [[ -f /etc/apparmor.d/unix-chkpwd ]]; then
# Reverse the patch using the patch command
echo "$UNIX_CHKPWD_PATCH" | patch --fuzz 2 --silent --reverse -p0 /etc/apparmor.d/unix-chkpwd

# Reload the AppArmor profile to apply the changes
sudo apparmor_parser -r /etc/apparmor.d/unix-chkpwd
fi
1 change: 1 addition & 0 deletions src/pam/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ assets = [
["target/release/libpam_himmelblau.so", "usr/lib/x86_64-linux-gnu/security/pam_himmelblau.so", "755"],
["../../platform/debian/pam-config", "usr/share/pam-configs/himmelblau", "644"],
["../../platform/debian/apparmor.unix-chkpwd.local", "etc/apparmor.d/local/unix-chkpwd", "644"],
["../../platform/debian/himmelblau_sshd.conf", "/etc/ssh/sshd_config.d/himmelblau.conf", "644"],
]
maintainer-scripts = "../../platform/debian/scripts"
Loading