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

Restrict read write access for credentials-fetcher #23

Merged
merged 1 commit into from
Oct 12, 2022
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
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ file(WRITE scripts/systemd/credentials-fetcher.service
"Description=credentials-fetcher systemd service unit file.\n\n"
"[Service]\n"
"ExecStartPre=mkdir -p ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStartPre=chmod 700 ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStartPre=chgrp ec2-user /var/credentials-fetcher ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStartPre=chmod 755 /var/credentials-fetcher ${CF_KRB_DIR} ${CF_UNIX_DOMAIN_SOCKET_DIR} ${CF_LOGGING_DIR}\n"
"ExecStart=/usr/sbin/credentials-fetcherd\n"
"ExecStartPost=chgrp ec2-user /var/credentials-fetcher/socket/credentials_fetcher.sock\n"
"ExecStartPost=chmod 660 /var/credentials-fetcher/socket/credentials_fetcher.sock\n"
"Environment=\"CREDENTIALS_FETCHERD_STARTED_BY_SYSTEMD=1\"\n"
"Type=notify\n"
"NotifyAccess=main\n"
Expand Down
5 changes: 4 additions & 1 deletion scripts/systemd/credentials-fetcher.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ Description=credentials-fetcher systemd service unit file.

[Service]
ExecStartPre=mkdir -p /var/credentials-fetcher/krbdir /var/credentials-fetcher/socket /var/credentials-fetcher/logging
ExecStartPre=chmod 700 /var/credentials-fetcher/krbdir /var/credentials-fetcher/socket /var/credentials-fetcher/logging
ExecStartPre=chgrp ec2-user /var/credentials-fetcher /var/credentials-fetcher/krbdir /var/credentials-fetcher/socket /var/credentials-fetcher/logging
ExecStartPre=chmod 755 /var/credentials-fetcher /var/credentials-fetcher/krbdir /var/credentials-fetcher/socket /var/credentials-fetcher/logging
ExecStart=/usr/sbin/credentials-fetcherd
ExecStartPost=chgrp ec2-user /var/credentials-fetcher/socket/credentials_fetcher.sock
ExecStartPost=chmod 660 /var/credentials-fetcher/socket/credentials_fetcher.sock
Environment="CREDENTIALS_FETCHERD_STARTED_BY_SYSTEMD=1"
Type=notify
NotifyAccess=main
Expand Down