Improve control over audit log reporting

This commit is contained in:
Richard Frith-Macdonald 2018-07-30 20:20:14 +01:00
parent 76dca3563b
commit 7a32f7fe60
2 changed files with 42 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2018-07-30 Richard Frith-Macdonald <rfm@gnu.org>
EcControl.m: Add option to turn on/off audito log reporting in Console
and make it off by default.
2018-06-26 armando.pesentigritti@theengagehub.com
EcControl.m: Make some events audit logs where they might be security

View file

@ -181,6 +181,7 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
BOOL warnings;
BOOL errors;
BOOL alerts;
BOOL audits;
}
- (id) initFor: (id)o
name: (NSString*)n
@ -189,12 +190,14 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
- (NSString*) chost;
- (NSString*) cserv;
- (BOOL) getAlerts;
- (BOOL) getAudits;
- (BOOL) getErrors;
- (BOOL) getGeneral;
- (BOOL) getWarnings;
- (NSString*) pass;
- (NSString*) promptAfter: (NSString*)msg;
- (void) setAlerts: (BOOL)flag;
- (void) setAudits: (BOOL)flag;
- (void) setConnectedHost: (NSString*)c;
- (void) setConnectedServ: (NSString*)c;
- (void) setErrors: (BOOL)flag;
@ -227,6 +230,11 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
return alerts;
}
- (BOOL) getAudits
{
return audits;
}
- (BOOL) getErrors
{
return errors;
@ -256,6 +264,7 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
general = NO;
warnings = NO;
alerts = YES;
audits = NO;
errors = YES;
}
return self;
@ -291,6 +300,11 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
alerts = flag;
}
- (void) setAudits: (BOOL)flag
{
audits = flag;
}
- (void) setConnectedHost: (NSString*)c
{
ASSIGNCOPY(chost, c);
@ -1052,6 +1066,8 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
@" displays error messages.\n"
@" set display alerts\n"
@" displays alert messages.\n"
@" set display audits\n"
@" displays audit messages.\n"
@"\n";
}
else if (comp(wd, @"Status") >= 0)
@ -1083,6 +1099,7 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
@" unset display warnings\n"
@" unset display errors\n"
@" unset display alerts\n"
@" unset display audits\n"
@"\n";
}
}
@ -1284,14 +1301,20 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
if ([wd length] == 0)
{
m = [NSString stringWithFormat: @"display settings -\n"
@"general: %d warnings: %d errors: %d alerts: %d\n",
@"general: %d warnings: %d errors: %d alerts: %d"
@" alerts: %d\n",
[console getGeneral], [console getWarnings],
[console getErrors], [console getAlerts]];
[console getErrors], [console getAlerts],
[console getAudits]];
}
else if (comp(wd, @"alerts") >= 0)
{
[console setAlerts: YES];
}
else if (comp(wd, @"audits") >= 0)
{
[console setAudits: YES];
}
else if (comp(wd, @"errors") >= 0)
{
[console setErrors: YES];
@ -1416,14 +1439,20 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
if ([wd length] == 0)
{
m = [NSString stringWithFormat: @"display settings -\n"
@"general: %d warnings: %d errors: %d alerts: %d\n",
@"general: %d warnings: %d errors: %d alerts: %d"
@" audits: %d\n",
[console getGeneral], [console getWarnings],
[console getErrors], [console getAlerts]];
[console getErrors], [console getAlerts],
[console getAudits]];
}
else if (comp(wd, @"alerts") >= 0)
{
[console setAlerts: NO];
}
else if (comp(wd, @"audits") >= 0)
{
[console setAudits: NO];
}
else if (comp(wd, @"errors") >= 0)
{
[console setErrors: NO];
@ -1724,6 +1753,10 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
{
continue;
}
else if (t == LT_AUDIT && [c getAudits] == NO)
{
continue;
}
NS_DURING
{