|
97 | 97 | GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/bogus", |
98 | 98 | ), |
99 | 99 | }, |
100 | | -{ |
101 | | - type => "config", |
102 | | - comment => "SecAuditLogType Concurrent", |
103 | | - conf => qq( |
104 | | - SecAuditEngine On |
105 | | - SecAuditLog $ENV{AUDIT_LOG} |
106 | | - SecAuditLogType Concurrent |
107 | | - SecAuditLogStorageDir "$ENV{LOGS_DIR}/audit" |
108 | | - ), |
109 | | - test => sub { |
110 | | - ### Perl code to parse the audit log entry and verify |
111 | | - ### that the concurrent audit log exists and contains |
112 | | - ### the correct data. |
113 | | - ### |
114 | | - ### TODO: Need some API for this :) |
115 | | - ### |
116 | | - ### FIXME: Just workable with apache, the timing to load auditlog from nginx |
117 | | - ### is not correct, so the test is failing even when it should pass. |
118 | | - ### Disabling it for now until we figure out a way to handle that. |
119 | | - |
120 | | - # Parse log |
121 | | - #my $alogre = qr/^(?:\S+)\ (?:\S+)\ (?:\S+)\ (?:\S+)\ \[(?:[^:]+):(?:\d+:\d+:\d+)\ (?:[^\]]+)\]\ \"(?:.*)\"\ (?:\d+)\ (?:\S+)\ \"(?:.*)\"\ \"(?:.*)\"\ (\S+)\ \"(?:.*)\"\ (\S+)\ (?:\d+)\ (?:\d+)\ (?:\S+)(?:.*)$/m; |
122 | | - #my $alog = match_log("audit", $alogre, 1); |
123 | | - #chomp $alog; |
124 | | - #dbg("Alog: $alog\n"); |
125 | | - #my @log = ($alog =~ m/$alogre/); |
126 | | - #my($id, $fn) = ($log[0], $log[1]); |
127 | | - #if (!$id or !$fn) { |
128 | | - #dbg("LOG ENTRY: $alog"); |
129 | | - #die "Failed to parse audit log: $ENV{AUDIT_LOG}\n"; |
130 | | - #} |
131 | | - |
132 | | - # Verify concurrent log exists |
133 | | - #my $alogdatafn = "$ENV{LOGS_DIR}/audit$fn"; |
134 | | - #if (! -e "$alogdatafn") { |
135 | | - #die "Audit log does not exist: $alogdatafn\n"; |
136 | | - #} |
137 | | - |
138 | | - # Verify concurrent log contents |
139 | | - #if (defined match_file($alogdatafn, qr/^--[^-]+-A--.*$id.*-Z--$/s)) { |
140 | | - #return 0; |
141 | | - #} |
142 | | - |
143 | | - # Error |
144 | | - #dbg("LOGDATA: \"$FILE{$alogdatafn}{buf}\""); |
145 | | - #die "Audit log data did not match.\n"; |
146 | | - return 0; |
147 | | - }, |
148 | | - match_response => { |
149 | | - status => qr/^200$/, |
150 | | - }, |
151 | | - request => new HTTP::Request( |
152 | | - GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt", |
153 | | - ), |
154 | | -}, |
155 | 100 |
|
156 | 101 | # SecAuditLogRelevantStatus |
157 | 102 | { |
|
0 commit comments