Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
audit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ai
audit
Commits
cf59e2e0
Commit
cf59e2e0
authored
11 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
run auditd under his own separate user, not root
parent
3389b96f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
debian/ai-auditd.init
+6
-5
6 additions, 5 deletions
debian/ai-auditd.init
debian/ai-auditd.postinst
+31
-0
31 additions, 0 deletions
debian/ai-auditd.postinst
debian/localauditd.postinst
+1
-1
1 addition, 1 deletion
debian/localauditd.postinst
with
38 additions
and
6 deletions
debian/ai-auditd.init
+
6
−
5
View file @
cf59e2e0
...
@@ -18,6 +18,7 @@ DAEMON=/usr/sbin/$NAME
...
@@ -18,6 +18,7 @@ DAEMON=/usr/sbin/$NAME
DAEMON_ARGS
=
""
DAEMON_ARGS
=
""
PIDFILE
=
/var/run/
$NAME
.pid
PIDFILE
=
/var/run/
$NAME
.pid
SCRIPTNAME
=
/etc/init.d/
$NAME
SCRIPTNAME
=
/etc/init.d/
$NAME
USER
=
ai-auditd
# Exit if the package is not installed
# Exit if the package is not installed
[
-x
"
$DAEMON
"
]
||
exit
0
[
-x
"
$DAEMON
"
]
||
exit
0
...
@@ -42,9 +43,9 @@ do_start()
...
@@ -42,9 +43,9 @@ do_start()
# 0 if daemon has been started
# 0 if daemon has been started
# 1 if daemon was already running
# 1 if daemon was already running
# 2 if daemon could not be started
# 2 if daemon could not be started
start-stop-daemon
--start
--quiet
--background
--make-pidfile
--pidfile
$PIDFILE
--exec
$DAEMON
--test
>
/dev/null
\
start-stop-daemon
--start
--quiet
--background
--make-pidfile
--pidfile
$PIDFILE
--chuid
$USER
--exec
$DAEMON
--test
>
/dev/null
\
||
return
1
||
return
1
start-stop-daemon
--start
--quiet
--background
--make-pidfile
--pidfile
$PIDFILE
--exec
$DAEMON
--
\
start-stop-daemon
--start
--quiet
--background
--make-pidfile
--pidfile
$PIDFILE
--chuid
$USER
--exec
$DAEMON
--
\
$DAEMON_ARGS
\
$DAEMON_ARGS
\
||
return
2
||
return
2
# Add code here, if necessary, that waits for the process to be ready
# Add code here, if necessary, that waits for the process to be ready
...
@@ -62,7 +63,7 @@ do_stop()
...
@@ -62,7 +63,7 @@ do_stop()
# 1 if daemon was already stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# 2 if daemon could not be stopped
# other if a failure occurred
# other if a failure occurred
start-stop-daemon
--stop
--quiet
--retry
=
TERM/30/KILL/5
--pidfile
$PIDFILE
--name
$NAME
start-stop-daemon
--stop
--quiet
--retry
=
TERM/30/KILL/5
--pidfile
$PIDFILE
--user
$USER
--name
$NAME
RETVAL
=
"
$?
"
RETVAL
=
"
$?
"
[
"
$RETVAL
"
=
2
]
&&
return
2
[
"
$RETVAL
"
=
2
]
&&
return
2
# Wait for children to finish too if this is a daemon that forks
# Wait for children to finish too if this is a daemon that forks
...
@@ -71,8 +72,8 @@ do_stop()
...
@@ -71,8 +72,8 @@ do_stop()
# that waits for the process to drop all resources that could be
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# needed by services started subsequently. A last resort is to
# sleep for some time.
# sleep for some time.
start-stop-daemon
--stop
--quiet
--oknodo
--retry
=
0/30/KILL/5
--exec
$DAEMON
#
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[
"
$?
"
=
2
]
&&
return
2
#
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
# Many daemons don't delete their pidfiles when they exit.
rm
-f
$PIDFILE
rm
-f
$PIDFILE
return
"
$RETVAL
"
return
"
$RETVAL
"
...
...
This diff is collapsed.
Click to expand it.
debian/ai-auditd.postinst
0 → 100644
+
31
−
0
View file @
cf59e2e0
#!/bin/sh
# postinstall script for ai-audit.
case
"
$1
"
in
configure
)
if
!
getent user ai-auditd
>
/dev/null
;
then
adduser
--system
--home
/var/lib/auditd
--no-create-home
\
--disabled-password
ai-auditd
fi
mkdir
-p
/var/lib/auditd
chown
-R
ai-auditd:root /var/lib/auditd
chmod
0700 /var/lib/auditd
;;
abort-upgrade|abort-remove|abort-deconfigure
)
;;
*
)
echo
"postinst called with unknown argument
\`
$1
'"
>
&2
exit
1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit
0
This diff is collapsed.
Click to expand it.
debian/localauditd.postinst
100755 → 100644
+
1
−
1
View file @
cf59e2e0
...
@@ -10,7 +10,7 @@ configure)
...
@@ -10,7 +10,7 @@ configure)
if
!
getent user localaudit
>
/dev/null
;
then
if
!
getent user localaudit
>
/dev/null
;
then
adduser
--system
--home
/var/spool/audit
--no-create-home
\
adduser
--system
--home
/var/spool/audit
--no-create-home
\
--ingroup
audit localaudit
--disabled-password
--ingroup
audit localaudit
fi
fi
mkdir
-p
/var/spool/audit/incoming
mkdir
-p
/var/spool/audit/incoming
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment