This file contains hidden or 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
# Remove any orphaned rsyslog.pid | |
rm -f /var/run/rsyslogd.pid | |
# Start Rsyslog | |
/usr/sbin/rsyslogd -n -f /etc/rsyslog.conf & |
This file contains hidden or 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
FROM safesecurity/rsyslog:8.2012.0 | |
RUN apk add inotify-tools | |
# Rsyslog Configuration file | |
COPY --chown=root:root rsyslog.conf /etc/rsyslog.conf | |
RUN chmod 0644 /etc/rsyslog.conf | |
# Copy and configure Entrypoint.sh | |
COPY entrypoint.sh /entrypoint.sh |
This file contains hidden or 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
inotifywait --quiet --monitor --event CLOSE_WRITE /etc/rsyslog.d/rsyslog.conf \ | |
| while read change; do | |
echo "[DEBUG] - `(date +%F\ %T)` - rsyslog daemon reload start" | |
if [ -f /var/run/rsyslogd.pid ] && kill -TERM $(cat /var/run/rsyslogd.pid); then | |
/usr/sbin/rsyslogd -f /etc/rsyslog.d/rsyslog.conf | |
else | |
/usr/sbin/rsyslogd -f /etc/rsyslog.d/rsyslog.conf | |
fi | |
echo "[DEBUG] - `(date +%F\ %T)` - rsyslog daemon reload complete" | |
done |
This file contains hidden or 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
if [ -f /var/run/rsyslogd.pid ] && kill -TERM $(cat /var/run/rsyslogd.pid); then | |
/usr/sbin/rsyslogd -f /etc/rsyslog.d/rsyslog.conf | |
else | |
/usr/sbin/rsyslogd -f /etc/rsyslog.d/rsyslog.conf | |
fi | |
echo "[DEBUG] - `(date +%F\ %T)` - rsyslog daemon reload complete" |
This file contains hidden or 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
inotifywait --quiet --monitor --event CLOSE_WRITE /etc/rsyslog.d/rsyslog.conf \ | |
| while read change; do | |
echo "[DEBUG] - `(date +%F\ %T)` - rsyslog daemon reload start" | |
done |
This file contains hidden or 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
for (i=0 -> permissions_to_be_checked.length) { | |
if (permissions_to_be_checked[i] in allowed_permissions) { | |
return { | |
status: true, | |
message: "Authorized" | |
} | |
} | |
} | |
return { | |
status: false, |
This file contains hidden or 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
// read url_permission.js file | |
url_permission = parse(open("url_permission.js")) | |
permissions_to_be_checked = url_permission["assignments/submit"] | |
// it returns permissions_to_be_checked = ["submit_assignment"] |
This file contains hidden or 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
//pseudo mysql query | |
all_permissions = query("SELECT id, name FROM Permissions") | |
// it returns all_permissions = [ | |
[1, "start_class"], | |
[2, "end_class"], | |
[3, "submit_assignment"], | |
[4, "evaluate_assignment"] | |
] | |
allowed_permissions = [] | |
// pseudo code to evaluate allowed_permissions |
This file contains hidden or 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
//pseudo mysql query | |
permissions_status = query(`SELECT permissions_status from Policy where id=${policy_id}`) | |
// it returns permissions_status = "0010" |
This file contains hidden or 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
//pseudo mysql query | |
policy_id = query(`SELECT policy_id from Role_Policy_Map where role_id=${role_id}`) | |
// it returns policy_id = 1 |
NewerOlder