-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Security Logging Plugin. #1125
Merged
richiware
merged 25 commits into
eProsima:master
from
canonical:feature/security-logging
Apr 14, 2020
Merged
Changes from 13 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
fa9250c
Add security logging (#1)
artivis 897dff2
Merge branch 'master' into feature/security-logging
artivis 79ee043
handle empty filename
artivis 5a4c971
post-master-merge fix
artivis c31bbe7
handle empty filename
artivis 9b02fe1
Merge branch 'master' into feature/security-logging
artivis 04dd0de
fix typo test filename
artivis e3b2151
fix linking error
artivis 9ffcf08
some doc fixes
artivis 6266390
some doc fixes
artivis 5bd340e
support logging in SecurityPluginFactory Mock
artivis 21c0a10
include log in security logging for macro support & cleanup
artivis 271c262
add missing source
artivis 5e099c1
replace 'library' includes with 'system'
artivis eeb656a
uncrustify
artivis 64b0d16
add log to file test
artivis 98fa09d
fix warnings
artivis b5ff52e
fix error msg typo
artivis f600b44
fix linking error
artivis 0d5b9b5
fix warning
artivis 430a0c2
add verbosity level to file logs
artivis 8f092fc
test file logs header
artivis 0598c11
use logging in Permission
artivis 14922df
use logging in PKIDH
artivis ed23fdd
use logging in SecurityManager
artivis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
57 changes: 57 additions & 0 deletions
57
include/fastdds/rtps/security/logging/BuiltinLoggingType.h
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright 2020 Canonical ltd. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/*! | ||
* @file BuiltinLoggingType.h | ||
*/ | ||
#ifndef _FASTDDS_RTPS_SECURITY_LOGGING_BUILTINLOGGINGTYPE_H_ | ||
#define _FASTDDS_RTPS_SECURITY_LOGGING_BUILTINLOGGINGTYPE_H_ | ||
|
||
#include "fastdds/rtps/common/Types.h" | ||
#include "fastdds/rtps/common/Time_t.h" | ||
#include "fastdds/rtps/security/logging/LoggingLevel.h" | ||
#include "fastdds/rtps/security/logging/NameValuePair.h" | ||
|
||
#include <map> | ||
|
||
namespace eprosima { | ||
namespace fastrtps { | ||
namespace rtps { | ||
namespace security { | ||
|
||
/** | ||
* @brief The BuiltinLoggingType struct | ||
* | ||
* @note Definition in DDS-Sec v1.1 9.6 | ||
*/ | ||
struct BuiltinLoggingType final { | ||
octet facility; // Set to 0x0A (10). Indicates sec/auth msgs | ||
LoggingLevel severity; | ||
rtps::Time_t timestamp; // Since epoch 1970-01-01 00:00:00 +0000 (UTC) | ||
std::string hostname; // IP host name of originator | ||
std::string hostip; // IP address of originator | ||
std::string appname; // Identify the device or application | ||
std::string procid; // Process name/ID for syslog system | ||
std::string msgid; // Identify the type of message | ||
std::string message; // Free-form message | ||
// Note that certain string keys (SD-IDs) are reserved by IANA | ||
std::map<std::string, NameValuePairSeq> structured_data; | ||
}; | ||
|
||
} //namespace security | ||
} //namespace rtps | ||
} //namespace fastrtps | ||
} //namespace eprosima | ||
|
||
#endif // _FASTDDS_RTPS_SECURITY_LOGGING_BUILTINLOGGINGTYPE_H_ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2020 Canonical ltd. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/*! | ||
* @file LogOptions.h | ||
*/ | ||
#ifndef _FASTDDS_RTPS_SECURITY_LOGGING_LOGOPTIONS_H_ | ||
#define _FASTDDS_RTPS_SECURITY_LOGGING_LOGOPTIONS_H_ | ||
|
||
#include <string> | ||
|
||
#include "fastdds/rtps/security/logging/LoggingLevel.h" | ||
|
||
namespace eprosima { | ||
namespace fastrtps { | ||
namespace rtps { | ||
namespace security { | ||
|
||
/** | ||
* @brief The LogOptions struct | ||
* @note Definition in DDS-Sec v1.1 8.6.2.1 | ||
*/ | ||
struct LogOptions | ||
{ | ||
//! Whether the log events should be distributed over DDS | ||
bool distribute; | ||
|
||
//! Level at which log messages will be logged. | ||
//! Messages at or below the log_level are logged. | ||
LoggingLevel log_level; | ||
|
||
//! Full path to a local file | ||
std::string log_file; | ||
}; | ||
|
||
} //namespace security | ||
} //namespace rtps | ||
} //namespace fastrtps | ||
} //namespace eprosima | ||
|
||
#endif // _FASTDDS_RTPS_SECURITY_LOGGING_LOGOPTIONS_H_ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use
" "
used for relative paths instead of< >
? Do you mind to change non-relative includes to< >
? This change could improve compilation time.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 5e099c1