From 680939a2898eeb4ffa443e1ce652c1c0e388748c Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Tue, 14 Nov 2017 14:13:24 +0100
Subject: [PATCH 01/57] Fix incorrect socket handling for the HTTP client
---
lib/base/stream.cpp | 3 +++
lib/remote/httpresponse.cpp | 39 +++++++++++++++++++++++--------------
2 files changed, 27 insertions(+), 15 deletions(-)
diff --git a/lib/base/stream.cpp b/lib/base/stream.cpp
index 9390d97b9..57791d305 100644
--- a/lib/base/stream.cpp
+++ b/lib/base/stream.cpp
@@ -145,6 +145,9 @@ bool StreamReadContext::FillFromStream(const Stream::Ptr& stream, bool may_wait)
if (!Buffer)
throw std::bad_alloc();
+ if (stream->IsEof())
+ break;
+
size_t rc = stream->Read(Buffer + Size, 4096, true);
Size += rc;
diff --git a/lib/remote/httpresponse.cpp b/lib/remote/httpresponse.cpp
index 7f77ed386..ab7458655 100644
--- a/lib/remote/httpresponse.cpp
+++ b/lib/remote/httpresponse.cpp
@@ -159,12 +159,7 @@ bool HttpResponse::Parse(StreamReadContext& src, bool may_wait)
if (line == "") {
m_State = HttpResponseBody;
-
- /* we're done if the request doesn't contain a message body */
- if (!Headers->Contains("content-length") && !Headers->Contains("transfer-encoding"))
- Complete = true;
- else
- m_Body = new FIFO();
+ m_Body = new FIFO();
return true;
@@ -204,27 +199,41 @@ bool HttpResponse::Parse(StreamReadContext& src, bool may_wait)
return true;
}
} else {
- if (src.Eof)
+ bool hasLengthIndicator = false;
+ size_t lengthIndicator = 0;
+ Value contentLengthHeader;
+
+ if (Headers->Get("content-length", &contentLengthHeader)) {
+ hasLengthIndicator = true;
+ lengthIndicator = Convert::ToLong(contentLengthHeader);
+ }
+
+ if (hasLengthIndicator && src.Eof)
BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
if (src.MustRead) {
- if (!src.FillFromStream(m_Stream, false)) {
+ if (!src.FillFromStream(m_Stream, may_wait))
src.Eof = true;
- BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
- }
src.MustRead = false;
}
- size_t length_indicator = Convert::ToLong(Headers->Get("content-length"));
+ if (!hasLengthIndicator)
+ lengthIndicator = src.Size;
- if (src.Size < length_indicator) {
+ if (src.Size < lengthIndicator) {
src.MustRead = true;
- return false;
+ return may_wait;
+ }
+
+ m_Body->Write(src.Buffer, lengthIndicator);
+ src.DropData(lengthIndicator);
+
+ if (!hasLengthIndicator && !src.Eof) {
+ src.MustRead = true;
+ return may_wait;
}
- m_Body->Write(src.Buffer, length_indicator);
- src.DropData(length_indicator);
Complete = true;
return true;
}
From 7f92016e383252013e13aa3f17b7a6dc6424d3a0 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Tue, 24 Oct 2017 15:23:58 +0200
Subject: [PATCH 02/57] Fix performance issues for InfluxdbWriter
---
lib/perfdata/influxdbwriter.cpp | 182 +++++++++++++++-----------------
lib/perfdata/influxdbwriter.hpp | 12 +--
2 files changed, 90 insertions(+), 104 deletions(-)
diff --git a/lib/perfdata/influxdbwriter.cpp b/lib/perfdata/influxdbwriter.cpp
index aa35fec0e..499e77a89 100644
--- a/lib/perfdata/influxdbwriter.cpp
+++ b/lib/perfdata/influxdbwriter.cpp
@@ -49,6 +49,24 @@
using namespace icinga;
+class InfluxdbInteger : public Object
+{
+public:
+ DECLARE_PTR_TYPEDEFS(InfluxdbInteger);
+
+ InfluxdbInteger(int value)
+ : m_Value(value)
+ { }
+
+ int GetValue(void) const
+ {
+ return m_Value;
+ }
+
+private:
+ int m_Value;
+};
+
REGISTER_TYPE(InfluxdbWriter);
REGISTER_STATSFUNCTION(InfluxdbWriter, &InfluxdbWriter::StatsFunc);
@@ -106,7 +124,7 @@ void InfluxdbWriter::Start(bool runtimeCreated)
m_FlushTimer->Reschedule(0);
/* Register for new metrics. */
- Service::OnNewCheckResult.connect(boost::bind(&InfluxdbWriter::CheckResultHandler, this, _1, _2));
+ Checkable::OnNewCheckResult.connect(boost::bind(&InfluxdbWriter::CheckResultHandler, this, _1, _2));
}
void InfluxdbWriter::Stop(bool runtimeRemoved)
@@ -134,7 +152,7 @@ void InfluxdbWriter::ExceptionHandler(boost::exception_ptr exp)
//TODO: Close the connection, if we keep it open.
}
-Stream::Ptr InfluxdbWriter::Connect()
+Stream::Ptr InfluxdbWriter::Connect(void)
{
TcpSocket::Ptr socket = new TcpSocket();
@@ -176,10 +194,10 @@ Stream::Ptr InfluxdbWriter::Connect()
void InfluxdbWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
{
- m_WorkQueue.Enqueue(boost::bind(&InfluxdbWriter::InternalCheckResultHandler, this, checkable, cr));
+ m_WorkQueue.Enqueue(boost::bind(&InfluxdbWriter::CheckResultHandlerWQ, this, checkable, cr), PriorityLow);
}
-void InfluxdbWriter::InternalCheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
+void InfluxdbWriter::CheckResultHandlerWQ(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
{
AssertOnWorkQueue();
@@ -211,28 +229,16 @@ void InfluxdbWriter::InternalCheckResultHandler(const Checkable::Ptr& checkable,
if (tags) {
ObjectLock olock(tags);
for (const Dictionary::Pair& pair : tags) {
- // Prevent missing macros from warning; will return an empty value
- // which will be filtered out in SendMetric()
String missing_macro;
- tags->Set(pair.first, MacroProcessor::ResolveMacros(pair.second, resolvers, cr, &missing_macro));
+ Value value = MacroProcessor::ResolveMacros(pair.second, resolvers, cr, &missing_macro);
+
+ if (!missing_macro.IsEmpty())
+ continue;
+
+ tags->Set(pair.first, value);
}
}
- SendPerfdata(tmpl, checkable, cr, ts);
-}
-
-String InfluxdbWriter::FormatInteger(int val)
-{
- return Convert::ToString(val) + "i";
-}
-
-String InfluxdbWriter::FormatBoolean(bool val)
-{
- return val ? "true" : "false";
-}
-
-void InfluxdbWriter::SendPerfdata(const Dictionary::Ptr& tmpl, const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, double ts)
-{
Array::Ptr perfdata = cr->GetPerformanceData();
if (perfdata) {
ObjectLock olock(perfdata);
@@ -277,16 +283,16 @@ void InfluxdbWriter::SendPerfdata(const Dictionary::Ptr& tmpl, const Checkable::
Dictionary::Ptr fields = new Dictionary();
if (service)
- fields->Set("state", FormatInteger(service->GetState()));
+ fields->Set("state", new InfluxdbInteger(service->GetState()));
else
- fields->Set("state", FormatInteger(host->GetState()));
+ fields->Set("state", new InfluxdbInteger(host->GetState()));
- fields->Set("current_attempt", FormatInteger(checkable->GetCheckAttempt()));
- fields->Set("max_check_attempts", FormatInteger(checkable->GetMaxCheckAttempts()));
- fields->Set("state_type", FormatInteger(checkable->GetStateType()));
- fields->Set("reachable", FormatBoolean(checkable->IsReachable()));
- fields->Set("downtime_depth", FormatInteger(checkable->GetDowntimeDepth()));
- fields->Set("acknowledgement", FormatInteger(checkable->GetAcknowledgement()));
+ fields->Set("current_attempt", new InfluxdbInteger(checkable->GetCheckAttempt()));
+ fields->Set("max_check_attempts", new InfluxdbInteger(checkable->GetMaxCheckAttempts()));
+ fields->Set("state_type", new InfluxdbInteger(checkable->GetStateType()));
+ fields->Set("reachable", checkable->IsReachable());
+ fields->Set("downtime_depth", new InfluxdbInteger(checkable->GetDowntimeDepth()));
+ fields->Set("acknowledgement", new InfluxdbInteger(checkable->GetAcknowledgement()));
fields->Set("latency", cr->CalculateLatency());
fields->Set("execution_time", cr->CalculateExecutionTime());
@@ -294,7 +300,7 @@ void InfluxdbWriter::SendPerfdata(const Dictionary::Ptr& tmpl, const Checkable::
}
}
-String InfluxdbWriter::EscapeKey(const String& str)
+String InfluxdbWriter::EscapeKeyOrTagValue(const String& str)
{
// Iterate over the key name and escape commas and spaces with a backslash
String result = str;
@@ -302,57 +308,28 @@ String InfluxdbWriter::EscapeKey(const String& str)
boost::algorithm::replace_all(result, "=", "\\=");
boost::algorithm::replace_all(result, ",", "\\,");
boost::algorithm::replace_all(result, " ", "\\ ");
-
- // InfluxDB 'feature': although backslashes are allowed in keys they also act
- // as escape sequences when followed by ',' or ' '. When your tag is like
- // 'metric=C:\' bad things happen. Backslashes themselves cannot be escaped
- // and through experimentation they also escape '='. To be safe we replace
- // trailing backslashes with and underscore.
- size_t length = result.GetLength();
- if (result[length - 1] == '\\')
- result[length - 1] = '_';
-
return result;
}
-String InfluxdbWriter::EscapeField(const String& str)
+String InfluxdbWriter::EscapeValue(const Value& value)
{
- //TODO: Evaluate whether boost::regex is really needed here.
-
- // Handle integers
- boost::regex integer("-?\\d+i");
- if (boost::regex_match(str.GetData(), integer)) {
- return str;
+ if (value.IsObjectType()) {
+ std::ostringstream os;
+ os << static_cast(value)->GetValue()
+ << "i";
+ return os.str();
}
- // Handle numerics
- boost::regex numeric("-?\\d+(\\.\\d+)?((e|E)[+-]?\\d+)?");
- if (boost::regex_match(str.GetData(), numeric)) {
- return str;
- }
+ if (value.IsBoolean())
+ return value ? "true" : "false";
- // Handle booleans
- boost::regex boolean_true("t|true", boost::regex::icase);
- if (boost::regex_match(str.GetData(), boolean_true))
- return "true";
- boost::regex boolean_false("f|false", boost::regex::icase);
- if (boost::regex_match(str.GetData(), boolean_false))
- return "false";
-
- // Handle NaNs
- if (boost::math::isnan(str))
- return 0;
-
- // Otherwise it's a string and needs escaping and quoting
- String result = str;
- boost::algorithm::replace_all(result, "\"", "\\\"");
- return "\"" + result + "\"";
+ return value;
}
void InfluxdbWriter::SendMetric(const Dictionary::Ptr& tmpl, const String& label, const Dictionary::Ptr& fields, double ts)
{
std::ostringstream msgbuf;
- msgbuf << EscapeKey(tmpl->Get("measurement"));
+ msgbuf << EscapeKeyOrTagValue(tmpl->Get("measurement"));
Dictionary::Ptr tags = tmpl->Get("tags");
if (tags) {
@@ -360,14 +337,14 @@ void InfluxdbWriter::SendMetric(const Dictionary::Ptr& tmpl, const String& label
for (const Dictionary::Pair& pair : tags) {
// Empty macro expansion, no tag
if (!pair.second.IsEmpty()) {
- msgbuf << "," << EscapeKey(pair.first) << "=" << EscapeKey(pair.second);
+ msgbuf << "," << EscapeKeyOrTagValue(pair.first) << "=" << EscapeKeyOrTagValue(pair.second);
}
}
}
- // Label is may be empty in the case of metadata
+ // Label may be empty in the case of metadata
if (!label.IsEmpty())
- msgbuf << ",metric=" << EscapeKey(label);
+ msgbuf << ",metric=" << EscapeKeyOrTagValue(label);
msgbuf << " ";
@@ -381,45 +358,54 @@ void InfluxdbWriter::SendMetric(const Dictionary::Ptr& tmpl, const String& label
else
msgbuf << ",";
- msgbuf << EscapeKey(pair.first) << "=" << EscapeField(pair.second);
+ msgbuf << EscapeKeyOrTagValue(pair.first) << "=" << EscapeValue(pair.second);
}
}
msgbuf << " " << static_cast(ts);
+#ifdef I2_DEBUG
Log(LogDebug, "InfluxdbWriter")
<< "Add to metric list: '" << msgbuf.str() << "'.";
+#endif /* I2_DEBUG */
- // Atomically buffer the data point
- boost::mutex::scoped_lock lock(m_DataBufferMutex);
- m_DataBuffer.push_back(String(msgbuf.str()));
+ // Buffer the data point
+ m_DataBuffer.push_back(msgbuf.str());
// Flush if we've buffered too much to prevent excessive memory use
if (static_cast(m_DataBuffer.size()) >= GetFlushThreshold()) {
Log(LogDebug, "InfluxdbWriter")
<< "Data buffer overflow writing " << m_DataBuffer.size() << " data points";
- Flush();
+
+ try {
+ Flush();
+ } catch (...) {
+ /* Do nothing. */
+ }
}
}
void InfluxdbWriter::FlushTimeout(void)
{
- // Prevent new data points from being added to the array, there is a
- // race condition where they could disappear
- boost::mutex::scoped_lock lock(m_DataBufferMutex);
+ m_WorkQueue.Enqueue(boost::bind(&InfluxdbWriter::FlushTimeoutWQ, this), PriorityHigh);
+}
+
+void InfluxdbWriter::FlushTimeoutWQ(void)
+{
+ AssertOnWorkQueue();
// Flush if there are any data available
- if (m_DataBuffer.size() > 0) {
- Log(LogDebug, "InfluxdbWriter")
- << "Timer expired writing " << m_DataBuffer.size() << " data points";
- Flush();
- }
+ if (m_DataBuffer.empty())
+ return;
+
+ Log(LogDebug, "InfluxdbWriter")
+ << "Timer expired writing " << m_DataBuffer.size() << " data points";
+
+ Flush();
}
void InfluxdbWriter::Flush(void)
{
- // Ensure you hold a lock against m_DataBuffer so that things
- // don't go missing after creating the body and clearing the buffer
String body = boost::algorithm::join(m_DataBuffer, "\n");
m_DataBuffer.clear();
@@ -457,25 +443,27 @@ void InfluxdbWriter::Flush(void)
throw ex;
}
- //TODO: Evaluate whether waiting for the result makes sense here. KeepAlive and close are options.
HttpResponse resp(stream, req);
StreamReadContext context;
try {
- resp.Parse(context, true);
+ while (resp.Parse(context, true) && !resp.Complete)
+ ; /* Do nothing */
} catch (const std::exception& ex) {
Log(LogWarning, "InfluxdbWriter")
- << "Cannot read from TCP socket from host '" << GetHost() << "' port '" << GetPort() << "'.";
+ << "Failed to parse HTTP response from host '" << GetHost() << "' port '" << GetPort() << "': " << DiagnosticInformation(ex);
throw ex;
}
+ if (!resp.Complete) {
+ Log(LogWarning, "InfluxdbWriter")
+ << "Failed to read a complete HTTP response from the InfluxDB server.";
+ return;
+ }
+
if (resp.StatusCode != 204) {
Log(LogWarning, "InfluxdbWriter")
- << "Unexpected response code " << resp.StatusCode;
-
- // Finish parsing the headers and body
- while (!resp.Complete)
- resp.Parse(context, true);
+ << "Unexpected response code: " << resp.StatusCode;
String contentType = resp.Headers->Get("content-type");
if (contentType != "application/json") {
@@ -502,6 +490,8 @@ void InfluxdbWriter::Flush(void)
Log(LogCritical, "InfluxdbWriter")
<< "InfluxDB error message:\n" << error;
+
+ return;
}
}
diff --git a/lib/perfdata/influxdbwriter.hpp b/lib/perfdata/influxdbwriter.hpp
index e0a149c3a..97546bc84 100644
--- a/lib/perfdata/influxdbwriter.hpp
+++ b/lib/perfdata/influxdbwriter.hpp
@@ -59,20 +59,16 @@ private:
WorkQueue m_WorkQueue;
Timer::Ptr m_FlushTimer;
std::vector m_DataBuffer;
- boost::mutex m_DataBufferMutex;
void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr);
- void InternalCheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr);
- void SendPerfdata(const Dictionary::Ptr& tmpl, const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, double ts);
+ void CheckResultHandlerWQ(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr);
void SendMetric(const Dictionary::Ptr& tmpl, const String& label, const Dictionary::Ptr& fields, double ts);
void FlushTimeout(void);
+ void FlushTimeoutWQ(void);
void Flush(void);
- static String FormatInteger(int val);
- static String FormatBoolean(bool val);
-
- static String EscapeKey(const String& str);
- static String EscapeField(const String& str);
+ static String EscapeKeyOrTagValue(const String& str);
+ static String EscapeValue(const Value& value);
Stream::Ptr Connect();
From 157358c24f65bc287c88fdc4c5eb72be29e17ecd Mon Sep 17 00:00:00 2001
From: Noah Hilverling
Date: Wed, 17 Jan 2018 10:25:00 +0100
Subject: [PATCH 03/57] Fix HTTP response parsing for HTTP 1.1
refs #5987
---
lib/remote/httpresponse.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/remote/httpresponse.cpp b/lib/remote/httpresponse.cpp
index ab7458655..fd7578ed0 100644
--- a/lib/remote/httpresponse.cpp
+++ b/lib/remote/httpresponse.cpp
@@ -208,6 +208,11 @@ bool HttpResponse::Parse(StreamReadContext& src, bool may_wait)
lengthIndicator = Convert::ToLong(contentLengthHeader);
}
+ if (!hasLengthIndicator && ProtocolVersion != HttpVersion10 && !Headers->Contains("transfer-encoding")) {
+ Complete = true;
+ return true;
+ }
+
if (hasLengthIndicator && src.Eof)
BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
From 6dba6a0bfb9cb8b7ad450fd64f68dd30bbb905f2 Mon Sep 17 00:00:00 2001
From: Noah Hilverling
Date: Wed, 17 Jan 2018 10:25:42 +0100
Subject: [PATCH 04/57] Add missing string escaping
fixes #5987
---
lib/perfdata/influxdbwriter.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/perfdata/influxdbwriter.cpp b/lib/perfdata/influxdbwriter.cpp
index 499e77a89..ac149e7cb 100644
--- a/lib/perfdata/influxdbwriter.cpp
+++ b/lib/perfdata/influxdbwriter.cpp
@@ -323,6 +323,9 @@ String InfluxdbWriter::EscapeValue(const Value& value)
if (value.IsBoolean())
return value ? "true" : "false";
+ if (value.IsString())
+ return "\"" + EscapeKeyOrTagValue(value) + "\"";
+
return value;
}
From bd81264c76b4539dd27278ec47f87d6a217ccc40 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Wed, 15 Nov 2017 09:47:23 +0100
Subject: [PATCH 05/57] Make default getters and setters non-virtual
---
tools/mkclass/class_lexer.ll | 3 +++
tools/mkclass/classcompiler.cpp | 25 ++++++++++++++++++-------
tools/mkclass/classcompiler.hpp | 4 +++-
3 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/tools/mkclass/class_lexer.ll b/tools/mkclass/class_lexer.ll
index 0b9195464..625a99f22 100644
--- a/tools/mkclass/class_lexer.ll
+++ b/tools/mkclass/class_lexer.ll
@@ -148,6 +148,9 @@ no_storage { yylval->num = FANoStorage; return T_FIELD_ATTRIBUTE; }
no_user_modify { yylval->num = FANoUserModify; return T_FIELD_ATTRIBUTE; }
no_user_view { yylval->num = FANoUserView; return T_FIELD_ATTRIBUTE; }
deprecated { yylval->num = FADeprecated; return T_FIELD_ATTRIBUTE; }
+get_virtual { yylval->num = FAGetVirtual; return T_FIELD_ATTRIBUTE; }
+set_virtual { yylval->num = FASetVirtual; return T_FIELD_ATTRIBUTE; }
+virtual { yylval->num = FAGetVirtual | FASetVirtual; return T_FIELD_ATTRIBUTE; }
navigation { return T_NAVIGATION; }
validator { return T_VALIDATOR; }
required { return T_REQUIRED; }
diff --git a/tools/mkclass/classcompiler.cpp b/tools/mkclass/classcompiler.cpp
index 04e9abdeb..7d068bcd5 100644
--- a/tools/mkclass/classcompiler.cpp
+++ b/tools/mkclass/classcompiler.cpp
@@ -706,7 +706,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
/* NotifyField */
m_Header << "public:" << std::endl
- << "\t" << "virtual void NotifyField(int id, const Value& cookie = Empty) override;" << std::endl;
+ << "\t" << "void NotifyField(int id, const Value& cookie = Empty) override;" << std::endl;
m_Impl << "void ObjectImpl<" << klass.Name << ">::NotifyField(int id, const Value& cookie)" << std::endl
<< "{" << std::endl;
@@ -784,7 +784,12 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
prot = "public";
m_Header << prot << ":" << std::endl
- << "\t" << "virtual " << field.Type.GetRealType() << " Get" << field.GetFriendlyName() << "(void) const";
+ << "\t";
+
+ if (field.Attributes & FAGetVirtual || field.PureGetAccessor)
+ m_Header << "virtual ";
+
+ m_Header << field.Type.GetRealType() << " Get" << field.GetFriendlyName() << "(void) const";
if (field.PureGetAccessor) {
m_Header << " = 0;" << std::endl;
@@ -813,7 +818,12 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
prot = "public";
m_Header << prot << ":" << std::endl
- << "\t" << "virtual void Set" << field.GetFriendlyName() << "(" << field.Type.GetArgumentType() << " value, bool suppress_events = false, const Value& cookie = Empty)";
+ << "\t";
+
+ if (field.Attributes & FASetVirtual || field.PureSetAccessor)
+ m_Header << "virtual ";
+
+ m_Header << "void Set" << field.GetFriendlyName() << "(" << field.Type.GetArgumentType() << " value, bool suppress_events = false, const Value& cookie = Empty)";
if (field.PureSetAccessor) {
m_Header << " = 0;" << std::endl;
@@ -859,7 +869,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
needs_tracking = true;
- m_Header << "\t" << "virtual void Track" << field.GetFriendlyName() << "(" << field.Type.GetArgumentType() << " oldValue, " << field.Type.GetArgumentType() << " newValue);";
+ m_Header << "\t" << "void Track" << field.GetFriendlyName() << "(" << field.Type.GetArgumentType() << " oldValue, " << field.Type.GetArgumentType() << " newValue);" << std::endl;
m_Impl << "void ObjectImpl<" << klass.Name << ">::Track" << field.GetFriendlyName() << "(" << field.Type.GetArgumentType() << " oldValue, " << field.Type.GetArgumentType() << " newValue)" << std::endl
<< "{" << std::endl;
@@ -930,7 +940,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
continue;
m_Header << "public:" << std::endl
- << "\t" << "virtual Object::Ptr Navigate" << field.GetFriendlyName() << "(void) const";
+ << "\t" << "Object::Ptr Navigate" << field.GetFriendlyName() << "(void) const";
if (field.PureNavigateAccessor) {
m_Header << " = 0;" << std::endl;
@@ -951,8 +961,9 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
/* start/stop */
if (needs_tracking) {
- m_Header << "virtual void Start(bool runtimeCreated = false) override;" << std::endl
- << "virtual void Stop(bool runtimeRemoved = false) override;" << std::endl;
+ m_Header << "protected:" << std::endl
+ << "\tvirtual void Start(bool runtimeCreated = false) override;" << std::endl
+ << "\tvirtual void Stop(bool runtimeRemoved = false) override;" << std::endl;
m_Impl << "void ObjectImpl<" << klass.Name << ">::Start(bool runtimeCreated)" << std::endl
<< "{" << std::endl
diff --git a/tools/mkclass/classcompiler.hpp b/tools/mkclass/classcompiler.hpp
index 06bf100d3..ab9422220 100644
--- a/tools/mkclass/classcompiler.hpp
+++ b/tools/mkclass/classcompiler.hpp
@@ -73,7 +73,9 @@ enum FieldAttribute
FANavigation = 512,
FANoUserModify = 1024,
FANoUserView = 2048,
- FADeprecated = 4096
+ FADeprecated = 4096,
+ FAGetVirtual = 8192,
+ FASetVirtual = 16384
};
struct FieldType
From 7fe8b3b14f09747d762013437f971eecf1530b03 Mon Sep 17 00:00:00 2001
From: Michael Friedrich
Date: Thu, 18 Jan 2018 13:25:23 +0100
Subject: [PATCH 06/57] Fix wrong nscp-local include in the docs
refs #6006
---
doc/06-distributed-monitoring.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/06-distributed-monitoring.md b/doc/06-distributed-monitoring.md
index 6030aa1d6..dafd55cde 100644
--- a/doc/06-distributed-monitoring.md
+++ b/doc/06-distributed-monitoring.md
@@ -2158,7 +2158,7 @@ Add the following `include` statement on all your nodes (master, satellite, clie
vim /etc/icinga2/icinga2.conf
- include
+ include
The CheckCommand definitions will automatically determine the installed path
to the `nscp.exe` binary.
From cf79724eb90682d96f95dd207253e859d096d931 Mon Sep 17 00:00:00 2001
From: Michael Friedrich
Date: Thu, 18 Jan 2018 17:50:39 +0100
Subject: [PATCH 07/57] Docs: Add IDO DB tuning tips
fixes #5622
refs #6014
---
doc/14-features.md | 101 ++++++++++++++++++++++++++++++++++-----------
1 file changed, 77 insertions(+), 24 deletions(-)
diff --git a/doc/14-features.md b/doc/14-features.md
index 9f4db6a78..b4e66931a 100644
--- a/doc/14-features.md
+++ b/doc/14-features.md
@@ -27,9 +27,9 @@ platforms. This configuration ensures that the `icinga2.log`, `error.log` and
## DB IDO
-The IDO (Icinga Data Output) modules for Icinga 2 take care of exporting all
+The IDO (Icinga Data Output) feature for Icinga 2 takes care of exporting all
configuration and status information into a database. The IDO database is used
-by Icinga Web 2.
+by Icinga Web 2 as data backend.
Details on the installation can be found in the [Configuring DB IDO](02-getting-started.md#configuring-db-ido-mysql)
chapter. Details on the configuration can be found in the
@@ -39,9 +39,14 @@ object configuration documentation.
The DB IDO feature supports [High Availability](06-distributed-monitoring.md#distributed-monitoring-high-availability-db-ido) in
the Icinga 2 cluster.
-The following example query checks the health of the current Icinga 2 instance
-writing its current status to the DB IDO backend table `icinga_programstatus`
-every 10 seconds. By default it checks 60 seconds into the past which is a reasonable
+### DB IDO Health
+
+If the monitoring health indicator is critical in Icinga Web 2,
+you can use the following queries to manually check whether Icinga 2
+is actually updating the IDO database.
+
+Icinga 2 writes its current status to the `icinga_programstatus` table
+every 10 seconds. The query below checks 60 seconds into the past which is a reasonable
amount of time -- adjust it for your requirements. If the condition is not met,
the query returns an empty result.
@@ -53,34 +58,82 @@ Replace the `default` string with your instance name if different.
Example for MySQL:
- # mysql -u root -p icinga -e "SELECT status_update_time FROM icinga_programstatus ps
- JOIN icinga_instances i ON ps.instance_id=i.instance_id
- WHERE (UNIX_TIMESTAMP(ps.status_update_time) > UNIX_TIMESTAMP(NOW())-60)
- AND i.instance_name='default';"
-
- +---------------------+
- | status_update_time |
- +---------------------+
- | 2014-05-29 14:29:56 |
- +---------------------+
+```
+# mysql -u root -p icinga -e "SELECT status_update_time FROM icinga_programstatus ps
+ JOIN icinga_instances i ON ps.instance_id=i.instance_id
+ WHERE (UNIX_TIMESTAMP(ps.status_update_time) > UNIX_TIMESTAMP(NOW())-60)
+ AND i.instance_name='default';"
++---------------------+
+| status_update_time |
++---------------------+
+| 2014-05-29 14:29:56 |
++---------------------+
+```
Example for PostgreSQL:
- # export PGPASSWORD=icinga; psql -U icinga -d icinga -c "SELECT ps.status_update_time FROM icinga_programstatus AS ps
- JOIN icinga_instances AS i ON ps.instance_id=i.instance_id
- WHERE ((SELECT extract(epoch from status_update_time) FROM icinga_programstatus) > (SELECT extract(epoch from now())-60))
- AND i.instance_name='default'";
-
- status_update_time
- ------------------------
- 2014-05-29 15:11:38+02
- (1 Zeile)
+```
+# export PGPASSWORD=icinga; psql -U icinga -d icinga -c "SELECT ps.status_update_time FROM icinga_programstatus AS ps
+ JOIN icinga_instances AS i ON ps.instance_id=i.instance_id
+ WHERE ((SELECT extract(epoch from status_update_time) FROM icinga_programstatus) > (SELECT extract(epoch from now())-60))
+ AND i.instance_name='default'";
+status_update_time
+------------------------
+ 2014-05-29 15:11:38+02
+(1 Zeile)
+```
A detailed list on the available table attributes can be found in the [DB IDO Schema documentation](24-appendix.md#schema-db-ido).
+### DB IDO Tuning
+
+As with any application database, there are ways to optimize and tune the database performance.
+
+General tips for performance tuning:
+
+* [MariaDB KB](https://mariadb.com/kb/en/library/optimization-and-tuning/)
+* [PostgreSQL Wiki](https://wiki.postgresql.org/wiki/Performance_Optimization)
+
+Re-creation of indexes, changed column values, etc. will increase the database size. Ensure to
+add health checks for this, and monitor the trend in your Grafana dashboards.
+
+In order to optimize the tables, there are different approaches. Always keep in mind to have a
+current backup and schedule maintenance downtime for these kind of tasks!
+
+MySQL:
+
+```
+mariadb> OPTIMIZE TABLE icinga_statehistory;
+```
+
+> **Important**
+>
+> Tables might not support optimization at runtime. This can take a **long** time.
+>
+> `Table does not support optimize, doing recreate + analyze instead`.
+
+If you want to optimize all tables in a specified database, there is a script called `mysqlcheck`.
+This also allows to repair broken tables in the case of emergency.
+
+```
+mysqlcheck --optimize icinga
+```
+
+PostgreSQL:
+
+```
+icinga=# vacuum;
+VACUUM
+```
+
+> **Note**
+>
+> Don't use `VACUUM FULL` as this has a severe impact on performance.
+
+
## External Commands
> **Note**
From 5dab779df66177a5cf87f20e11d65661026b8ad2 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Mon, 18 Dec 2017 09:32:09 +0100
Subject: [PATCH 08/57] Fix incorrect ::Start call
---
lib/base/filelogger.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/base/filelogger.cpp b/lib/base/filelogger.cpp
index 233692a25..44d5889e8 100644
--- a/lib/base/filelogger.cpp
+++ b/lib/base/filelogger.cpp
@@ -46,11 +46,11 @@ void FileLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
*/
void FileLogger::Start(bool runtimeCreated)
{
- ObjectImpl::Start(runtimeCreated);
-
ReopenLogFile();
Application::OnReopenLogs.connect(boost::bind(&FileLogger::ReopenLogFile, this));
+
+ ObjectImpl::Start(runtimeCreated);
}
void FileLogger::ReopenLogFile(void)
From 7f09fb1f659b434c0afbdfbe1e7f364de7fec483 Mon Sep 17 00:00:00 2001
From: Michael Friedrich
Date: Tue, 6 Feb 2018 12:44:45 +0100
Subject: [PATCH 09/57] Explain how to register functions in the global scope
refs #6075
---
doc/08-advanced-topics.md | 313 ++++++++++++++++++++++++--------------
1 file changed, 198 insertions(+), 115 deletions(-)
diff --git a/doc/08-advanced-topics.md b/doc/08-advanced-topics.md
index b0c2b79a0..c92f7a703 100644
--- a/doc/08-advanced-topics.md
+++ b/doc/08-advanced-topics.md
@@ -645,6 +645,204 @@ inside the `icinga2.log` file depending in your log severity
* Use the `icinga2 console` to test basic functionality (e.g. iterating over a dictionary)
* Build them step-by-step. You can always refactor your code later on.
+#### Register and Use Global Functions
+
+[Functions](17-language-reference.md#functions) can be registered into the global scope. This allows custom functions being available
+in objects and other functions. Keep in mind that these functions are not marked
+as side-effect-free and as such are not available via the REST API.
+
+Add a new configuration file `functions.conf` and include it into the [icinga2.conf](04-configuring-icinga-2.md#icinga2-conf)
+configuration file in the very beginning, e.g. after `constants.conf`. You can also manage global
+functions inside `constants.conf` if you prefer.
+
+The following function converts a given state parameter into a returned string value. The important
+bits for registering it into the global scope are:
+
+* `globals.` adds a new globals entry.
+* `function()` specifies that a call to `state_to_string()` executes a function.
+* Function parameters are defined inside the `function()` definition.
+
+```
+globals.state_to_string = function(state) {
+ if (state == 2) {
+ return "Critical"
+ } else if (state == 1) {
+ return "Warning"
+ } else if (state == 0) {
+ return "OK"
+ } else if (state == 3) {
+ return "Unknown"
+ } else {
+ log(LogWarning, "state_to_string", "Unknown state " + state + " provided.")
+ }
+}
+```
+
+The else-condition allows for better error handling. This warning will be shown in the Icinga 2
+log file once the function is called.
+
+> **Note**
+>
+> If these functions are used in a distributed environment, you must ensure to deploy them
+> everywhere needed.
+
+In order to test-drive the newly created function, restart Icinga 2 and use the [debug console](11-cli-commands.md#cli-command-console)
+to connect to the REST API.
+
+```
+$ ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/'
+Icinga 2 (version: v2.8.1-373-g4bea6d25c)
+<1> => globals.state_to_string(1)
+"Warning"
+<2> => state_to_string(2)
+"Critical"
+```
+
+You can see that this function is now registered into the [global scope](17-language-reference.md#variable-scopes). The function call
+`state_to_string()` can be used in any object at static config compile time or inside runtime
+lambda functions.
+
+The following service object example uses the service state and converts it to string output.
+The function definition is not optimized and is enrolled for better readability including a log message.
+
+```
+object Service "state-test" {
+ check_command = "dummy"
+ host_name = NodeName
+
+ vars.dummy_state = 2
+
+ vars.dummy_text = {{
+ var h = macro("$host.name$")
+ var s = macro("$service.name$")
+
+ var state = get_service(h, s).state
+
+ log(LogInformation, "dummy_state", "Host: " + h + " Service: " + s + " State: " + state)
+
+ return state_to_string(state)
+ }}
+}
+```
+
+
+#### Use Custom Functions as Attribute
+
+To use custom functions as attributes, the function must be defined in a
+slightly unexpected way. The following example shows how to assign values
+depending on group membership. All hosts in the `slow-lan` host group use 300
+as value for `ping_wrta`, all other hosts use 100.
+
+ globals.group_specific_value = function(group, group_value, non_group_value) {
+ return function() use (group, group_value, non_group_value) {
+ if (group in host.groups) {
+ return group_value
+ } else {
+ return non_group_value
+ }
+ }
+ }
+
+ apply Service "ping4" {
+ import "generic-service"
+ check_command = "ping4"
+
+ vars.ping_wrta = group_specific_value("slow-lan", 300, 100)
+ vars.ping_crta = group_specific_value("slow-lan", 500, 200)
+
+ assign where true
+ }
+
+#### Use Functions in Assign Where Expressions
+
+If a simple expression for matching a name or checking if an item
+exists in an array or dictionary does not fit, you should consider
+writing your own global [functions](17-language-reference.md#functions).
+You can call them inside `assign where` and `ignore where` expressions
+for [apply rules](03-monitoring-basics.md#using-apply-expressions) or
+[group assignments](03-monitoring-basics.md#group-assign-intro) just like
+any other global functions for example [match](18-library-reference.md#global-functions-match).
+
+The following example requires the host `myprinter` being added
+to the host group `printers-lexmark` but only if the host uses
+a template matching the name `lexmark*`.
+
+ template Host "lexmark-printer-host" {
+ vars.printer_type = "Lexmark"
+ }
+
+ object Host "myprinter" {
+ import "generic-host"
+ import "lexmark-printer-host"
+
+ address = "192.168.1.1"
+ }
+
+ /* register a global function for the assign where call */
+ globals.check_host_templates = function(host, search) {
+ /* iterate over all host templates and check if the search matches */
+ for (tmpl in host.templates) {
+ if (match(search, tmpl)) {
+ return true
+ }
+ }
+
+ /* nothing matched */
+ return false
+ }
+
+ object HostGroup "printers-lexmark" {
+ display_name = "Lexmark Printers"
+ /* call the global function and pass the arguments */
+ assign where check_host_templates(host, "lexmark*")
+ }
+
+
+Take a different more complex example: All hosts with the
+custom attribute `vars_app` as nested dictionary should be
+added to the host group `ABAP-app-server`. But only if the
+`app_type` for all entries is set to `ABAP`.
+
+It could read as wildcard match for nested dictionaries:
+
+ where host.vars.vars_app["*"].app_type == "ABAP"
+
+The solution for this problem is to register a global
+function which checks the `app_type` for all hosts
+with the `vars_app` dictionary.
+
+ object Host "appserver01" {
+ check_command = "dummy"
+ vars.vars_app["ABC"] = { app_type = "ABAP" }
+ }
+ object Host "appserver02" {
+ check_command = "dummy"
+ vars.vars_app["DEF"] = { app_type = "ABAP" }
+ }
+
+ globals.check_app_type = function(host, type) {
+ /* ensure that other hosts without the custom attribute do not match */
+ if (typeof(host.vars.vars_app) != Dictionary) {
+ return false
+ }
+
+ /* iterate over the vars_app dictionary */
+ for (key => val in host.vars.vars_app) {
+ /* if the value is a dictionary and if contains the app_type being the requested type */
+ if (typeof(val) == Dictionary && val.app_type == type) {
+ return true
+ }
+ }
+
+ /* nothing matched */
+ return false
+ }
+
+ object HostGroup "ABAP-app-server" {
+ assign where check_app_type(host, "ABAP")
+ }
+
+
#### Use Functions in Command Arguments set_if
The `set_if` attribute inside the command arguments definition in the
@@ -778,121 +976,6 @@ You can omit the `log()` calls, they only help debugging.
}
}
-#### Use Custom Functions as Attribute
-
-To use custom functions as attributes, the function must be defined in a
-slightly unexpected way. The following example shows how to assign values
-depending on group membership. All hosts in the `slow-lan` host group use 300
-as value for `ping_wrta`, all other hosts use 100.
-
- globals.group_specific_value = function(group, group_value, non_group_value) {
- return function() use (group, group_value, non_group_value) {
- if (group in host.groups) {
- return group_value
- } else {
- return non_group_value
- }
- }
- }
-
- apply Service "ping4" {
- import "generic-service"
- check_command = "ping4"
-
- vars.ping_wrta = group_specific_value("slow-lan", 300, 100)
- vars.ping_crta = group_specific_value("slow-lan", 500, 200)
-
- assign where true
- }
-
-#### Use Functions in Assign Where Expressions
-
-If a simple expression for matching a name or checking if an item
-exists in an array or dictionary does not fit, you should consider
-writing your own global [functions](17-language-reference.md#functions).
-You can call them inside `assign where` and `ignore where` expressions
-for [apply rules](03-monitoring-basics.md#using-apply-expressions) or
-[group assignments](03-monitoring-basics.md#group-assign-intro) just like
-any other global functions for example [match](18-library-reference.md#global-functions-match).
-
-The following example requires the host `myprinter` being added
-to the host group `printers-lexmark` but only if the host uses
-a template matching the name `lexmark*`.
-
- template Host "lexmark-printer-host" {
- vars.printer_type = "Lexmark"
- }
-
- object Host "myprinter" {
- import "generic-host"
- import "lexmark-printer-host"
-
- address = "192.168.1.1"
- }
-
- /* register a global function for the assign where call */
- globals.check_host_templates = function(host, search) {
- /* iterate over all host templates and check if the search matches */
- for (tmpl in host.templates) {
- if (match(search, tmpl)) {
- return true
- }
- }
-
- /* nothing matched */
- return false
- }
-
- object HostGroup "printers-lexmark" {
- display_name = "Lexmark Printers"
- /* call the global function and pass the arguments */
- assign where check_host_templates(host, "lexmark*")
- }
-
-
-Take a different more complex example: All hosts with the
-custom attribute `vars_app` as nested dictionary should be
-added to the host group `ABAP-app-server`. But only if the
-`app_type` for all entries is set to `ABAP`.
-
-It could read as wildcard match for nested dictionaries:
-
- where host.vars.vars_app["*"].app_type == "ABAP"
-
-The solution for this problem is to register a global
-function which checks the `app_type` for all hosts
-with the `vars_app` dictionary.
-
- object Host "appserver01" {
- check_command = "dummy"
- vars.vars_app["ABC"] = { app_type = "ABAP" }
- }
- object Host "appserver02" {
- check_command = "dummy"
- vars.vars_app["DEF"] = { app_type = "ABAP" }
- }
-
- globals.check_app_type = function(host, type) {
- /* ensure that other hosts without the custom attribute do not match */
- if (typeof(host.vars.vars_app) != Dictionary) {
- return false
- }
-
- /* iterate over the vars_app dictionary */
- for (key => val in host.vars.vars_app) {
- /* if the value is a dictionary and if contains the app_type being the requested type */
- if (typeof(val) == Dictionary && val.app_type == type) {
- return true
- }
- }
-
- /* nothing matched */
- return false
- }
-
- object HostGroup "ABAP-app-server" {
- assign where check_app_type(host, "ABAP")
- }
### Access Object Attributes at Runtime
From 2fee533b321aa307c9446ea0d90371f836350a43 Mon Sep 17 00:00:00 2001
From: Michael Friedrich
Date: Mon, 12 Feb 2018 09:49:11 +0100
Subject: [PATCH 10/57] Upgrading: Make it more clear that the Director script
is just an example
refs #6086
---
doc/16-upgrading-icinga-2.md | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/doc/16-upgrading-icinga-2.md b/doc/16-upgrading-icinga-2.md
index b5a7f0500..e66505627 100644
--- a/doc/16-upgrading-icinga-2.md
+++ b/doc/16-upgrading-icinga-2.md
@@ -81,8 +81,11 @@ In order to support a smooth migration between versions older than 2.8 and futur
the built-in certificate migration path is planned to exist as long as the deprecated
`ApiListener` object attributes exist.
-You are safe to use the existing configuration paths inside the `api` feature. If you plan your migration,
-look at the following example taken from the Director Linux deployment script for clients.
+You are safe to use the existing configuration paths inside the `api` feature.
+
+**Example**
+
+Look at the following example taken from the Director Linux deployment script for clients.
* Ensure that the default certificate path is changed from `/etc/icinga2/pki` to `/var/lib/icinga2/certs`.
From 6f7739b1cb6e8e39b618935dc19d38ff06e052c3 Mon Sep 17 00:00:00 2001
From: Michael Friedrich
Date: Wed, 14 Feb 2018 13:04:42 +0100
Subject: [PATCH 11/57] Docs: Fix bracket in notification example
refs #6089
---
doc/03-monitoring-basics.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/03-monitoring-basics.md b/doc/03-monitoring-basics.md
index fc768cd88..dabcaf831 100644
--- a/doc/03-monitoring-basics.md
+++ b/doc/03-monitoring-basics.md
@@ -1675,7 +1675,7 @@ apply Notification "mail-host-notification" to Service {
if (service.vars.notification.mail.groups) {
user_groups = service.vars.notification.mail.groups
- } else {host.vars.notification.mail.groups) {
+ } else (host.vars.notification.mail.groups) {
user_groups = host.vars.notification.mail.groups
}
From 3ba509086771b75654c76ccb81f38e0d869be25a Mon Sep 17 00:00:00 2001
From: Noah Hilverling
Date: Tue, 30 Jan 2018 11:26:07 +0100
Subject: [PATCH 12/57] Add marco RequireNotNull
This is used to fix a number of possible nullptr dereferences
---
lib/base/array-script.cpp | 17 +++++++++++++++++
lib/base/configobject-script.cpp | 2 ++
lib/base/datetime-script.cpp | 1 +
lib/base/dictionary-script.cpp | 10 ++++++++++
lib/base/function-script.cpp | 2 ++
lib/base/object-script.cpp | 3 +++
lib/base/object.cpp | 5 +++++
lib/base/object.hpp | 4 ++++
lib/base/typetype-script.cpp | 3 ++-
lib/icinga/checkable-script.cpp | 1 +
lib/icinga/macroprocessor.cpp | 6 ++++++
lib/methods/clusterchecktask.cpp | 3 +++
lib/methods/clusterzonechecktask.cpp | 3 +++
lib/methods/exceptionchecktask.cpp | 3 +++
lib/methods/icingachecktask.cpp | 3 +++
lib/methods/nullchecktask.cpp | 7 +++++--
lib/methods/nulleventtask.cpp | 6 ++++--
lib/methods/pluginchecktask.cpp | 3 +++
lib/methods/plugineventtask.cpp | 2 ++
lib/methods/pluginnotificationtask.cpp | 3 +++
lib/methods/randomchecktask.cpp | 7 +++++--
lib/methods/timeperiodtask.cpp | 7 +++++--
22 files changed, 92 insertions(+), 9 deletions(-)
diff --git a/lib/base/array-script.cpp b/lib/base/array-script.cpp
index 568037d9e..b9535ef98 100644
--- a/lib/base/array-script.cpp
+++ b/lib/base/array-script.cpp
@@ -30,6 +30,7 @@ static double ArrayLen(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->GetLength();
}
@@ -37,6 +38,7 @@ static void ArraySet(int index, const Value& value)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
self->Set(index, value);
}
@@ -44,6 +46,7 @@ static Value ArrayGet(int index)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->Get(index);
}
@@ -51,6 +54,7 @@ static void ArrayAdd(const Value& value)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
self->Add(value);
}
@@ -58,6 +62,7 @@ static void ArrayRemove(int index)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
self->Remove(index);
}
@@ -65,6 +70,7 @@ static bool ArrayContains(const Value& value)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->Contains(value);
}
@@ -72,6 +78,7 @@ static void ArrayClear(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
self->Clear();
}
@@ -87,6 +94,7 @@ static Array::Ptr ArraySort(const std::vector& args)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
Array::Ptr arr = self->ShallowClone();
@@ -110,6 +118,7 @@ static Array::Ptr ArrayShallowClone(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->ShallowClone();
}
@@ -117,6 +126,7 @@ static Value ArrayJoin(const Value& separator)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
Value result;
bool first = true;
@@ -139,6 +149,7 @@ static Array::Ptr ArrayReverse(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->Reverse();
}
@@ -146,6 +157,7 @@ static Array::Ptr ArrayMap(const Function::Ptr& function)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
if (vframe->Sandboxed && !function->IsSideEffectFree())
BOOST_THROW_EXCEPTION(ScriptError("Map function must be side-effect free."));
@@ -166,6 +178,7 @@ static Value ArrayReduce(const Function::Ptr& function)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
if (vframe->Sandboxed && !function->IsSideEffectFree())
BOOST_THROW_EXCEPTION(ScriptError("Reduce function must be side-effect free."));
@@ -190,6 +203,7 @@ static Array::Ptr ArrayFilter(const Function::Ptr& function)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
if (vframe->Sandboxed && !function->IsSideEffectFree())
BOOST_THROW_EXCEPTION(ScriptError("Filter function must be side-effect free."));
@@ -211,6 +225,7 @@ static bool ArrayAny(const Function::Ptr& function)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
if (vframe->Sandboxed && !function->IsSideEffectFree())
BOOST_THROW_EXCEPTION(ScriptError("Filter function must be side-effect free."));
@@ -230,6 +245,7 @@ static bool ArrayAll(const Function::Ptr& function)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
if (vframe->Sandboxed && !function->IsSideEffectFree())
BOOST_THROW_EXCEPTION(ScriptError("Filter function must be side-effect free."));
@@ -248,6 +264,7 @@ static Array::Ptr ArrayUnique(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
std::set result;
diff --git a/lib/base/configobject-script.cpp b/lib/base/configobject-script.cpp
index dfe4455b6..30d22ceff 100644
--- a/lib/base/configobject-script.cpp
+++ b/lib/base/configobject-script.cpp
@@ -29,6 +29,7 @@ static void ConfigObjectModifyAttribute(const String& attr, const Value& value)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
ConfigObject::Ptr self = vframe->Self;
+ RequireNotNull(self);
return self->ModifyAttribute(attr, value);
}
@@ -36,6 +37,7 @@ static void ConfigObjectRestoreAttribute(const String& attr)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
ConfigObject::Ptr self = vframe->Self;
+ RequireNotNull(self);
return self->RestoreAttribute(attr);
}
diff --git a/lib/base/datetime-script.cpp b/lib/base/datetime-script.cpp
index 7d9a14cc2..2e2f2f10b 100644
--- a/lib/base/datetime-script.cpp
+++ b/lib/base/datetime-script.cpp
@@ -29,6 +29,7 @@ static String DateTimeFormat(const String& format)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
DateTime::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->Format(format);
}
diff --git a/lib/base/dictionary-script.cpp b/lib/base/dictionary-script.cpp
index 66aa26cbd..9059a0a51 100644
--- a/lib/base/dictionary-script.cpp
+++ b/lib/base/dictionary-script.cpp
@@ -29,6 +29,7 @@ static double DictionaryLen(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->GetLength();
}
@@ -36,6 +37,7 @@ static void DictionarySet(const String& key, const Value& value)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
self->Set(key, value);
}
@@ -43,6 +45,7 @@ static Value DictionaryGet(const String& key)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->Get(key);
}
@@ -50,6 +53,7 @@ static void DictionaryRemove(const String& key)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
self->Remove(key);
}
@@ -57,6 +61,7 @@ static bool DictionaryContains(const String& key)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->Contains(key);
}
@@ -64,6 +69,7 @@ static Dictionary::Ptr DictionaryShallowClone(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->ShallowClone();
}
@@ -72,6 +78,8 @@ static Array::Ptr DictionaryKeys(void)
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
Array::Ptr keys = new Array();
+ RequireNotNull(self);
+
ObjectLock olock(self);
for (const Dictionary::Pair& kv : self) {
keys->Add(kv.first);
@@ -84,6 +92,8 @@ static Array::Ptr DictionaryValues(void)
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
Array::Ptr keys = new Array();
+ RequireNotNull(self);
+
ObjectLock olock(self);
for (const Dictionary::Pair& kv : self) {
keys->Add(kv.second);
diff --git a/lib/base/function-script.cpp b/lib/base/function-script.cpp
index dab4255de..cd40feacb 100644
--- a/lib/base/function-script.cpp
+++ b/lib/base/function-script.cpp
@@ -32,6 +32,7 @@ static Value FunctionCall(const std::vector& args)
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Function::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
std::vector uargs(args.begin() + 1, args.end());
return self->Invoke(args[0], uargs);
@@ -41,6 +42,7 @@ static Value FunctionCallV(const Value& thisArg, const Array::Ptr& args)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Function::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
std::vector uargs;
diff --git a/lib/base/object-script.cpp b/lib/base/object-script.cpp
index c8112a402..27bc487da 100644
--- a/lib/base/object-script.cpp
+++ b/lib/base/object-script.cpp
@@ -29,6 +29,7 @@ static String ObjectToString(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Object::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->ToString();
}
@@ -36,6 +37,7 @@ static void ObjectNotifyAttribute(const String& attribute)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Object::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
self->NotifyField(self->GetReflectionType()->GetFieldId(attribute));
}
@@ -43,6 +45,7 @@ static Object::Ptr ObjectClone(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Object::Ptr self = static_cast(vframe->Self);
+ RequireNotNull(self);
return self->Clone();
}
diff --git a/lib/base/object.cpp b/lib/base/object.cpp
index e9f3cd1bd..b261fefe6 100644
--- a/lib/base/object.cpp
+++ b/lib/base/object.cpp
@@ -261,3 +261,8 @@ INITIALIZE_ONCE([]() {
});
#endif /* I2_LEAK_DEBUG */
+void icinga::RequireNotNullInternal(const intrusive_ptr& object, const char *description)
+{
+ if (!object)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Pointer must not be null: " + String(description)));
+}
diff --git a/lib/base/object.hpp b/lib/base/object.hpp
index d3abc4648..6159c5b5e 100644
--- a/lib/base/object.hpp
+++ b/lib/base/object.hpp
@@ -62,6 +62,10 @@ extern I2_BASE_API Value Empty;
DECLARE_PTR_TYPEDEFS(klass); \
IMPL_TYPE_LOOKUP();
+#define RequireNotNull(ptr) RequireNotNullInternal(ptr, #ptr)
+
+I2_BASE_API void RequireNotNullInternal(const intrusive_ptr& object, const char *description);
+
template
intrusive_ptr DefaultObjectFactory(const std::vector& args)
{
diff --git a/lib/base/typetype-script.cpp b/lib/base/typetype-script.cpp
index 5189845b3..591de4667 100644
--- a/lib/base/typetype-script.cpp
+++ b/lib/base/typetype-script.cpp
@@ -37,7 +37,8 @@ static void TypeRegisterAttributeHandler(const String& fieldName, const Function
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Type::Ptr self = static_cast(vframe->Self);
-
+ RequireNotNull(self);
+
int fid = self->GetFieldId(fieldName);
self->RegisterAttributeHandler(fid, boost::bind(&InvokeAttributeHandlerHelper, callback, _1, _2));
}
diff --git a/lib/icinga/checkable-script.cpp b/lib/icinga/checkable-script.cpp
index 40626fef9..f7ba56e80 100644
--- a/lib/icinga/checkable-script.cpp
+++ b/lib/icinga/checkable-script.cpp
@@ -30,6 +30,7 @@ static void CheckableProcessCheckResult(const CheckResult::Ptr& cr)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Checkable::Ptr self = vframe->Self;
+ RequireNotNull(self);
self->ProcessCheckResult(cr);
}
diff --git a/lib/icinga/macroprocessor.cpp b/lib/icinga/macroprocessor.cpp
index 2027ef82f..ac45f1c90 100644
--- a/lib/icinga/macroprocessor.cpp
+++ b/lib/icinga/macroprocessor.cpp
@@ -40,6 +40,9 @@ Value MacroProcessor::ResolveMacros(const Value& str, const ResolverList& resolv
const MacroProcessor::EscapeCallback& escapeFn, const Dictionary::Ptr& resolvedMacros,
bool useResolvedMacros, int recursionLevel)
{
+ if (useResolvedMacros)
+ RequireNotNull(resolvedMacros);
+
Value result;
if (str.IsEmpty())
@@ -454,6 +457,9 @@ Value MacroProcessor::ResolveArguments(const Value& command, const Dictionary::P
const MacroProcessor::ResolverList& resolvers, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros, int recursionLevel)
{
+ if (useResolvedMacros)
+ RequireNotNull(resolvedMacros);
+
Value resolvedCommand;
if (!arguments || command.IsObjectType() || command.IsObjectType())
resolvedCommand = MacroProcessor::ResolveMacros(command, resolvers, cr, NULL,
diff --git a/lib/methods/clusterchecktask.cpp b/lib/methods/clusterchecktask.cpp
index 2ad7f6578..513a5a475 100644
--- a/lib/methods/clusterchecktask.cpp
+++ b/lib/methods/clusterchecktask.cpp
@@ -38,6 +38,9 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, ClusterCheck, &ClusterCheckTask::ScriptFunc
void ClusterCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ RequireNotNull(checkable);
+ RequireNotNull(cr);
+
if (resolvedMacros && !useResolvedMacros)
return;
diff --git a/lib/methods/clusterzonechecktask.cpp b/lib/methods/clusterzonechecktask.cpp
index 919e7fbed..699ef9bf3 100644
--- a/lib/methods/clusterzonechecktask.cpp
+++ b/lib/methods/clusterzonechecktask.cpp
@@ -34,6 +34,9 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, ClusterZoneCheck, &ClusterZoneCheckTask::Sc
void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ RequireNotNull(checkable);
+ RequireNotNull(cr);
+
ApiListener::Ptr listener = ApiListener::GetInstance();
if (!listener) {
diff --git a/lib/methods/exceptionchecktask.cpp b/lib/methods/exceptionchecktask.cpp
index 0410621ab..120264327 100644
--- a/lib/methods/exceptionchecktask.cpp
+++ b/lib/methods/exceptionchecktask.cpp
@@ -34,6 +34,9 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, ExceptionCheck, &ExceptionCheckTask::Script
void ExceptionCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ RequireNotNull(service);
+ RequireNotNull(cr);
+
if (resolvedMacros && !useResolvedMacros)
return;
diff --git a/lib/methods/icingachecktask.cpp b/lib/methods/icingachecktask.cpp
index 3a4b668a9..d96dfedd1 100644
--- a/lib/methods/icingachecktask.cpp
+++ b/lib/methods/icingachecktask.cpp
@@ -35,6 +35,9 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, IcingaCheck, &IcingaCheckTask::ScriptFunc,
void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ RequireNotNull(service);
+ RequireNotNull(cr);
+
if (resolvedMacros && !useResolvedMacros)
return;
diff --git a/lib/methods/nullchecktask.cpp b/lib/methods/nullchecktask.cpp
index 09b060c2b..50d2409a1 100644
--- a/lib/methods/nullchecktask.cpp
+++ b/lib/methods/nullchecktask.cpp
@@ -32,9 +32,12 @@ using namespace icinga;
REGISTER_SCRIPTFUNCTION_NS(Internal, NullCheck, &NullCheckTask::ScriptFunc, "checkable:cr:resolvedMacros:useResolvedMacros");
-void NullCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
+void NullCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ RequireNotNull(checkable);
+ RequireNotNull(cr);
+
if (resolvedMacros && !useResolvedMacros)
return;
@@ -48,5 +51,5 @@ void NullCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult:
cr->SetPerformanceData(perfdata);
cr->SetState(ServiceOK);
- service->ProcessCheckResult(cr);
+ checkable->ProcessCheckResult(cr);
}
diff --git a/lib/methods/nulleventtask.cpp b/lib/methods/nulleventtask.cpp
index 2d56e8a34..f80edd4e0 100644
--- a/lib/methods/nulleventtask.cpp
+++ b/lib/methods/nulleventtask.cpp
@@ -25,5 +25,7 @@ using namespace icinga;
REGISTER_SCRIPTFUNCTION_NS(Internal, NullEvent, &NullEventTask::ScriptFunc, "checkable:resolvedMacros:useResolvedMacros");
-void NullEventTask::ScriptFunc(const Checkable::Ptr&, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
-{ }
+void NullEventTask::ScriptFunc(const Checkable::Ptr& checkable, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
+{
+ RequireNotNull(checkable);
+}
diff --git a/lib/methods/pluginchecktask.cpp b/lib/methods/pluginchecktask.cpp
index abf2b0cd5..ddd8dba38 100644
--- a/lib/methods/pluginchecktask.cpp
+++ b/lib/methods/pluginchecktask.cpp
@@ -38,6 +38,9 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, PluginCheck, &PluginCheckTask::ScriptFunc,
void PluginCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ RequireNotNull(checkable);
+ RequireNotNull(cr);
+
CheckCommand::Ptr commandObj = checkable->GetCheckCommand();
Host::Ptr host;
diff --git a/lib/methods/plugineventtask.cpp b/lib/methods/plugineventtask.cpp
index 48a0b9ce0..a1a49f066 100644
--- a/lib/methods/plugineventtask.cpp
+++ b/lib/methods/plugineventtask.cpp
@@ -36,6 +36,8 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, PluginEvent, &PluginEventTask::ScriptFunc,
void PluginEventTask::ScriptFunc(const Checkable::Ptr& checkable,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ RequireNotNull(checkable);
+
EventCommand::Ptr commandObj = checkable->GetEventCommand();
Host::Ptr host;
diff --git a/lib/methods/pluginnotificationtask.cpp b/lib/methods/pluginnotificationtask.cpp
index 42403e7bb..730ae6770 100644
--- a/lib/methods/pluginnotificationtask.cpp
+++ b/lib/methods/pluginnotificationtask.cpp
@@ -39,6 +39,9 @@ void PluginNotificationTask::ScriptFunc(const Notification::Ptr& notification,
const String& author, const String& comment, const Dictionary::Ptr& resolvedMacros,
bool useResolvedMacros)
{
+ RequireNotNull(notification);
+ RequireNotNull(user);
+
NotificationCommand::Ptr commandObj = notification->GetCommand();
NotificationType type = static_cast(itype);
diff --git a/lib/methods/randomchecktask.cpp b/lib/methods/randomchecktask.cpp
index 0d31e795a..7afa0c7af 100644
--- a/lib/methods/randomchecktask.cpp
+++ b/lib/methods/randomchecktask.cpp
@@ -32,9 +32,12 @@ using namespace icinga;
REGISTER_SCRIPTFUNCTION_NS(Internal, RandomCheck, &RandomCheckTask::ScriptFunc, "checkable:cr:resolvedMacros:useResolvedMacros");
-void RandomCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
+void RandomCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
+ RequireNotNull(checkable);
+ RequireNotNull(cr);
+
if (resolvedMacros && !useResolvedMacros)
return;
@@ -48,5 +51,5 @@ void RandomCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResul
cr->SetPerformanceData(perfdata);
cr->SetState(static_cast(Utility::Random() % 4));
- service->ProcessCheckResult(cr);
+ checkable->ProcessCheckResult(cr);
}
diff --git a/lib/methods/timeperiodtask.cpp b/lib/methods/timeperiodtask.cpp
index c26b4cedd..92c57b3cf 100644
--- a/lib/methods/timeperiodtask.cpp
+++ b/lib/methods/timeperiodtask.cpp
@@ -25,15 +25,18 @@ using namespace icinga;
REGISTER_SCRIPTFUNCTION_NS(Internal, EmptyTimePeriod, &TimePeriodTask::EmptyTimePeriodUpdate, "tp:begin:end");
REGISTER_SCRIPTFUNCTION_NS(Internal, EvenMinutesTimePeriod, &TimePeriodTask::EvenMinutesTimePeriodUpdate, "tp:begin:end");
-Array::Ptr TimePeriodTask::EmptyTimePeriodUpdate(const TimePeriod::Ptr&, double, double)
+Array::Ptr TimePeriodTask::EmptyTimePeriodUpdate(const TimePeriod::Ptr& tp, double, double)
{
+ RequireNotNull(tp);
+
Array::Ptr segments = new Array();
return segments;
}
-Array::Ptr TimePeriodTask::EvenMinutesTimePeriodUpdate(const TimePeriod::Ptr&, double begin, double end)
+Array::Ptr TimePeriodTask::EvenMinutesTimePeriodUpdate(const TimePeriod::Ptr& tp, double begin, double end)
{
Array::Ptr segments = new Array();
+ RequireNotNull(tp);
for (long t = begin / 60 - 1; t * 60 < end; t++) {
if ((t % 2) == 0) {
From 71c420d5014cd84e67acd1504945ee542d48cc39 Mon Sep 17 00:00:00 2001
From: Noah Hilverling
Date: Wed, 31 Jan 2018 10:17:49 +0100
Subject: [PATCH 13/57] Fix nullptr deref in cluster events
---
lib/icinga/clusterevents.cpp | 30 ----------------------------
lib/remote/jsonrpcconnection-pki.cpp | 3 ---
lib/remote/jsonrpcconnection.cpp | 9 +++++----
3 files changed, 5 insertions(+), 37 deletions(-)
diff --git a/lib/icinga/clusterevents.cpp b/lib/icinga/clusterevents.cpp
index 57b4691e1..a9d8ba825 100644
--- a/lib/icinga/clusterevents.cpp
+++ b/lib/icinga/clusterevents.cpp
@@ -114,9 +114,6 @@ Value ClusterEvents::CheckResultAPIHandler(const MessageOrigin::Ptr& origin, con
return Empty;
}
- if (!params)
- return Empty;
-
CheckResult::Ptr cr;
Array::Ptr vperf;
@@ -220,9 +217,6 @@ Value ClusterEvents::NextCheckChangedAPIHandler(const MessageOrigin::Ptr& origin
return Empty;
}
- if (!params)
- return Empty;
-
Host::Ptr host = Host::GetByName(params->Get("host"));
if (!host)
@@ -284,9 +278,6 @@ Value ClusterEvents::NextNotificationChangedAPIHandler(const MessageOrigin::Ptr&
return Empty;
}
- if (!params)
- return Empty;
-
Notification::Ptr notification = Notification::GetByName(params->Get("notification"));
if (!notification)
@@ -344,9 +335,6 @@ Value ClusterEvents::ForceNextCheckChangedAPIHandler(const MessageOrigin::Ptr& o
return Empty;
}
- if (!params)
- return Empty;
-
Host::Ptr host = Host::GetByName(params->Get("host"));
if (!host)
@@ -409,9 +397,6 @@ Value ClusterEvents::ForceNextNotificationChangedAPIHandler(const MessageOrigin:
return Empty;
}
- if (!params)
- return Empty;
-
Host::Ptr host = Host::GetByName(params->Get("host"));
if (!host)
@@ -480,9 +465,6 @@ Value ClusterEvents::AcknowledgementSetAPIHandler(const MessageOrigin::Ptr& orig
return Empty;
}
- if (!params)
- return Empty;
-
Host::Ptr host = Host::GetByName(params->Get("host"));
if (!host)
@@ -546,9 +528,6 @@ Value ClusterEvents::AcknowledgementClearedAPIHandler(const MessageOrigin::Ptr&
return Empty;
}
- if (!params)
- return Empty;
-
Host::Ptr host = Host::GetByName(params->Get("host"));
if (!host)
@@ -717,9 +696,6 @@ Value ClusterEvents::SendNotificationsAPIHandler(const MessageOrigin::Ptr& origi
return Empty;
}
- if (!params)
- return Empty;
-
Host::Ptr host = Host::GetByName(params->Get("host"));
if (!host)
@@ -811,9 +787,6 @@ Value ClusterEvents::NotificationSentUserAPIHandler(const MessageOrigin::Ptr& or
return Empty;
}
- if (!params)
- return Empty;
-
Host::Ptr host = Host::GetByName(params->Get("host"));
if (!host)
@@ -927,9 +900,6 @@ Value ClusterEvents::NotificationSentToAllUsersAPIHandler(const MessageOrigin::P
return Empty;
}
- if (!params)
- return Empty;
-
Host::Ptr host = Host::GetByName(params->Get("host"));
if (!host)
diff --git a/lib/remote/jsonrpcconnection-pki.cpp b/lib/remote/jsonrpcconnection-pki.cpp
index 048d6c1c1..5a76524e2 100644
--- a/lib/remote/jsonrpcconnection-pki.cpp
+++ b/lib/remote/jsonrpcconnection-pki.cpp
@@ -40,9 +40,6 @@ REGISTER_APIFUNCTION(UpdateCertificate, pki, &UpdateCertificateHandler);
Value RequestCertificateHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params)
{
- if (!params)
- return Empty;
-
String certText = params->Get("cert_request");
boost::shared_ptr cert;
diff --git a/lib/remote/jsonrpcconnection.cpp b/lib/remote/jsonrpcconnection.cpp
index e6cd9a3c8..0be3fb46e 100644
--- a/lib/remote/jsonrpcconnection.cpp
+++ b/lib/remote/jsonrpcconnection.cpp
@@ -212,7 +212,11 @@ void JsonRpcConnection::MessageHandler(const String& jsonString)
Log(LogNotice, "JsonRpcConnection")
<< "Call to non-existent function '" << method << "' from endpoint '" << m_Identity << "'.";
} else {
- resultMessage->Set("result", afunc->Invoke(origin, message->Get("params")));
+ Dictionary::Ptr params = message->Get("params");
+ if (params)
+ resultMessage->Set("result", afunc->Invoke(origin, params));
+ else
+ resultMessage->Set("result", Empty);
}
} catch (const std::exception& ex) {
/* TODO: Add a user readable error message for the remote caller */
@@ -274,9 +278,6 @@ void JsonRpcConnection::DataAvailableHandler(void)
Value SetLogPositionHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params)
{
- if (!params)
- return Empty;
-
double log_position = params->Get("log_position");
Endpoint::Ptr endpoint = origin->FromClient->GetEndpoint();
From 9de36c0999a1fe189e30a79acc8344c9d2dc90eb Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Wed, 21 Feb 2018 13:42:58 +0100
Subject: [PATCH 14/57] Rename macro RequireNotNull to REQUIRE_NOT_NULL
---
lib/base/array-script.cpp | 34 +++++++++++++-------------
lib/base/configobject-script.cpp | 4 +--
lib/base/datetime-script.cpp | 2 +-
lib/base/dictionary-script.cpp | 16 ++++++------
lib/base/function-script.cpp | 4 +--
lib/base/object-script.cpp | 6 ++---
lib/base/object.hpp | 2 +-
lib/base/typetype-script.cpp | 2 +-
lib/icinga/checkable-script.cpp | 2 +-
lib/icinga/macroprocessor.cpp | 4 +--
lib/methods/clusterchecktask.cpp | 4 +--
lib/methods/clusterzonechecktask.cpp | 4 +--
lib/methods/exceptionchecktask.cpp | 6 ++---
lib/methods/icingachecktask.cpp | 8 +++---
lib/methods/nullchecktask.cpp | 4 +--
lib/methods/nulleventtask.cpp | 2 +-
lib/methods/pluginchecktask.cpp | 4 +--
lib/methods/plugineventtask.cpp | 2 +-
lib/methods/pluginnotificationtask.cpp | 4 +--
lib/methods/randomchecktask.cpp | 4 +--
lib/methods/timeperiodtask.cpp | 4 +--
21 files changed, 61 insertions(+), 61 deletions(-)
diff --git a/lib/base/array-script.cpp b/lib/base/array-script.cpp
index b9535ef98..d97873819 100644
--- a/lib/base/array-script.cpp
+++ b/lib/base/array-script.cpp
@@ -30,7 +30,7 @@ static double ArrayLen(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->GetLength();
}
@@ -38,7 +38,7 @@ static void ArraySet(int index, const Value& value)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
self->Set(index, value);
}
@@ -46,7 +46,7 @@ static Value ArrayGet(int index)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->Get(index);
}
@@ -54,7 +54,7 @@ static void ArrayAdd(const Value& value)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
self->Add(value);
}
@@ -62,7 +62,7 @@ static void ArrayRemove(int index)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
self->Remove(index);
}
@@ -70,7 +70,7 @@ static bool ArrayContains(const Value& value)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->Contains(value);
}
@@ -78,7 +78,7 @@ static void ArrayClear(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
self->Clear();
}
@@ -94,7 +94,7 @@ static Array::Ptr ArraySort(const std::vector& args)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
Array::Ptr arr = self->ShallowClone();
@@ -118,7 +118,7 @@ static Array::Ptr ArrayShallowClone(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->ShallowClone();
}
@@ -126,7 +126,7 @@ static Value ArrayJoin(const Value& separator)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
Value result;
bool first = true;
@@ -149,7 +149,7 @@ static Array::Ptr ArrayReverse(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->Reverse();
}
@@ -157,7 +157,7 @@ static Array::Ptr ArrayMap(const Function::Ptr& function)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
if (vframe->Sandboxed && !function->IsSideEffectFree())
BOOST_THROW_EXCEPTION(ScriptError("Map function must be side-effect free."));
@@ -178,7 +178,7 @@ static Value ArrayReduce(const Function::Ptr& function)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
if (vframe->Sandboxed && !function->IsSideEffectFree())
BOOST_THROW_EXCEPTION(ScriptError("Reduce function must be side-effect free."));
@@ -203,7 +203,7 @@ static Array::Ptr ArrayFilter(const Function::Ptr& function)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
if (vframe->Sandboxed && !function->IsSideEffectFree())
BOOST_THROW_EXCEPTION(ScriptError("Filter function must be side-effect free."));
@@ -225,7 +225,7 @@ static bool ArrayAny(const Function::Ptr& function)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
if (vframe->Sandboxed && !function->IsSideEffectFree())
BOOST_THROW_EXCEPTION(ScriptError("Filter function must be side-effect free."));
@@ -245,7 +245,7 @@ static bool ArrayAll(const Function::Ptr& function)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
if (vframe->Sandboxed && !function->IsSideEffectFree())
BOOST_THROW_EXCEPTION(ScriptError("Filter function must be side-effect free."));
@@ -264,7 +264,7 @@ static Array::Ptr ArrayUnique(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Array::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
std::set result;
diff --git a/lib/base/configobject-script.cpp b/lib/base/configobject-script.cpp
index 30d22ceff..a9de57d40 100644
--- a/lib/base/configobject-script.cpp
+++ b/lib/base/configobject-script.cpp
@@ -29,7 +29,7 @@ static void ConfigObjectModifyAttribute(const String& attr, const Value& value)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
ConfigObject::Ptr self = vframe->Self;
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->ModifyAttribute(attr, value);
}
@@ -37,7 +37,7 @@ static void ConfigObjectRestoreAttribute(const String& attr)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
ConfigObject::Ptr self = vframe->Self;
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->RestoreAttribute(attr);
}
diff --git a/lib/base/datetime-script.cpp b/lib/base/datetime-script.cpp
index 2e2f2f10b..dd8207d63 100644
--- a/lib/base/datetime-script.cpp
+++ b/lib/base/datetime-script.cpp
@@ -29,7 +29,7 @@ static String DateTimeFormat(const String& format)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
DateTime::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->Format(format);
}
diff --git a/lib/base/dictionary-script.cpp b/lib/base/dictionary-script.cpp
index 9059a0a51..04e90aa69 100644
--- a/lib/base/dictionary-script.cpp
+++ b/lib/base/dictionary-script.cpp
@@ -29,7 +29,7 @@ static double DictionaryLen(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->GetLength();
}
@@ -37,7 +37,7 @@ static void DictionarySet(const String& key, const Value& value)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
self->Set(key, value);
}
@@ -45,7 +45,7 @@ static Value DictionaryGet(const String& key)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->Get(key);
}
@@ -53,7 +53,7 @@ static void DictionaryRemove(const String& key)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
self->Remove(key);
}
@@ -61,7 +61,7 @@ static bool DictionaryContains(const String& key)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->Contains(key);
}
@@ -69,7 +69,7 @@ static Dictionary::Ptr DictionaryShallowClone(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->ShallowClone();
}
@@ -78,7 +78,7 @@ static Array::Ptr DictionaryKeys(void)
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
Array::Ptr keys = new Array();
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
ObjectLock olock(self);
for (const Dictionary::Pair& kv : self) {
@@ -92,7 +92,7 @@ static Array::Ptr DictionaryValues(void)
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Dictionary::Ptr self = static_cast(vframe->Self);
Array::Ptr keys = new Array();
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
ObjectLock olock(self);
for (const Dictionary::Pair& kv : self) {
diff --git a/lib/base/function-script.cpp b/lib/base/function-script.cpp
index cd40feacb..ac7fed4ba 100644
--- a/lib/base/function-script.cpp
+++ b/lib/base/function-script.cpp
@@ -32,7 +32,7 @@ static Value FunctionCall(const std::vector& args)
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Function::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
std::vector uargs(args.begin() + 1, args.end());
return self->Invoke(args[0], uargs);
@@ -42,7 +42,7 @@ static Value FunctionCallV(const Value& thisArg, const Array::Ptr& args)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Function::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
std::vector uargs;
diff --git a/lib/base/object-script.cpp b/lib/base/object-script.cpp
index 27bc487da..df136b496 100644
--- a/lib/base/object-script.cpp
+++ b/lib/base/object-script.cpp
@@ -29,7 +29,7 @@ static String ObjectToString(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Object::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->ToString();
}
@@ -37,7 +37,7 @@ static void ObjectNotifyAttribute(const String& attribute)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Object::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
self->NotifyField(self->GetReflectionType()->GetFieldId(attribute));
}
@@ -45,7 +45,7 @@ static Object::Ptr ObjectClone(void)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Object::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
return self->Clone();
}
diff --git a/lib/base/object.hpp b/lib/base/object.hpp
index 6159c5b5e..dc585665b 100644
--- a/lib/base/object.hpp
+++ b/lib/base/object.hpp
@@ -62,7 +62,7 @@ extern I2_BASE_API Value Empty;
DECLARE_PTR_TYPEDEFS(klass); \
IMPL_TYPE_LOOKUP();
-#define RequireNotNull(ptr) RequireNotNullInternal(ptr, #ptr)
+#define REQUIRE_NOT_NULL(ptr) RequireNotNullInternal(ptr, #ptr)
I2_BASE_API void RequireNotNullInternal(const intrusive_ptr& object, const char *description);
diff --git a/lib/base/typetype-script.cpp b/lib/base/typetype-script.cpp
index 591de4667..c9d42f731 100644
--- a/lib/base/typetype-script.cpp
+++ b/lib/base/typetype-script.cpp
@@ -37,7 +37,7 @@ static void TypeRegisterAttributeHandler(const String& fieldName, const Function
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Type::Ptr self = static_cast(vframe->Self);
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
int fid = self->GetFieldId(fieldName);
self->RegisterAttributeHandler(fid, boost::bind(&InvokeAttributeHandlerHelper, callback, _1, _2));
diff --git a/lib/icinga/checkable-script.cpp b/lib/icinga/checkable-script.cpp
index f7ba56e80..89b98d3c8 100644
--- a/lib/icinga/checkable-script.cpp
+++ b/lib/icinga/checkable-script.cpp
@@ -30,7 +30,7 @@ static void CheckableProcessCheckResult(const CheckResult::Ptr& cr)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
Checkable::Ptr self = vframe->Self;
- RequireNotNull(self);
+ REQUIRE_NOT_NULL(self);
self->ProcessCheckResult(cr);
}
diff --git a/lib/icinga/macroprocessor.cpp b/lib/icinga/macroprocessor.cpp
index ac45f1c90..a295156f7 100644
--- a/lib/icinga/macroprocessor.cpp
+++ b/lib/icinga/macroprocessor.cpp
@@ -41,7 +41,7 @@ Value MacroProcessor::ResolveMacros(const Value& str, const ResolverList& resolv
bool useResolvedMacros, int recursionLevel)
{
if (useResolvedMacros)
- RequireNotNull(resolvedMacros);
+ REQUIRE_NOT_NULL(resolvedMacros);
Value result;
@@ -458,7 +458,7 @@ Value MacroProcessor::ResolveArguments(const Value& command, const Dictionary::P
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros, int recursionLevel)
{
if (useResolvedMacros)
- RequireNotNull(resolvedMacros);
+ REQUIRE_NOT_NULL(resolvedMacros);
Value resolvedCommand;
if (!arguments || command.IsObjectType() || command.IsObjectType())
diff --git a/lib/methods/clusterchecktask.cpp b/lib/methods/clusterchecktask.cpp
index 513a5a475..0f3935181 100644
--- a/lib/methods/clusterchecktask.cpp
+++ b/lib/methods/clusterchecktask.cpp
@@ -38,8 +38,8 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, ClusterCheck, &ClusterCheckTask::ScriptFunc
void ClusterCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
- RequireNotNull(checkable);
- RequireNotNull(cr);
+ REQUIRE_NOT_NULL(checkable);
+ REQUIRE_NOT_NULL(cr);
if (resolvedMacros && !useResolvedMacros)
return;
diff --git a/lib/methods/clusterzonechecktask.cpp b/lib/methods/clusterzonechecktask.cpp
index 699ef9bf3..593b927d7 100644
--- a/lib/methods/clusterzonechecktask.cpp
+++ b/lib/methods/clusterzonechecktask.cpp
@@ -34,8 +34,8 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, ClusterZoneCheck, &ClusterZoneCheckTask::Sc
void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
- RequireNotNull(checkable);
- RequireNotNull(cr);
+ REQUIRE_NOT_NULL(checkable);
+ REQUIRE_NOT_NULL(cr);
ApiListener::Ptr listener = ApiListener::GetInstance();
diff --git a/lib/methods/exceptionchecktask.cpp b/lib/methods/exceptionchecktask.cpp
index 120264327..9045155e8 100644
--- a/lib/methods/exceptionchecktask.cpp
+++ b/lib/methods/exceptionchecktask.cpp
@@ -31,11 +31,11 @@ using namespace icinga;
REGISTER_SCRIPTFUNCTION_NS(Internal, ExceptionCheck, &ExceptionCheckTask::ScriptFunc, "checkable:cr:resolvedMacros:useResolvedMacros");
-void ExceptionCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
+void ExceptionCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
- RequireNotNull(service);
- RequireNotNull(cr);
+ REQUIRE_NOT_NULL(checkable);
+ REQUIRE_NOT_NULL(cr);
if (resolvedMacros && !useResolvedMacros)
return;
diff --git a/lib/methods/icingachecktask.cpp b/lib/methods/icingachecktask.cpp
index d96dfedd1..b288b6be2 100644
--- a/lib/methods/icingachecktask.cpp
+++ b/lib/methods/icingachecktask.cpp
@@ -32,11 +32,11 @@ using namespace icinga;
REGISTER_SCRIPTFUNCTION_NS(Internal, IcingaCheck, &IcingaCheckTask::ScriptFunc, "checkable:cr:resolvedMacros:useResolvedMacros");
-void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
+void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
- RequireNotNull(service);
- RequireNotNull(cr);
+ REQUIRE_NOT_NULL(checkable);
+ REQUIRE_NOT_NULL(cr);
if (resolvedMacros && !useResolvedMacros)
return;
@@ -115,5 +115,5 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResul
} else
cr->SetState(ServiceOK);
- service->ProcessCheckResult(cr);
+ checkable->ProcessCheckResult(cr);
}
diff --git a/lib/methods/nullchecktask.cpp b/lib/methods/nullchecktask.cpp
index 50d2409a1..d9b1a9e5f 100644
--- a/lib/methods/nullchecktask.cpp
+++ b/lib/methods/nullchecktask.cpp
@@ -35,8 +35,8 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, NullCheck, &NullCheckTask::ScriptFunc, "che
void NullCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
- RequireNotNull(checkable);
- RequireNotNull(cr);
+ REQUIRE_NOT_NULL(checkable);
+ REQUIRE_NOT_NULL(cr);
if (resolvedMacros && !useResolvedMacros)
return;
diff --git a/lib/methods/nulleventtask.cpp b/lib/methods/nulleventtask.cpp
index f80edd4e0..21a96c230 100644
--- a/lib/methods/nulleventtask.cpp
+++ b/lib/methods/nulleventtask.cpp
@@ -27,5 +27,5 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, NullEvent, &NullEventTask::ScriptFunc, "che
void NullEventTask::ScriptFunc(const Checkable::Ptr& checkable, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
- RequireNotNull(checkable);
+ REQUIRE_NOT_NULL(checkable);
}
diff --git a/lib/methods/pluginchecktask.cpp b/lib/methods/pluginchecktask.cpp
index ddd8dba38..bb1c25d2f 100644
--- a/lib/methods/pluginchecktask.cpp
+++ b/lib/methods/pluginchecktask.cpp
@@ -38,8 +38,8 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, PluginCheck, &PluginCheckTask::ScriptFunc,
void PluginCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
- RequireNotNull(checkable);
- RequireNotNull(cr);
+ REQUIRE_NOT_NULL(checkable);
+ REQUIRE_NOT_NULL(cr);
CheckCommand::Ptr commandObj = checkable->GetCheckCommand();
diff --git a/lib/methods/plugineventtask.cpp b/lib/methods/plugineventtask.cpp
index a1a49f066..5c0dc79ee 100644
--- a/lib/methods/plugineventtask.cpp
+++ b/lib/methods/plugineventtask.cpp
@@ -36,7 +36,7 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, PluginEvent, &PluginEventTask::ScriptFunc,
void PluginEventTask::ScriptFunc(const Checkable::Ptr& checkable,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
- RequireNotNull(checkable);
+ REQUIRE_NOT_NULL(checkable);
EventCommand::Ptr commandObj = checkable->GetEventCommand();
diff --git a/lib/methods/pluginnotificationtask.cpp b/lib/methods/pluginnotificationtask.cpp
index 730ae6770..bfab41cc0 100644
--- a/lib/methods/pluginnotificationtask.cpp
+++ b/lib/methods/pluginnotificationtask.cpp
@@ -39,8 +39,8 @@ void PluginNotificationTask::ScriptFunc(const Notification::Ptr& notification,
const String& author, const String& comment, const Dictionary::Ptr& resolvedMacros,
bool useResolvedMacros)
{
- RequireNotNull(notification);
- RequireNotNull(user);
+ REQUIRE_NOT_NULL(notification);
+ REQUIRE_NOT_NULL(user);
NotificationCommand::Ptr commandObj = notification->GetCommand();
diff --git a/lib/methods/randomchecktask.cpp b/lib/methods/randomchecktask.cpp
index 7afa0c7af..23ac841a7 100644
--- a/lib/methods/randomchecktask.cpp
+++ b/lib/methods/randomchecktask.cpp
@@ -35,8 +35,8 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, RandomCheck, &RandomCheckTask::ScriptFunc,
void RandomCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
{
- RequireNotNull(checkable);
- RequireNotNull(cr);
+ REQUIRE_NOT_NULL(checkable);
+ REQUIRE_NOT_NULL(cr);
if (resolvedMacros && !useResolvedMacros)
return;
diff --git a/lib/methods/timeperiodtask.cpp b/lib/methods/timeperiodtask.cpp
index 92c57b3cf..e76949f7b 100644
--- a/lib/methods/timeperiodtask.cpp
+++ b/lib/methods/timeperiodtask.cpp
@@ -27,7 +27,7 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, EvenMinutesTimePeriod, &TimePeriodTask::Eve
Array::Ptr TimePeriodTask::EmptyTimePeriodUpdate(const TimePeriod::Ptr& tp, double, double)
{
- RequireNotNull(tp);
+ REQUIRE_NOT_NULL(tp);
Array::Ptr segments = new Array();
return segments;
@@ -36,7 +36,7 @@ Array::Ptr TimePeriodTask::EmptyTimePeriodUpdate(const TimePeriod::Ptr& tp, doub
Array::Ptr TimePeriodTask::EvenMinutesTimePeriodUpdate(const TimePeriod::Ptr& tp, double begin, double end)
{
Array::Ptr segments = new Array();
- RequireNotNull(tp);
+ REQUIRE_NOT_NULL(tp);
for (long t = begin / 60 - 1; t * 60 < end; t++) {
if ((t % 2) == 0) {
From 3cb7d2dbd088c81a5f51becc5ec872f759ea79f3 Mon Sep 17 00:00:00 2001
From: Dirk Goetz
Date: Mon, 15 Jan 2018 15:05:09 +0100
Subject: [PATCH 15/57] SELinux: Allows icinga2_t to send sigkill to all
domains it transitions to
Fixes #5916
---
tools/selinux/icinga2.if | 1 +
tools/selinux/icinga2.te | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/selinux/icinga2.if b/tools/selinux/icinga2.if
index f54ad4fe3..15fb03478 100644
--- a/tools/selinux/icinga2.if
+++ b/tools/selinux/icinga2.if
@@ -364,6 +364,7 @@ interface(`icinga2_execstrans',`
')
domtrans_pattern(icinga2_t, $1, $2)
+ allow icinga2_t $2:process sigkill;
')
######################################
diff --git a/tools/selinux/icinga2.te b/tools/selinux/icinga2.te
index 1db47d3f6..da6e8b884 100644
--- a/tools/selinux/icinga2.te
+++ b/tools/selinux/icinga2.te
@@ -1,4 +1,4 @@
-policy_module(icinga2, 0.1.4)
+policy_module(icinga2, 0.1.5)
########################################
#
From 0339a2b8277c046909ccd17380f5848e0540615a Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Wed, 31 Jan 2018 07:59:49 +0100
Subject: [PATCH 16/57] Add validation for HTTP connection sizes
---
lib/remote/httpchunkedencoding.cpp | 2 ++
lib/remote/httprequest.cpp | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/remote/httpchunkedencoding.cpp b/lib/remote/httpchunkedencoding.cpp
index 8903a4305..32d7c199c 100644
--- a/lib/remote/httpchunkedencoding.cpp
+++ b/lib/remote/httpchunkedencoding.cpp
@@ -37,6 +37,8 @@ StreamReadStatus HttpChunkedEncoding::ReadChunkFromStream(const Stream::Ptr& str
msgbuf << std::hex << line;
msgbuf >> context.LengthIndicator;
+ if (context.LengthIndicator < 0)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("HTTP chunk length must not be negative."));
}
StreamReadContext& scontext = context.StreamContext;
diff --git a/lib/remote/httprequest.cpp b/lib/remote/httprequest.cpp
index 43918c322..0a2f161ab 100644
--- a/lib/remote/httprequest.cpp
+++ b/lib/remote/httprequest.cpp
@@ -131,7 +131,12 @@ bool HttpRequest::Parse(StreamReadContext& src, bool may_wait)
src.MustRead = false;
}
- size_t length_indicator = Convert::ToLong(Headers->Get("content-length"));
+ long length_indicator_signed = Convert::ToLong(Headers->Get("content-length"));
+
+ if (length_indicator_signed < 0)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Content-Length must not be negative."));
+
+ size_t length_indicator = length_indicator_signed;
if (src.Size < length_indicator) {
src.MustRead = true;
From f5f8b90ec841dc3781b9947557c14b9337d778f0 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Wed, 31 Jan 2018 09:05:06 +0100
Subject: [PATCH 17/57] Add HTTP Header size limits
---
lib/remote/httprequest.cpp | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/lib/remote/httprequest.cpp b/lib/remote/httprequest.cpp
index 0a2f161ab..b29088092 100644
--- a/lib/remote/httprequest.cpp
+++ b/lib/remote/httprequest.cpp
@@ -45,8 +45,15 @@ bool HttpRequest::Parse(StreamReadContext& src, bool may_wait)
String line;
StreamReadStatus srs = m_Stream->ReadLine(&line, src, may_wait);
- if (srs != StatusNewItem)
+ if (srs != StatusNewItem) {
+ if (src.Size > 512)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Line length for HTTP header exceeded"));
+
return false;
+ }
+
+ if (line.GetLength() > 512)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Line length for HTTP header exceeded"));
if (m_State == HttpRequestStart) {
/* ignore trailing new-lines */
@@ -84,6 +91,9 @@ bool HttpRequest::Parse(StreamReadContext& src, bool may_wait)
return true;
} else {
+ if (Headers->GetLength() > 128)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Maximum number of HTTP request headers exceeded"));
+
String::SizeType pos = line.FindFirstOf(":");
if (pos == String::NPos)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid HTTP request"));
From e1c46cedd1f104d3a9c61bec601b651d5c70e180 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Tue, 30 Jan 2018 13:34:26 +0100
Subject: [PATCH 18/57] Fix nullptr deref
---
lib/remote/httpserverconnection.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index c2538b6eb..d13086b40 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -165,9 +165,12 @@ void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
String requestUrl = request.RequestUrl->Format();
+ Socket::Ptr socket = m_Stream->GetSocket();
+
Log(LogInformation, "HttpServerConnection")
- << "Request: " << request.RequestMethod << " " << requestUrl
- << " (from " << m_Stream->GetSocket()->GetPeerAddress() << ", user: " << (user ? user->GetName() : "") << ")";
+ << "Request: " << request.RequestMethod << " " << requestUrl
+ << " (from " << (socket ? socket->GetPeerAddress() : "")
+ << ", user: " << (user ? user->GetName() : "") << ")";
HttpResponse response(m_Stream, request);
From a46dc64e6a99742525e25b637844b81f30a0da81 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Thu, 1 Feb 2018 15:10:28 +0100
Subject: [PATCH 19/57] Only read body from authenticated connections
This means we are not allowing unauthenticated requests anymore
---
lib/remote/httprequest.cpp | 248 +++++++++++++++-------------
lib/remote/httprequest.hpp | 6 +-
lib/remote/httpserverconnection.cpp | 46 ++++--
3 files changed, 162 insertions(+), 138 deletions(-)
diff --git a/lib/remote/httprequest.cpp b/lib/remote/httprequest.cpp
index b29088092..2c731c4fc 100644
--- a/lib/remote/httprequest.cpp
+++ b/lib/remote/httprequest.cpp
@@ -29,135 +29,147 @@
using namespace icinga;
HttpRequest::HttpRequest(const Stream::Ptr& stream)
- : Complete(false),
- ProtocolVersion(HttpVersion11),
- Headers(new Dictionary()),
- m_Stream(stream),
- m_State(HttpRequestStart)
+ : CompleteHeaders(false),
+ CompleteBody(false),
+ ProtocolVersion(HttpVersion11),
+ Headers(new Dictionary()),
+ m_Stream(stream),
+ m_State(HttpRequestStart)
{ }
-bool HttpRequest::Parse(StreamReadContext& src, bool may_wait)
+bool HttpRequest::ParseHeader(StreamReadContext& src, bool may_wait)
{
if (!m_Stream)
return false;
- if (m_State != HttpRequestBody) {
- String line;
- StreamReadStatus srs = m_Stream->ReadLine(&line, src, may_wait);
+ if (m_State != HttpRequestStart && m_State != HttpRequestHeaders)
+ return false;
- if (srs != StatusNewItem) {
- if (src.Size > 512)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Line length for HTTP header exceeded"));
+ String line;
+ StreamReadStatus srs = m_Stream->ReadLine(&line, src, may_wait);
+ if (srs != StatusNewItem) {
+ if (src.Size > 512)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Line length for HTTP header exceeded"));
+
+ return false;
+ }
+
+ if (line.GetLength() > 512)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Line length for HTTP header exceeded"));
+
+ if (m_State == HttpRequestStart) {
+ /* ignore trailing new-lines */
+ if (line == "")
+ return true;
+
+ std::vector tokens = line.Split(" ");
+ Log(LogDebug, "HttpRequest")
+ << "line: " << line << ", tokens: " << tokens.size();
+ if (tokens.size() != 3)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid HTTP request"));
+
+ RequestMethod = tokens[0];
+ RequestUrl = new class Url(tokens[1]);
+
+ if (tokens[2] == "HTTP/1.0")
+ ProtocolVersion = HttpVersion10;
+ else if (tokens[2] == "HTTP/1.1") {
+ ProtocolVersion = HttpVersion11;
+ } else
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Unsupported HTTP version"));
+
+ m_State = HttpRequestHeaders;
+ return true;
+ } else { // m_State = HttpRequestHeaders
+ if (line == "") {
+ m_State = HttpRequestBody;
+ CompleteHeaders = true;
+ return true;
+
+ } else {
+ if (Headers->GetLength() > 128)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Maximum number of HTTP request headers exceeded"));
+
+ String::SizeType pos = line.FindFirstOf(":");
+ if (pos == String::NPos)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid HTTP request"));
+
+ String key = line.SubStr(0, pos).ToLower().Trim();
+ String value = line.SubStr(pos + 1).Trim();
+ Headers->Set(key, value);
+
+ if (key == "x-http-method-override")
+ RequestMethod = value;
+
+ return true;
+ }
+ }
+}
+
+bool HttpRequest::ParseBody(StreamReadContext& src, bool may_wait)
+{
+ if (!m_Stream || m_State != HttpRequestBody)
+ return false;
+
+ /* we're done if the request doesn't contain a message body */
+ if (!Headers->Contains("content-length") && !Headers->Contains("transfer-encoding")) {
+ CompleteBody = true;
+ return true;
+ } else if (!m_Body)
+ m_Body = new FIFO();
+
+ if (CompleteBody)
+ return true;
+
+ if (Headers->Get("transfer-encoding") == "chunked") {
+ if (!m_ChunkContext)
+ m_ChunkContext = boost::make_shared(boost::ref(src));
+
+ char *data;
+ size_t size;
+ StreamReadStatus srs = HttpChunkedEncoding::ReadChunkFromStream(m_Stream, &data, &size, *m_ChunkContext.get(), may_wait);
+
+ if (srs != StatusNewItem)
+ return false;
+
+ m_Body->Write(data, size);
+
+ delete [] data;
+
+ if (size == 0) {
+ CompleteBody = true;
+ return true;
+ }
+ } else {
+ if (src.Eof)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
+
+ if (src.MustRead) {
+ if (!src.FillFromStream(m_Stream, false)) {
+ src.Eof = true;
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
+ }
+
+ src.MustRead = false;
+ }
+
+ long length_indicator_signed = Convert::ToLong(Headers->Get("content-length"));
+
+ if (length_indicator_signed < 0)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Content-Length must not be negative."));
+
+ size_t length_indicator = length_indicator_signed;
+
+ if (src.Size < length_indicator) {
+ src.MustRead = true;
return false;
}
- if (line.GetLength() > 512)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Line length for HTTP header exceeded"));
-
- if (m_State == HttpRequestStart) {
- /* ignore trailing new-lines */
- if (line == "")
- return true;
-
- std::vector tokens;
- boost::algorithm::split(tokens, line, boost::is_any_of(" "));
- Log(LogDebug, "HttpRequest")
- << "line: " << line << ", tokens: " << tokens.size();
- if (tokens.size() != 3)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid HTTP request"));
-
- RequestMethod = tokens[0];
- RequestUrl = new class Url(tokens[1]);
-
- if (tokens[2] == "HTTP/1.0")
- ProtocolVersion = HttpVersion10;
- else if (tokens[2] == "HTTP/1.1") {
- ProtocolVersion = HttpVersion11;
- } else
- BOOST_THROW_EXCEPTION(std::invalid_argument("Unsupported HTTP version"));
-
- m_State = HttpRequestHeaders;
- } else if (m_State == HttpRequestHeaders) {
- if (line == "") {
- m_State = HttpRequestBody;
-
- /* we're done if the request doesn't contain a message body */
- if (!Headers->Contains("content-length") && !Headers->Contains("transfer-encoding"))
- Complete = true;
- else
- m_Body = new FIFO();
-
- return true;
-
- } else {
- if (Headers->GetLength() > 128)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Maximum number of HTTP request headers exceeded"));
-
- String::SizeType pos = line.FindFirstOf(":");
- if (pos == String::NPos)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid HTTP request"));
-
- String key = line.SubStr(0, pos).ToLower().Trim();
- String value = line.SubStr(pos + 1).Trim();
- Headers->Set(key, value);
-
- if (key == "x-http-method-override")
- RequestMethod = value;
- }
- } else {
- VERIFY(!"Invalid HTTP request state.");
- }
- } else if (m_State == HttpRequestBody) {
- if (Headers->Get("transfer-encoding") == "chunked") {
- if (!m_ChunkContext)
- m_ChunkContext = boost::make_shared(boost::ref(src));
-
- char *data;
- size_t size;
- StreamReadStatus srs = HttpChunkedEncoding::ReadChunkFromStream(m_Stream, &data, &size, *m_ChunkContext.get(), may_wait);
-
- if (srs != StatusNewItem)
- return false;
-
- m_Body->Write(data, size);
-
- delete [] data;
-
- if (size == 0) {
- Complete = true;
- return true;
- }
- } else {
- if (src.Eof)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
-
- if (src.MustRead) {
- if (!src.FillFromStream(m_Stream, false)) {
- src.Eof = true;
- BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
- }
-
- src.MustRead = false;
- }
-
- long length_indicator_signed = Convert::ToLong(Headers->Get("content-length"));
-
- if (length_indicator_signed < 0)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Content-Length must not be negative."));
-
- size_t length_indicator = length_indicator_signed;
-
- if (src.Size < length_indicator) {
- src.MustRead = true;
- return false;
- }
-
- m_Body->Write(src.Buffer, length_indicator);
- src.DropData(length_indicator);
- Complete = true;
- return true;
- }
+ m_Body->Write(src.Buffer, length_indicator);
+ src.DropData(length_indicator);
+ CompleteBody = true;
+ return true;
}
return true;
diff --git a/lib/remote/httprequest.hpp b/lib/remote/httprequest.hpp
index 5a98a2343..f58cfbbb1 100644
--- a/lib/remote/httprequest.hpp
+++ b/lib/remote/httprequest.hpp
@@ -52,7 +52,8 @@ enum HttpRequestState
struct I2_REMOTE_API HttpRequest
{
public:
- bool Complete;
+ bool CompleteHeaders;
+ bool CompleteBody;
String RequestMethod;
Url::Ptr RequestUrl;
@@ -62,7 +63,8 @@ public:
HttpRequest(const Stream::Ptr& stream);
- bool Parse(StreamReadContext& src, bool may_wait);
+ bool ParseHeader(StreamReadContext& src, bool may_wait);
+ bool ParseBody(StreamReadContext& src, bool may_wait);
size_t ReadBody(char *data, size_t count);
void AddHeader(const String& key, const String& value);
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index d13086b40..3fbee20ba 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -92,7 +92,7 @@ bool HttpServerConnection::ProcessMessage(void)
bool res;
try {
- res = m_CurrentRequest.Parse(m_Context, false);
+ res = m_CurrentRequest.ParseHeader(m_Context, false);
} catch (const std::invalid_argument& ex) {
HttpResponse response(m_Stream, m_CurrentRequest);
response.SetStatus(400, "Bad request");
@@ -113,7 +113,7 @@ bool HttpServerConnection::ProcessMessage(void)
return false;
}
- if (m_CurrentRequest.Complete) {
+ if (m_CurrentRequest.CompleteHeaders) {
m_RequestQueue.Enqueue(boost::bind(&HttpServerConnection::ProcessMessageAsync,
HttpServerConnection::Ptr(this), m_CurrentRequest));
@@ -241,25 +241,35 @@ void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
response.WriteBody(msg.CStr(), msg.GetLength());
}
} else {
- try {
- HttpHandler::ProcessRequest(user, request, response);
- } catch (const std::exception& ex) {
- Log(LogCritical, "HttpServerConnection")
- << "Unhandled exception while processing Http request: " << DiagnosticInformation(ex);
- response.SetStatus(503, "Unhandled exception");
+ bool res = true;
+ while (!request.CompleteBody)
+ res = request.ParseBody(m_Context, false);
+ if (!res) {
+ Log(LogCritical, "HttpServerConnection", "Failed to read body");
+ Dictionary::Ptr result = new Dictionary;
+ result->Set("error", 404);
+ result->Set("status", "Bad Request: Malformed body.");
+ HttpUtility::SendJsonBody(response, result);
+ } else {
+ try {
+ HttpHandler::ProcessRequest(user, request, response);
+ } catch (const std::exception& ex) {
+ Log(LogCritical, "HttpServerConnection")
+ << "Unhandled exception while processing Http request: " << DiagnosticInformation(ex);
+ response.SetStatus(503, "Unhandled exception");
- String errorInfo = DiagnosticInformation(ex);
+ String errorInfo = DiagnosticInformation(ex);
- if (request.Headers->Get("accept") == "application/json") {
- Dictionary::Ptr result = new Dictionary();
+ if (request.Headers->Get("accept") == "application/json") {
+ Dictionary::Ptr result = new Dictionary();
+ result->Set("error", 503);
+ result->Set("status", errorInfo);
- result->Set("error", 503);
- result->Set("status", errorInfo);
-
- HttpUtility::SendJsonBody(response, result);
- } else {
- response.AddHeader("Content-Type", "text/plain");
- response.WriteBody(errorInfo.CStr(), errorInfo.GetLength());
+ HttpUtility::SendJsonBody(response, result);
+ } else {
+ response.AddHeader("Content-Type", "text/plain");
+ response.WriteBody(errorInfo.CStr(), errorInfo.GetLength());
+ }
}
}
}
From aa1ccd7ada4a492ddd6c90d882730b750963ebc3 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Thu, 8 Feb 2018 14:54:52 +0100
Subject: [PATCH 20/57] Authenticate API user before parsing body
---
lib/remote/apiuser.cpp | 28 ++++
lib/remote/apiuser.hpp | 1 +
lib/remote/httprequest.cpp | 72 +++++-----
lib/remote/httprequest.hpp | 1 +
lib/remote/httpserverconnection.cpp | 208 +++++++++++++---------------
lib/remote/httpserverconnection.hpp | 6 +-
6 files changed, 169 insertions(+), 147 deletions(-)
diff --git a/lib/remote/apiuser.cpp b/lib/remote/apiuser.cpp
index fd4aec9a5..fedcd7163 100644
--- a/lib/remote/apiuser.cpp
+++ b/lib/remote/apiuser.cpp
@@ -20,6 +20,7 @@
#include "remote/apiuser.hpp"
#include "remote/apiuser.tcpp"
#include "base/configtype.hpp"
+#include "base/base64.hpp"
using namespace icinga;
@@ -34,3 +35,30 @@ ApiUser::Ptr ApiUser::GetByClientCN(const String& cn)
return ApiUser::Ptr();
}
+
+ApiUser::Ptr ApiUser::GetByAuthHeader(const String& auth_header) {
+ String::SizeType pos = auth_header.FindFirstOf(" ");
+ String username, password;
+
+ if (pos != String::NPos && auth_header.SubStr(0, pos) == "Basic") {
+ String credentials_base64 = auth_header.SubStr(pos + 1);
+ String credentials = Base64::Decode(credentials_base64);
+
+ String::SizeType cpos = credentials.FindFirstOf(":");
+
+ if (cpos != String::NPos) {
+ username = credentials.SubStr(0, cpos);
+ password = credentials.SubStr(cpos + 1);
+ }
+ }
+
+ const ApiUser::Ptr& user = ApiUser::GetByName(username);
+
+ /* Deny authentication if 1) given password is empty 2) configured password does not match. */
+ if (password.IsEmpty())
+ return nullptr;
+ else if (user && user->GetPassword() != password)
+ return nullptr;
+
+ return user;
+}
diff --git a/lib/remote/apiuser.hpp b/lib/remote/apiuser.hpp
index 34a994158..4021487b4 100644
--- a/lib/remote/apiuser.hpp
+++ b/lib/remote/apiuser.hpp
@@ -36,6 +36,7 @@ public:
DECLARE_OBJECTNAME(ApiUser);
static ApiUser::Ptr GetByClientCN(const String& cn);
+ static ApiUser::Ptr GetByAuthHeader(const String& auth_header);
};
}
diff --git a/lib/remote/httprequest.cpp b/lib/remote/httprequest.cpp
index 2c731c4fc..a55e12638 100644
--- a/lib/remote/httprequest.cpp
+++ b/lib/remote/httprequest.cpp
@@ -30,6 +30,7 @@ using namespace icinga;
HttpRequest::HttpRequest(const Stream::Ptr& stream)
: CompleteHeaders(false),
+ CompleteHeaderCheck(false),
CompleteBody(false),
ProtocolVersion(HttpVersion11),
Headers(new Dictionary()),
@@ -43,7 +44,7 @@ bool HttpRequest::ParseHeader(StreamReadContext& src, bool may_wait)
return false;
if (m_State != HttpRequestStart && m_State != HttpRequestHeaders)
- return false;
+ BOOST_THROW_EXCEPTION(std::runtime_error("Invalid HTTP state"));
String line;
StreamReadStatus srs = m_Stream->ReadLine(&line, src, may_wait);
@@ -109,19 +110,19 @@ bool HttpRequest::ParseHeader(StreamReadContext& src, bool may_wait)
bool HttpRequest::ParseBody(StreamReadContext& src, bool may_wait)
{
- if (!m_Stream || m_State != HttpRequestBody)
+ if (!m_Stream)
return false;
+ if (m_State != HttpRequestBody)
+ BOOST_THROW_EXCEPTION(std::runtime_error("Invalid HTTP state"));
+
/* we're done if the request doesn't contain a message body */
if (!Headers->Contains("content-length") && !Headers->Contains("transfer-encoding")) {
CompleteBody = true;
- return true;
+ return false;
} else if (!m_Body)
m_Body = new FIFO();
- if (CompleteBody)
- return true;
-
if (Headers->Get("transfer-encoding") == "chunked") {
if (!m_ChunkContext)
m_ChunkContext = boost::make_shared(boost::ref(src));
@@ -139,39 +140,38 @@ bool HttpRequest::ParseBody(StreamReadContext& src, bool may_wait)
if (size == 0) {
CompleteBody = true;
- return true;
- }
- } else {
- if (src.Eof)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
-
- if (src.MustRead) {
- if (!src.FillFromStream(m_Stream, false)) {
- src.Eof = true;
- BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
- }
-
- src.MustRead = false;
- }
-
- long length_indicator_signed = Convert::ToLong(Headers->Get("content-length"));
-
- if (length_indicator_signed < 0)
- BOOST_THROW_EXCEPTION(std::invalid_argument("Content-Length must not be negative."));
-
- size_t length_indicator = length_indicator_signed;
-
- if (src.Size < length_indicator) {
- src.MustRead = true;
return false;
- }
-
- m_Body->Write(src.Buffer, length_indicator);
- src.DropData(length_indicator);
- CompleteBody = true;
- return true;
+ } else
+ return true;
}
+ if (src.Eof)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
+
+ if (src.MustRead) {
+ if (!src.FillFromStream(m_Stream, false)) {
+ src.Eof = true;
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
+ }
+
+ src.MustRead = false;
+ }
+
+ long length_indicator_signed = Convert::ToLong(Headers->Get("content-length"));
+
+ if (length_indicator_signed < 0)
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Content-Length must not be negative."));
+
+ size_t length_indicator = length_indicator_signed;
+
+ if (src.Size < length_indicator) {
+ src.MustRead = true;
+ return false;
+ }
+
+ m_Body->Write(src.Buffer, length_indicator);
+ src.DropData(length_indicator);
+ CompleteBody = true;
return true;
}
diff --git a/lib/remote/httprequest.hpp b/lib/remote/httprequest.hpp
index f58cfbbb1..af7ebfbaa 100644
--- a/lib/remote/httprequest.hpp
+++ b/lib/remote/httprequest.hpp
@@ -53,6 +53,7 @@ struct I2_REMOTE_API HttpRequest
{
public:
bool CompleteHeaders;
+ bool CompleteHeaderCheck;
bool CompleteBody;
String RequestMethod;
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index 3fbee20ba..955862756 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -90,100 +90,105 @@ void HttpServerConnection::Disconnect(void)
bool HttpServerConnection::ProcessMessage(void)
{
bool res;
+ HttpResponse response(m_Stream, m_CurrentRequest);
- try {
- res = m_CurrentRequest.ParseHeader(m_Context, false);
- } catch (const std::invalid_argument& ex) {
- HttpResponse response(m_Stream, m_CurrentRequest);
- response.SetStatus(400, "Bad request");
- String msg = String("Bad request
") + ex.what() + "
";
- response.WriteBody(msg.CStr(), msg.GetLength());
- response.Finish();
+ if (!m_CurrentRequest.CompleteHeaders) {
+ try {
+ res = m_CurrentRequest.ParseHeader(m_Context, false);
+ } catch (const std::invalid_argument& ex) {
+ response.SetStatus(400, "Bad Request");
+ String msg = String("Bad Request
") + ex.what() + " ";
+ response.WriteBody(msg.CStr(), msg.GetLength());
+ response.Finish();
- m_Stream->Shutdown();
- return false;
- } catch (const std::exception& ex) {
- HttpResponse response(m_Stream, m_CurrentRequest);
- response.SetStatus(400, "Bad request");
- String msg = "Bad request
" + DiagnosticInformation(ex) + " ";
- response.WriteBody(msg.CStr(), msg.GetLength());
- response.Finish();
+ m_Stream->Shutdown();
+ return false;
+ } catch (const std::exception& ex) {
+ response.SetStatus(500, "Internal Server Error");
+ String msg = "Internal Server Error
" + DiagnosticInformation(ex) + " ";
+ response.WriteBody(msg.CStr(), msg.GetLength());
+ response.Finish();
- m_Stream->Shutdown();
- return false;
+ m_Stream->Shutdown();
+ return false;
+ }
+ return res;
}
- if (m_CurrentRequest.CompleteHeaders) {
- m_RequestQueue.Enqueue(boost::bind(&HttpServerConnection::ProcessMessageAsync,
- HttpServerConnection::Ptr(this), m_CurrentRequest));
-
- m_Seen = Utility::GetTime();
- m_PendingRequests++;
-
- m_CurrentRequest.~HttpRequest();
- new (&m_CurrentRequest) HttpRequest(m_Stream);
-
- return true;
- }
-
- return res;
-}
-
-void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
-{
- String auth_header = request.Headers->Get("authorization");
-
- String::SizeType pos = auth_header.FindFirstOf(" ");
- String username, password;
-
- if (pos != String::NPos && auth_header.SubStr(0, pos) == "Basic") {
- String credentials_base64 = auth_header.SubStr(pos + 1);
- String credentials = Base64::Decode(credentials_base64);
-
- String::SizeType cpos = credentials.FindFirstOf(":");
-
- if (cpos != String::NPos) {
- username = credentials.SubStr(0, cpos);
- password = credentials.SubStr(cpos + 1);
+ if (!m_CurrentRequest.CompleteHeaderCheck) {
+ m_CurrentRequest.CompleteHeaderCheck = true;
+ if (!ManageHeaders(response)) {
+ m_Stream->Shutdown();
+ return false;
}
}
- ApiUser::Ptr user;
+ if (!m_CurrentRequest.CompleteBody) {
+ try {
+ res = m_CurrentRequest.ParseBody(m_Context, false);
+ } catch (const std::invalid_argument& ex) {
+ response.SetStatus(400, "Bad Request");
+ String msg = String("Bad Request
") + ex.what() + " ";
+ response.WriteBody(msg.CStr(), msg.GetLength());
+ response.Finish();
+
+ m_Stream->Shutdown();
+ return false;
+ } catch (const std::exception& ex) {
+ response.SetStatus(500, "Internal Server Error");
+ String msg = "Internal Server Error
" + DiagnosticInformation(ex) + " ";
+ response.WriteBody(msg.CStr(), msg.GetLength());
+ response.Finish();
+
+ m_Stream->Shutdown();
+ return false;
+ }
+ return res;
+ }
+
+ m_RequestQueue.Enqueue(std::bind(&HttpServerConnection::ProcessMessageAsync,
+ HttpServerConnection::Ptr(this), m_CurrentRequest, response, m_AuthenticatedUser));
+
+ m_Seen = Utility::GetTime();
+ m_PendingRequests++;
+
+ m_CurrentRequest.~HttpRequest();
+ new (&m_CurrentRequest) HttpRequest(m_Stream);
+
+ return false;
+}
+
+bool HttpServerConnection::ManageHeaders(HttpResponse& response)
+{
+ if (m_CurrentRequest.Headers->Get("expect") == "100-continue") {
+ String continueResponse = "HTTP/1.1 100 Continue\r\n\r\n";
+ m_Stream->Write(continueResponse.CStr(), continueResponse.GetLength());
+ }
/* client_cn matched. */
if (m_ApiUser)
- user = m_ApiUser;
- else {
- user = ApiUser::GetByName(username);
+ m_AuthenticatedUser = m_ApiUser;
+ else
+ m_AuthenticatedUser = ApiUser::GetByAuthHeader(m_CurrentRequest.Headers->Get("authorization"));
- /* Deny authentication if 1) given password is empty 2) configured password does not match. */
- if (password.IsEmpty())
- user.reset();
- else if (user && user->GetPassword() != password)
- user.reset();
- }
-
- String requestUrl = request.RequestUrl->Format();
+ String requestUrl = m_CurrentRequest.RequestUrl->Format();
Socket::Ptr socket = m_Stream->GetSocket();
Log(LogInformation, "HttpServerConnection")
- << "Request: " << request.RequestMethod << " " << requestUrl
+ << "Request: " << m_CurrentRequest.RequestMethod << " " << requestUrl
<< " (from " << (socket ? socket->GetPeerAddress() : "")
- << ", user: " << (user ? user->GetName() : "") << ")";
-
- HttpResponse response(m_Stream, request);
+ << ", user: " << (m_AuthenticatedUser ? m_AuthenticatedUser->GetName() : "") << ")";
ApiListener::Ptr listener = ApiListener::GetInstance();
if (!listener)
- return;
+ return false;
Array::Ptr headerAllowOrigin = listener->GetAccessControlAllowOrigin();
if (headerAllowOrigin->GetLength() != 0) {
- String origin = request.Headers->Get("origin");
-
+ String origin = m_CurrentRequest.Headers->Get("origin");
{
ObjectLock olock(headerAllowOrigin);
@@ -196,9 +201,9 @@ void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
if (listener->GetAccessControlAllowCredentials())
response.AddHeader("Access-Control-Allow-Credentials", "true");
- String accessControlRequestMethodHeader = request.Headers->Get("access-control-request-method");
+ String accessControlRequestMethodHeader = m_CurrentRequest.Headers->Get("access-control-request-method");
- if (!accessControlRequestMethodHeader.IsEmpty()) {
+ if (m_CurrentRequest.RequestMethod == "OPTIONS" && !accessControlRequestMethodHeader.IsEmpty()) {
response.SetStatus(200, "OK");
response.AddHeader("Access-Control-Allow-Methods", listener->GetAccessControlAllowMethods());
@@ -208,27 +213,27 @@ void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
response.WriteBody(msg.CStr(), msg.GetLength());
response.Finish();
- m_PendingRequests--;
-
- return;
+ return false;
}
}
- String accept_header = request.Headers->Get("accept");
-
- if (request.RequestMethod != "GET" && accept_header != "application/json") {
+ if (m_CurrentRequest.RequestMethod != "GET" && m_CurrentRequest.Headers->Get("accept") != "application/json") {
response.SetStatus(400, "Wrong Accept header");
response.AddHeader("Content-Type", "text/html");
String msg = "Accept header is missing or not set to 'application/json'. ";
response.WriteBody(msg.CStr(), msg.GetLength());
- } else if (!user) {
+ response.Finish();
+ return false;
+ }
+
+ if (!m_AuthenticatedUser) {
Log(LogWarning, "HttpServerConnection")
- << "Unauthorized request: " << request.RequestMethod << " " << requestUrl;
+ << "Unauthorized request: " << m_CurrentRequest.RequestMethod << " " << requestUrl;
response.SetStatus(401, "Unauthorized");
response.AddHeader("WWW-Authenticate", "Basic realm=\"Icinga 2\"");
- if (request.Headers->Get("accept") == "application/json") {
+ if (m_CurrentRequest.Headers->Get("accept") == "application/json") {
Dictionary::Ptr result = new Dictionary();
result->Set("error", 401);
@@ -240,42 +245,25 @@ void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
String msg = "Unauthorized. Please check your user credentials. ";
response.WriteBody(msg.CStr(), msg.GetLength());
}
- } else {
- bool res = true;
- while (!request.CompleteBody)
- res = request.ParseBody(m_Context, false);
- if (!res) {
- Log(LogCritical, "HttpServerConnection", "Failed to read body");
- Dictionary::Ptr result = new Dictionary;
- result->Set("error", 404);
- result->Set("status", "Bad Request: Malformed body.");
- HttpUtility::SendJsonBody(response, result);
- } else {
- try {
- HttpHandler::ProcessRequest(user, request, response);
- } catch (const std::exception& ex) {
- Log(LogCritical, "HttpServerConnection")
- << "Unhandled exception while processing Http request: " << DiagnosticInformation(ex);
- response.SetStatus(503, "Unhandled exception");
- String errorInfo = DiagnosticInformation(ex);
+ response.Finish();
+ return false;
+ }
- if (request.Headers->Get("accept") == "application/json") {
- Dictionary::Ptr result = new Dictionary();
- result->Set("error", 503);
- result->Set("status", errorInfo);
+ return true;
+}
- HttpUtility::SendJsonBody(response, result);
- } else {
- response.AddHeader("Content-Type", "text/plain");
- response.WriteBody(errorInfo.CStr(), errorInfo.GetLength());
- }
- }
- }
+void HttpServerConnection::ProcessMessageAsync(HttpRequest& request, HttpResponse& response, const ApiUser::Ptr& user)
+{
+ try {
+ HttpHandler::ProcessRequest(user, request, response);
+ } catch (const std::exception& ex) {
+ Log(LogCritical, "HttpServerConnection")
+ << "Unhandled exception while processing Http request: " << DiagnosticInformation(ex);
+ HttpUtility::SendJsonError(response, 503, "Unhandled exception" , DiagnosticInformation(ex));
}
response.Finish();
-
m_PendingRequests--;
}
diff --git a/lib/remote/httpserverconnection.hpp b/lib/remote/httpserverconnection.hpp
index e8f17dc36..22b036c2f 100644
--- a/lib/remote/httpserverconnection.hpp
+++ b/lib/remote/httpserverconnection.hpp
@@ -21,6 +21,7 @@
#define HTTPSERVERCONNECTION_H
#include "remote/httprequest.hpp"
+#include "remote/httpresponse.hpp"
#include "remote/apiuser.hpp"
#include "base/tlsstream.hpp"
#include "base/timer.hpp"
@@ -51,6 +52,7 @@ public:
private:
ApiUser::Ptr m_ApiUser;
+ ApiUser::Ptr m_AuthenticatedUser;
TlsStream::Ptr m_Stream;
double m_Seen;
HttpRequest m_CurrentRequest;
@@ -67,7 +69,9 @@ private:
static void TimeoutTimerHandler(void);
void CheckLiveness(void);
- void ProcessMessageAsync(HttpRequest& request);
+ bool ManageHeaders(HttpResponse& response);
+
+ void ProcessMessageAsync(HttpRequest& request, HttpResponse& response, const ApiUser::Ptr&);
};
}
From 70c81734c51a7f3257da7273cf7738173fc82caa Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Tue, 13 Feb 2018 17:29:48 +0100
Subject: [PATCH 21/57] Add timeout for TLS handshakes
---
lib/base/stream.cpp | 25 ++++++++++++++++++++-----
lib/base/stream.hpp | 4 +++-
lib/base/tlsstream.cpp | 13 +++++++++++--
lib/remote/apilistener.cpp | 12 +++++++++---
lib/remote/httpserverconnection.cpp | 8 +++++++-
lib/remote/pkiutility.cpp | 6 ++++--
6 files changed, 54 insertions(+), 14 deletions(-)
diff --git a/lib/base/stream.cpp b/lib/base/stream.cpp
index 57791d305..4e0ad72dc 100644
--- a/lib/base/stream.cpp
+++ b/lib/base/stream.cpp
@@ -60,7 +60,7 @@ void Stream::SignalDataAvailable(void)
}
}
-bool Stream::WaitForData(int timeout)
+bool Stream::WaitForData()
{
if (!SupportsWaiting())
BOOST_THROW_EXCEPTION(std::runtime_error("Stream does not support waiting."));
@@ -68,10 +68,25 @@ bool Stream::WaitForData(int timeout)
boost::mutex::scoped_lock lock(m_Mutex);
while (!IsDataAvailable() && !IsEof())
- if (timeout < 0)
- m_CV.wait(lock);
- else
- m_CV.timed_wait(lock, boost::posix_time::milliseconds(timeout * 1000));
+ m_CV.wait(lock);
+
+ return IsDataAvailable() || IsEof();
+}
+
+bool Stream::WaitForData(int timeout)
+{
+ if (!SupportsWaiting())
+ BOOST_THROW_EXCEPTION(std::runtime_error("Stream does not support waiting."));
+
+ if (timeout < 0)
+ BOOST_THROW_EXCEPTION(std::runtime_error("Timeout can't be negative"));
+
+ boost::system_time const point_of_timeout = boost::get_system_time() + boost::posix_time::seconds(timeout);
+
+ boost::mutex::scoped_lock lock(m_Mutex);
+
+ while (!IsDataAvailable() && !IsEof() && point_of_timeout > boost::get_system_time())
+ m_CV.timed_wait(lock, point_of_timeout);
return IsDataAvailable() || IsEof();
}
diff --git a/lib/base/stream.hpp b/lib/base/stream.hpp
index 6c39e79aa..63ac31599 100644
--- a/lib/base/stream.hpp
+++ b/lib/base/stream.hpp
@@ -124,8 +124,10 @@ public:
/**
* Waits until data can be read from the stream.
+ * Optionally with a timeout.
*/
- bool WaitForData(int timeout = -1);
+ bool WaitForData();
+ bool WaitForData(int timeout);
virtual bool SupportsWaiting(void) const;
diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp
index 78b1851da..953b2b8f0 100644
--- a/lib/base/tlsstream.cpp
+++ b/lib/base/tlsstream.cpp
@@ -28,6 +28,9 @@
# include
#endif /* _WIN32 */
+#define TLS_TIMEOUT_SECONDS 10
+#define TLS_TIMEOUT_STEP_SECONDS 1
+
using namespace icinga;
int I2_EXPORT TlsStream::m_SSLIndex;
@@ -286,8 +289,14 @@ void TlsStream::Handshake(void)
m_CurrentAction = TlsActionHandshake;
ChangeEvents(POLLOUT);
- while (!m_HandshakeOK && !m_ErrorOccurred && !m_Eof)
- m_CV.wait(lock);
+ boost::system_time const timeout = boost::get_system_time() + boost::posix_time::seconds(TLS_TIMEOUT_SECONDS);
+
+ while (!m_HandshakeOK && !m_ErrorOccurred && !m_Eof && timeout > boost::get_system_time())
+ m_CV.timed_wait(lock, timeout);
+
+ // We should _NOT_ (underline, bold, itallic and wordart) throw an exception for a timeout.
+ if (timeout < boost::get_system_time())
+ BOOST_THROW_EXCEPTION(std::runtime_error("Timeout during handshake."));
if (m_Eof)
BOOST_THROW_EXCEPTION(std::runtime_error("Socket was closed during TLS handshake."));
diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp
index b00c37f6a..107c142b7 100644
--- a/lib/remote/apilistener.cpp
+++ b/lib/remote/apilistener.cpp
@@ -511,11 +511,17 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
JsonRpc::SendMessage(tlsStream, message);
ctype = ClientJsonRpc;
} else {
- tlsStream->WaitForData(5);
+ tlsStream->WaitForData(10);
if (!tlsStream->IsDataAvailable()) {
- Log(LogWarning, "ApiListener")
- << "No data received on new API connection for identity '" << identity << "'. Ensure that the remote endpoints are properly configured in a cluster setup.";
+ if (identity.IsEmpty())
+ Log(LogInformation, "ApiListener")
+ << "No data received on new API connection. "
+ << "Ensure that the remote endpoints are properly configured in a cluster setup.";
+ else
+ Log(LogWarning, "ApiListener")
+ << "No data received on new API connection for identity '" << identity << "'. "
+ << "Ensure that the remote endpoints are properly configured in a cluster setup.";
return;
}
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index 955862756..706ee33a2 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -52,7 +52,7 @@ void HttpServerConnection::StaticInitialize(void)
{
l_HttpServerConnectionTimeoutTimer = new Timer();
l_HttpServerConnectionTimeoutTimer->OnTimerExpired.connect(boost::bind(&HttpServerConnection::TimeoutTimerHandler));
- l_HttpServerConnectionTimeoutTimer->SetInterval(15);
+ l_HttpServerConnectionTimeoutTimer->SetInterval(5);
l_HttpServerConnectionTimeoutTimer->Start();
}
@@ -76,6 +76,12 @@ TlsStream::Ptr HttpServerConnection::GetStream(void) const
void HttpServerConnection::Disconnect(void)
{
+ boost::mutex::scoped_try_lock lock(m_DataHandlerMutex);
+ if (!lock.owns_lock()) {
+ Log(LogInformation, "HttpServerConnection", "Unable to disconnect Http client, I/O thread busy");
+ return;
+ }
+
Log(LogDebug, "HttpServerConnection", "Http client disconnected");
ApiListener::Ptr listener = ApiListener::GetInstance();
diff --git a/lib/remote/pkiutility.cpp b/lib/remote/pkiutility.cpp
index 6e8443bd5..b9da04ebe 100644
--- a/lib/remote/pkiutility.cpp
+++ b/lib/remote/pkiutility.cpp
@@ -121,8 +121,10 @@ boost::shared_ptr PkiUtility::FetchCert(const String& host, const String&
try {
stream->Handshake();
- } catch (...) {
-
+ } catch (const std::exception& ex) {
+ Log(LogCritical, "pki")
+ << "Client TLS handshake failed. (" << ex.what() << ")";
+ return std::shared_ptr();
}
return stream->GetPeerCertificate();
From 3fe818b44bc493c09940279039d1790aef89da2e Mon Sep 17 00:00:00 2001
From: Noah Hilverling
Date: Mon, 19 Feb 2018 10:47:14 +0100
Subject: [PATCH 22/57] Fix requests not being closed correctly
---
lib/remote/httpserverconnection.cpp | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index 706ee33a2..8b0bb5ce6 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -107,7 +107,11 @@ bool HttpServerConnection::ProcessMessage(void)
response.WriteBody(msg.CStr(), msg.GetLength());
response.Finish();
+ m_CurrentRequest.~HttpRequest();
+ new (&m_CurrentRequest) HttpRequest(m_Stream);
+
m_Stream->Shutdown();
+
return false;
} catch (const std::exception& ex) {
response.SetStatus(500, "Internal Server Error");
@@ -115,7 +119,11 @@ bool HttpServerConnection::ProcessMessage(void)
response.WriteBody(msg.CStr(), msg.GetLength());
response.Finish();
+ m_CurrentRequest.~HttpRequest();
+ new (&m_CurrentRequest) HttpRequest(m_Stream);
+
m_Stream->Shutdown();
+
return false;
}
return res;
@@ -124,7 +132,11 @@ bool HttpServerConnection::ProcessMessage(void)
if (!m_CurrentRequest.CompleteHeaderCheck) {
m_CurrentRequest.CompleteHeaderCheck = true;
if (!ManageHeaders(response)) {
+ m_CurrentRequest.~HttpRequest();
+ new (&m_CurrentRequest) HttpRequest(m_Stream);
+
m_Stream->Shutdown();
+
return false;
}
}
@@ -138,7 +150,11 @@ bool HttpServerConnection::ProcessMessage(void)
response.WriteBody(msg.CStr(), msg.GetLength());
response.Finish();
+ m_CurrentRequest.~HttpRequest();
+ new (&m_CurrentRequest) HttpRequest(m_Stream);
+
m_Stream->Shutdown();
+
return false;
} catch (const std::exception& ex) {
response.SetStatus(500, "Internal Server Error");
@@ -146,7 +162,11 @@ bool HttpServerConnection::ProcessMessage(void)
response.WriteBody(msg.CStr(), msg.GetLength());
response.Finish();
+ m_CurrentRequest.~HttpRequest();
+ new (&m_CurrentRequest) HttpRequest(m_Stream);
+
m_Stream->Shutdown();
+
return false;
}
return res;
From 4b77afedcd900b7c0f3a29e5bebf408ae039841a Mon Sep 17 00:00:00 2001
From: Noah Hilverling
Date: Mon, 19 Feb 2018 13:33:58 +0100
Subject: [PATCH 23/57] Limit HTTP body size
---
doc/12-icinga2-api.md | 34 ++++++++++++++++-------------
lib/remote/apiuser.cpp | 3 ++-
lib/remote/httpserverconnection.cpp | 34 +++++++++++++++++++++++++++++
3 files changed, 55 insertions(+), 16 deletions(-)
diff --git a/doc/12-icinga2-api.md b/doc/12-icinga2-api.md
index 15471e9c6..acebac6e1 100644
--- a/doc/12-icinga2-api.md
+++ b/doc/12-icinga2-api.md
@@ -201,23 +201,27 @@ The [regex function](18-library-reference.md#global-functions-regex) is availabl
More information about filters can be found in the [filters](12-icinga2-api.md#icinga2-api-filters) chapter.
+Note that the permissions a API user has also specify the max body size of their requests.
+A API user with `*` permissions is allowed to send 512 MB.
+
+
Available permissions for specific URL endpoints:
- Permissions | URL Endpoint | Supports Filters
- ------------------------------|---------------|-----------------
- actions/<action> | /v1/actions | Yes
- config/query | /v1/config | No
- config/modify | /v1/config | No
- console | /v1/console | No
- events/<type> | /v1/events | No
- objects/query/<type> | /v1/objects | Yes
- objects/create/<type> | /v1/objects | No
- objects/modify/<type> | /v1/objects | Yes
- objects/delete/<type> | /v1/objects | Yes
- status/query | /v1/status | Yes
- templates/<type> | /v1/templates | Yes
- types | /v1/types | Yes
- variables | /v1/variables | Yes
+ Permissions | URL Endpoint | Supports Filters | Max Body Size in MB
+ ------------------------------|---------------|-------------------|---------------------
+ actions/<action> | /v1/actions | Yes | 1
+ config/query | /v1/config | No | 1
+ config/modify | /v1/config | No | 512
+ console | /v1/console | No | 512
+ events/<type> | /v1/events | No | 1
+ objects/query/<type> | /v1/objects | Yes | 1
+ objects/create/<type> | /v1/objects | No | 512
+ objects/modify/<type> | /v1/objects | Yes | 512
+ objects/delete/<type> | /v1/objects | Yes | 512
+ status/query | /v1/status | Yes | 1
+ templates/<type> | /v1/templates | Yes | 1
+ types | /v1/types | Yes | 1
+ variables | /v1/variables | Yes | 1
The required actions or types can be replaced by using a wildcard match ("\*").
diff --git a/lib/remote/apiuser.cpp b/lib/remote/apiuser.cpp
index fedcd7163..c3e95ebe6 100644
--- a/lib/remote/apiuser.cpp
+++ b/lib/remote/apiuser.cpp
@@ -36,7 +36,8 @@ ApiUser::Ptr ApiUser::GetByClientCN(const String& cn)
return ApiUser::Ptr();
}
-ApiUser::Ptr ApiUser::GetByAuthHeader(const String& auth_header) {
+ApiUser::Ptr ApiUser::GetByAuthHeader(const String& auth_header)
+{
String::SizeType pos = auth_header.FindFirstOf(" ");
String username, password;
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index 8b0bb5ce6..ae284df34 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -95,6 +95,7 @@ void HttpServerConnection::Disconnect(void)
bool HttpServerConnection::ProcessMessage(void)
{
+
bool res;
HttpResponse response(m_Stream, m_CurrentRequest);
@@ -186,6 +187,16 @@ bool HttpServerConnection::ProcessMessage(void)
bool HttpServerConnection::ManageHeaders(HttpResponse& response)
{
+ static const size_t defaultContentLengthLimit = 1 * 1028 * 1028;
+ static const Dictionary::Ptr specialContentLengthLimits = new Dictionary({
+ {"*", 512 * 1028 * 1028},
+ {"config/modify", 512 * 1028 * 1028},
+ {"console", 512 * 1028 * 1028},
+ {"objects/create", 512 * 1028 * 1028},
+ {"objects/modify", 512 * 1028 * 1028},
+ {"objects/delete", 512 * 1028 * 1028}
+ });
+
if (m_CurrentRequest.Headers->Get("expect") == "100-continue") {
String continueResponse = "HTTP/1.1 100 Continue\r\n\r\n";
m_Stream->Write(continueResponse.CStr(), continueResponse.GetLength());
@@ -276,6 +287,29 @@ bool HttpServerConnection::ManageHeaders(HttpResponse& response)
return false;
}
+ size_t maxSize = defaultContentLengthLimit;
+
+ Array::Ptr permissions = m_AuthenticatedUser->GetPermissions();
+ ObjectLock olock(permissions);
+
+ for (const Value& permission : permissions) {
+ std::vector permissionParts = String(permission).Split("/");
+ String permissionPath = permissionParts[0] + (permissionParts.size() > 1 ? "/" + permissionParts[1] : "");
+ int size = specialContentLengthLimits->Get(permissionPath);
+ maxSize = size > maxSize ? size : maxSize;
+ }
+
+ size_t contentLength = m_CurrentRequest.Headers->Get("content-length");
+
+ if (contentLength > maxSize) {
+ response.SetStatus(400, "Bad Request");
+ String msg = String("Content length exceeded maximum ");
+ response.WriteBody(msg.CStr(), msg.GetLength());
+ response.Finish();
+
+ return false;
+ }
+
return true;
}
From c5b92defec03f989eb22da2ff769c2314dd7e618 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Wed, 21 Feb 2018 13:22:17 +0100
Subject: [PATCH 24/57] Minor codestyle and doc changes
---
doc/12-icinga2-api.md | 10 ++++------
lib/base/tlsstream.cpp | 1 -
lib/remote/httprequest.cpp | 2 +-
lib/remote/httprequest.hpp | 2 +-
lib/remote/httpserverconnection.cpp | 13 +++++++------
lib/remote/httpserverconnection.hpp | 1 -
6 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/doc/12-icinga2-api.md b/doc/12-icinga2-api.md
index acebac6e1..b2e61765b 100644
--- a/doc/12-icinga2-api.md
+++ b/doc/12-icinga2-api.md
@@ -201,13 +201,12 @@ The [regex function](18-library-reference.md#global-functions-regex) is availabl
More information about filters can be found in the [filters](12-icinga2-api.md#icinga2-api-filters) chapter.
-Note that the permissions a API user has also specify the max body size of their requests.
-A API user with `*` permissions is allowed to send 512 MB.
-
+Permissions are tied to a maximum HTTP request size to prevent abuse, responses sent by Icinga are not limited.
+An API user with all permissions ("\*") may send up to 512 MB regardless of the endpoint.
Available permissions for specific URL endpoints:
- Permissions | URL Endpoint | Supports Filters | Max Body Size in MB
+ Permissions | URL Endpoint | Supports filters | Max body size in MB
------------------------------|---------------|-------------------|---------------------
actions/<action> | /v1/actions | Yes | 1
config/query | /v1/config | No | 1
@@ -227,8 +226,7 @@ The required actions or types can be replaced by using a wildcard match ("\*").
### Parameters
-Depending on the request method there are two ways of
-passing parameters to the request:
+Depending on the request method there are two ways of passing parameters to the request:
* JSON object as request body (all request methods other than `GET`)
* Query string as URL parameter (all request methods)
diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp
index 953b2b8f0..1fda60382 100644
--- a/lib/base/tlsstream.cpp
+++ b/lib/base/tlsstream.cpp
@@ -29,7 +29,6 @@
#endif /* _WIN32 */
#define TLS_TIMEOUT_SECONDS 10
-#define TLS_TIMEOUT_STEP_SECONDS 1
using namespace icinga;
diff --git a/lib/remote/httprequest.cpp b/lib/remote/httprequest.cpp
index a55e12638..9e8f36c27 100644
--- a/lib/remote/httprequest.cpp
+++ b/lib/remote/httprequest.cpp
@@ -38,7 +38,7 @@ HttpRequest::HttpRequest(const Stream::Ptr& stream)
m_State(HttpRequestStart)
{ }
-bool HttpRequest::ParseHeader(StreamReadContext& src, bool may_wait)
+bool HttpRequest::ParseHeaders(StreamReadContext& src, bool may_wait)
{
if (!m_Stream)
return false;
diff --git a/lib/remote/httprequest.hpp b/lib/remote/httprequest.hpp
index af7ebfbaa..a17732f4a 100644
--- a/lib/remote/httprequest.hpp
+++ b/lib/remote/httprequest.hpp
@@ -64,7 +64,7 @@ public:
HttpRequest(const Stream::Ptr& stream);
- bool ParseHeader(StreamReadContext& src, bool may_wait);
+ bool ParseHeaders(StreamReadContext& src, bool may_wait);
bool ParseBody(StreamReadContext& src, bool may_wait);
size_t ReadBody(char *data, size_t count);
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index ae284df34..1c236ed5a 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -24,12 +24,13 @@
#include "remote/apifunction.hpp"
#include "remote/jsonrpc.hpp"
#include "base/base64.hpp"
-#include "base/configtype.hpp"
-#include "base/objectlock.hpp"
-#include "base/utility.hpp"
-#include "base/logger.hpp"
-#include "base/exception.hpp"
#include "base/convert.hpp"
+#include "base/configtype.hpp"
+#include "base/exception.hpp"
+#include "base/logger.hpp"
+#include "base/objectlock.hpp"
+#include "base/timer.hpp"
+#include "base/utility.hpp"
#include
using namespace icinga;
@@ -101,7 +102,7 @@ bool HttpServerConnection::ProcessMessage(void)
if (!m_CurrentRequest.CompleteHeaders) {
try {
- res = m_CurrentRequest.ParseHeader(m_Context, false);
+ res = m_CurrentRequest.ParseHeaders(m_Context, false);
} catch (const std::invalid_argument& ex) {
response.SetStatus(400, "Bad Request");
String msg = String("Bad Request
") + ex.what() + " ";
diff --git a/lib/remote/httpserverconnection.hpp b/lib/remote/httpserverconnection.hpp
index 22b036c2f..3d9b04e2c 100644
--- a/lib/remote/httpserverconnection.hpp
+++ b/lib/remote/httpserverconnection.hpp
@@ -24,7 +24,6 @@
#include "remote/httpresponse.hpp"
#include "remote/apiuser.hpp"
#include "base/tlsstream.hpp"
-#include "base/timer.hpp"
#include "base/workqueue.hpp"
namespace icinga
From adc054097dcd92d846a1ae6f980b2a5ab14219af Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Fri, 23 Feb 2018 10:27:55 +0100
Subject: [PATCH 25/57] Build/Merge fixes
---
lib/remote/httpserverconnection.cpp | 15 +++++++--------
lib/remote/pkiutility.cpp | 2 +-
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index 1c236ed5a..57f44f22b 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -189,14 +189,13 @@ bool HttpServerConnection::ProcessMessage(void)
bool HttpServerConnection::ManageHeaders(HttpResponse& response)
{
static const size_t defaultContentLengthLimit = 1 * 1028 * 1028;
- static const Dictionary::Ptr specialContentLengthLimits = new Dictionary({
- {"*", 512 * 1028 * 1028},
- {"config/modify", 512 * 1028 * 1028},
- {"console", 512 * 1028 * 1028},
- {"objects/create", 512 * 1028 * 1028},
- {"objects/modify", 512 * 1028 * 1028},
- {"objects/delete", 512 * 1028 * 1028}
- });
+ static const Dictionary::Ptr specialContentLengthLimits = new Dictionary;
+ specialContentLengthLimits->Set("*", 512 * 1028 * 1028);
+ specialContentLengthLimits->Set("config/modify", 512 * 1028 * 1028);
+ specialContentLengthLimits->Set("console", 512 * 1028 * 1028);
+ specialContentLengthLimits->Set("objects/create", 512 * 1028 * 1028);
+ specialContentLengthLimits->Set("objects/modify", 512 * 1028 * 1028);
+ specialContentLengthLimits->Set("objects/delete", 512 * 1028 * 1028);
if (m_CurrentRequest.Headers->Get("expect") == "100-continue") {
String continueResponse = "HTTP/1.1 100 Continue\r\n\r\n";
diff --git a/lib/remote/pkiutility.cpp b/lib/remote/pkiutility.cpp
index b9da04ebe..080626af5 100644
--- a/lib/remote/pkiutility.cpp
+++ b/lib/remote/pkiutility.cpp
@@ -124,7 +124,7 @@ boost::shared_ptr PkiUtility::FetchCert(const String& host, const String&
} catch (const std::exception& ex) {
Log(LogCritical, "pki")
<< "Client TLS handshake failed. (" << ex.what() << ")";
- return std::shared_ptr();
+ return boost::shared_ptr();
}
return stream->GetPeerCertificate();
From 6504606e23c9ce5f748925dc7445c0053d0f31e8 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Fri, 11 Aug 2017 16:23:24 +0200
Subject: [PATCH 26/57] Hash API password and comparison
fixes #4920
---
doc/09-object-types.md | 3 +-
doc/11-cli-commands.md | 11 +++--
doc/12-icinga2-api.md | 19 +++++++++
lib/base/tlsutility.cpp | 13 ++++++
lib/base/tlsutility.hpp | 1 +
lib/cli/CMakeLists.txt | 2 +-
lib/cli/apisetupcommand.cpp | 2 +-
lib/cli/apiusercommand.cpp | 82 +++++++++++++++++++++++++++++++++++++
lib/cli/apiusercommand.hpp | 47 +++++++++++++++++++++
lib/remote/apiuser.cpp | 56 +++++++++++++++++++++++++
lib/remote/apiuser.hpp | 6 +++
lib/remote/apiuser.ti | 4 +-
test/CMakeLists.txt | 2 +
test/remote-user.cpp | 52 +++++++++++++++++++++++
14 files changed, 292 insertions(+), 8 deletions(-)
create mode 100644 lib/cli/apiusercommand.cpp
create mode 100644 lib/cli/apiusercommand.hpp
create mode 100644 test/remote-user.cpp
diff --git a/doc/09-object-types.md b/doc/09-object-types.md
index 2976356f0..33c2763ba 100644
--- a/doc/09-object-types.md
+++ b/doc/09-object-types.md
@@ -108,8 +108,9 @@ Configuration Attributes:
Name | Type | Description
--------------------------|-----------------------|----------------------------------
password | String | **Optional.** Password string. Note: This attribute is hidden in API responses.
+ hashed\_password | String | **Optional.** A hashed password string in the form of /etc/shadow. Note: This attribute is hidden in API responses.
client\_cn | String | **Optional.** Client Common Name (CN).
- permissions | Array | **Required.** Array of permissions. Either as string or dictionary with the keys `permission` and `filter`. The latter must be specified as function.
+ permissions | Array | **Required.** Array of permissions. Either as string or dictionary with the keys `permission` and `filter`. The latter must be specified as function.
Available permissions are explained in the [API permissions](12-icinga2-api.md#icinga2-api-permissions)
chapter.
diff --git a/doc/11-cli-commands.md b/doc/11-cli-commands.md
index c5e9d289a..10acf727a 100644
--- a/doc/11-cli-commands.md
+++ b/doc/11-cli-commands.md
@@ -19,7 +19,8 @@ Usage:
icinga2 []
Supported commands:
- * api setup (setup for api)
+ * api setup (setup for API)
+ * api user (API user creation helper)
* ca list (lists all certificate signing requests)
* ca sign (signs an outstanding certificate request)
* console (Icinga console)
@@ -135,8 +136,9 @@ added.
## CLI command: Api
-Provides the setup CLI command to enable the REST API. More details
-in the [Icinga 2 API](12-icinga2-api.md#icinga2-api-setup) chapter.
+Provides the helper functions `api setup` and `api user`. The first to enable the REST API, the second to create
+ApiUser objects with hashed password strings.
+More details in the [Icinga 2 API](12-icinga2-api.md#icinga2-api-setup) chapter.
```
# icinga2 api --help
@@ -146,7 +148,8 @@ Usage:
icinga2 []
Supported commands:
- * api setup (setup for api)
+ * api setup (setup for API)
+ * api user (API user creation helper)
Global options:
-h [ --help ] show this help message
diff --git a/doc/12-icinga2-api.md b/doc/12-icinga2-api.md
index b2e61765b..8351c90e0 100644
--- a/doc/12-icinga2-api.md
+++ b/doc/12-icinga2-api.md
@@ -21,6 +21,25 @@ If you prefer to set up the API manually, you will have to perform the following
The next chapter provides a quick overview of how you can use the API.
+### Creating ApiUsers
+
+The CLI command `icinga2 api user` allows you to create an ApiUser object with a hashed password string, ready to be
+added to your configuration. Example:
+
+```
+$ icinga2 api user --user icingaweb2 --passwd icinga
+object ApiUser "icingaweb2" {
+ password_hash ="$5$d5f1a17ea308acb6$9e9fd5d24a9373a16e8811765cc5a5939687faf9ef8ed496db6e7f1d0ae9b2a9"
+ // client_cn = ""
+
+ permissions = [ "*" ]
+}
+```
+
+Optionally a salt can be provided with `--salt`, otherwise a random value will be used. When ApiUsers are stored this
+way, even somebody able to read the configuration files won't be able to authenticate using this information. There is
+no way to recover your password should you forget it, you'd need to create it anew.
+
## Introduction
The Icinga 2 API allows you to manage configuration objects
diff --git a/lib/base/tlsutility.cpp b/lib/base/tlsutility.cpp
index eda13ba1d..f8bc136ad 100644
--- a/lib/base/tlsutility.cpp
+++ b/lib/base/tlsutility.cpp
@@ -624,6 +624,19 @@ String PBKDF2_SHA1(const String& password, const String& salt, int iterations)
return output;
}
+String PBKDF2_SHA256(const String& password, const String& salt, int iterations)
+{
+ unsigned char digest[SHA256_DIGEST_LENGTH];
+ PKCS5_PBKDF2_HMAC(password.CStr(), password.GetLength(), reinterpret_cast(salt.CStr()),
+ salt.GetLength(), iterations, EVP_sha256(), SHA256_DIGEST_LENGTH, digest);
+
+ char output[SHA256_DIGEST_LENGTH*2+1];
+ for (int i = 0; i < SHA256_DIGEST_LENGTH; i++)
+ sprintf(output + 2 * i, "%02x", digest[i]);
+
+ return output;
+}
+
String SHA1(const String& s, bool binary)
{
char errbuf[120];
diff --git a/lib/base/tlsutility.hpp b/lib/base/tlsutility.hpp
index c2191cc51..2ab230f6c 100644
--- a/lib/base/tlsutility.hpp
+++ b/lib/base/tlsutility.hpp
@@ -52,6 +52,7 @@ boost::shared_ptr I2_BASE_API StringToCertificate(const String& cert);
boost::shared_ptr I2_BASE_API CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject);
boost::shared_ptr I2_BASE_API CreateCertIcingaCA(const boost::shared_ptr& cert);
String I2_BASE_API PBKDF2_SHA1(const String& password, const String& salt, int iterations);
+String I2_BASE_API PBKDF2_SHA256(const String& password, const String& salt, int iterations);
String I2_BASE_API SHA1(const String& s, bool binary = false);
String I2_BASE_API SHA256(const String& s);
String I2_BASE_API RandomString(int length);
diff --git a/lib/cli/CMakeLists.txt b/lib/cli/CMakeLists.txt
index 101577530..f4783fa6f 100644
--- a/lib/cli/CMakeLists.txt
+++ b/lib/cli/CMakeLists.txt
@@ -26,7 +26,7 @@ set(cli_SOURCES
objectlistcommand.cpp objectlistutility.cpp
pkinewcacommand.cpp pkinewcertcommand.cpp pkisigncsrcommand.cpp pkirequestcommand.cpp pkisavecertcommand.cpp pkiticketcommand.cpp
variablegetcommand.cpp variablelistcommand.cpp variableutility.cpp
- troubleshootcommand.cpp
+ apiusercommand.cpp troubleshootcommand.cpp
)
if(ICINGA2_UNITY_BUILD)
diff --git a/lib/cli/apisetupcommand.cpp b/lib/cli/apisetupcommand.cpp
index 6c6d79edd..9a91642f9 100644
--- a/lib/cli/apisetupcommand.cpp
+++ b/lib/cli/apisetupcommand.cpp
@@ -36,7 +36,7 @@ String ApiSetupCommand::GetDescription(void) const
String ApiSetupCommand::GetShortDescription(void) const
{
- return "setup for api";
+ return "setup for API";
}
ImpersonationLevel ApiSetupCommand::GetImpersonationLevel(void) const
diff --git a/lib/cli/apiusercommand.cpp b/lib/cli/apiusercommand.cpp
new file mode 100644
index 000000000..9d43e120f
--- /dev/null
+++ b/lib/cli/apiusercommand.cpp
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/) *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License *
+ * as published by the Free Software Foundation; either version 2 *
+ * of the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software Foundation *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ******************************************************************************/
+
+#include "cli/apiusercommand.hpp"
+#include "base/logger.hpp"
+#include "base/tlsutility.hpp"
+#include "remote/apiuser.hpp"
+#include
+
+using namespace icinga;
+namespace po = boost::program_options;
+
+REGISTER_CLICOMMAND("api/user", ApiUserCommand);
+
+String ApiUserCommand::GetDescription(void) const
+{
+ return "Create a hashed user and password string for the Icinga 2 API";
+}
+
+String ApiUserCommand::GetShortDescription(void) const
+{
+ return "API user creation helper";
+}
+
+void ApiUserCommand::InitParameters(boost::program_options::options_description& visibleDesc,
+ boost::program_options::options_description& hiddenDesc) const
+{
+ visibleDesc.add_options()
+ ("user", po::value(), "API username")
+ ("passwd", po::value(), "Password in clear text")
+ ("salt", po::value(), "Optional salt (default: 8 random chars)");
+}
+
+/**
+ * The entry point for the "api user" CLI command.
+ *
+ * @returns An exit status.
+ */
+int ApiUserCommand::Run(const boost::program_options::variables_map& vm, const std::vector& ap) const
+{
+ if (!vm.count("user")) {
+ Log(LogCritical, "cli", "Username (--user) must be specified.");
+ return 1;
+ }
+
+ if (!vm.count("passwd")) {
+ Log(LogCritical, "cli", "Password (--passwd) must be specified.");
+ return 1;
+ }
+
+ String user = vm["user"].as();
+ String passwd = vm["passwd"].as();
+ String salt = vm.count("salt") ? String(vm["salt"].as()) : RandomString(8);
+
+ String hashedPassword = ApiUser::CreateHashedPasswordString(passwd, salt, true);
+
+ std::cout
+ << "object ApiUser \"" << user << "\" {\n"
+ << " password_hash =\"" << hashedPassword << "\"\n"
+ << " // client_cn = \"\"\n"
+ << "\n"
+ << " permissions = [ \"*\" ]\n"
+ << "}\n";
+
+ return 0;
+}
diff --git a/lib/cli/apiusercommand.hpp b/lib/cli/apiusercommand.hpp
new file mode 100644
index 000000000..4a4bfb280
--- /dev/null
+++ b/lib/cli/apiusercommand.hpp
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/) *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License *
+ * as published by the Free Software Foundation; either version 2 *
+ * of the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software Foundation *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ******************************************************************************/
+
+#ifndef APIUSERCOMMAND_H
+#define APIUSERCOMMAND_H
+
+#include "cli/clicommand.hpp"
+
+namespace icinga
+{
+
+/**
+ * The "api user" command.
+ *
+ * @ingroup cli
+ */
+class ApiUserCommand : public CLICommand
+{
+public:
+ DECLARE_PTR_TYPEDEFS(ApiUserCommand);
+
+ virtual String GetDescription(void) const override;
+ virtual String GetShortDescription(void) const override;
+ virtual void InitParameters(boost::program_options::options_description& visibleDesc,
+ boost::program_options::options_description& hiddenDesc) const override;
+ virtual int Run(const boost::program_options::variables_map& vm, const std::vector& ap) const override;
+};
+
+}
+
+#endif /* APIUSERCOMMAND_H */
diff --git a/lib/remote/apiuser.cpp b/lib/remote/apiuser.cpp
index c3e95ebe6..fb847f9bb 100644
--- a/lib/remote/apiuser.cpp
+++ b/lib/remote/apiuser.cpp
@@ -21,11 +21,20 @@
#include "remote/apiuser.tcpp"
#include "base/configtype.hpp"
#include "base/base64.hpp"
+#include "base/tlsutility.hpp"
using namespace icinga;
REGISTER_TYPE(ApiUser);
+void ApiUser::OnConfigLoaded(void)
+{
+ ObjectImpl::OnConfigLoaded();
+
+ if (this->GetPasswordHash().IsEmpty())
+ SetPasswordHash(CreateHashedPasswordString(GetPassword(), RandomString(8), true));
+}
+
ApiUser::Ptr ApiUser::GetByClientCN(const String& cn)
{
for (const ApiUser::Ptr& user : ConfigType::GetObjectsByType()) {
@@ -63,3 +72,50 @@ ApiUser::Ptr ApiUser::GetByAuthHeader(const String& auth_header)
return user;
}
+
+bool ApiUser::ComparePassword(String password) const
+{
+ Dictionary::Ptr passwordDict = this->GetPasswordDict();
+ String thisPassword = passwordDict->Get("password");
+ String otherPassword = CreateHashedPasswordString(password, passwordDict->Get("salt"), false);
+
+ const char *p1 = otherPassword.CStr();
+ const char *p2 = thisPassword.CStr();
+
+ volatile char c = 0;
+
+ for (size_t i=0; i<64; ++i)
+ c |= p1[i] ^ p2[i];
+
+ return (c == 0);
+}
+
+Dictionary::Ptr ApiUser::GetPasswordDict(void) const
+{
+ String password = this->GetPasswordHash();
+ if (password.IsEmpty() || password[0] != '$')
+ return nullptr;
+
+ String::SizeType saltBegin = password.FindFirstOf('$', 1);
+ String::SizeType passwordBegin = password.FindFirstOf('$', saltBegin+1);
+
+ if (saltBegin == String::NPos || saltBegin == 1 || passwordBegin == String::NPos)
+ return nullptr;
+
+ Dictionary::Ptr passwordDict = new Dictionary();
+ passwordDict->Set("algorithm", password.SubStr(1, saltBegin - 1));
+ passwordDict->Set("salt", password.SubStr(saltBegin + 1, passwordBegin - saltBegin - 1));
+ passwordDict->Set("password", password.SubStr(passwordBegin + 1));
+
+ return passwordDict;
+}
+
+String ApiUser::CreateHashedPasswordString(const String& password, const String& salt, const bool shadow)
+{
+ if (shadow)
+ //Using /etc/shadow password format. The 5 means SHA256 is being used
+ return String("$5$" + salt + "$" + PBKDF2_SHA256(password, salt, 1000));
+ else
+ return PBKDF2_SHA256(password, salt, 1000);
+
+}
diff --git a/lib/remote/apiuser.hpp b/lib/remote/apiuser.hpp
index 4021487b4..09ee1a4d0 100644
--- a/lib/remote/apiuser.hpp
+++ b/lib/remote/apiuser.hpp
@@ -35,8 +35,14 @@ public:
DECLARE_OBJECT(ApiUser);
DECLARE_OBJECTNAME(ApiUser);
+ virtual void OnConfigLoaded(void) override;
+
static ApiUser::Ptr GetByClientCN(const String& cn);
static ApiUser::Ptr GetByAuthHeader(const String& auth_header);
+ static String CreateHashedPasswordString(const String& password, const String& salt, const bool shadow = false);
+
+ Dictionary::Ptr GetPasswordDict(void) const;
+ bool ComparePassword(String password) const;
};
}
diff --git a/lib/remote/apiuser.ti b/lib/remote/apiuser.ti
index effc804c2..32557d169 100644
--- a/lib/remote/apiuser.ti
+++ b/lib/remote/apiuser.ti
@@ -27,7 +27,9 @@ namespace icinga
class ApiUser : ConfigObject
{
- [config, no_user_view] String password;
+ /* No show config */
+ [no_user_view, no_user_modify] String password;
+ [config, no_user_view] String password_hash;
[config] String client_cn (ClientCN);
[config] array(Value) permissions;
};
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2a234419d..9d993feae 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -27,6 +27,7 @@ set(base_test_SOURCES
base-value.cpp config-ops.cpp icinga-checkresult.cpp icinga-macros.cpp
icinga-notification.cpp
icinga-perfdata.cpp remote-url.cpp
+ remote-user.cpp
)
if(ICINGA2_UNITY_BUILD)
@@ -118,6 +119,7 @@ add_boost_test(base
remote_url/get_and_set
remote_url/format
remote_url/illegal_legal_strings
+ api_user/password
)
if(ICINGA2_WITH_LIVESTATUS)
diff --git a/test/remote-user.cpp b/test/remote-user.cpp
new file mode 100644
index 000000000..eafa0e721
--- /dev/null
+++ b/test/remote-user.cpp
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/) *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License *
+ * as published by the Free Software Foundation; either version 2 *
+ * of the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software Foundation *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ******************************************************************************/
+
+#include "remote/apiuser.hpp"
+#include "base/tlsutility.hpp"
+#include
+
+#include
+
+using namespace icinga;
+
+BOOST_AUTO_TEST_SUITE(api_user)
+
+BOOST_AUTO_TEST_CASE(password)
+{
+#ifndef I2_DEBUG
+ std::cout << "Only enabled in Debug builds..." << std::endl;
+#else
+ ApiUser::Ptr user = new ApiUser();
+ String passwd = RandomString(16);
+ String salt = RandomString(8);
+ user->SetPassword("ThisShouldBeIgnored");
+ user->SetPasswordHash(ApiUser::CreateHashedPasswordString(passwd, salt, true));
+
+ BOOST_CHECK(user->GetPasswordHash() != passwd);
+
+ Dictionary::Ptr passwdd = user->GetPasswordDict();
+
+ BOOST_CHECK(passwdd);
+ BOOST_CHECK(passwdd->Get("salt") == salt);
+ BOOST_CHECK(user->ComparePassword(passwd));
+ BOOST_CHECK(!user->ComparePassword("wrong password uwu!"));
+#endif
+}
+
+BOOST_AUTO_TEST_SUITE_END()
From 6387f5442ec92f56f2bdaa7379b7caf02e91938c Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Fri, 22 Dec 2017 12:14:31 +0100
Subject: [PATCH 27/57] Move new password functions into tlsutility
---
lib/base/tlsutility.cpp | 24 ++++++++++++++++++
lib/base/tlsutility.hpp | 2 ++
lib/cli/apiusercommand.cpp | 2 +-
lib/remote/apiuser.cpp | 38 ++++++-----------------------
lib/remote/apiuser.hpp | 2 --
lib/remote/httpserverconnection.cpp | 1 +
test/remote-user.cpp | 6 ++---
7 files changed, 38 insertions(+), 37 deletions(-)
diff --git a/lib/base/tlsutility.cpp b/lib/base/tlsutility.cpp
index f8bc136ad..04d8ea49f 100644
--- a/lib/base/tlsutility.cpp
+++ b/lib/base/tlsutility.cpp
@@ -761,4 +761,28 @@ bool VerifyCertificate(const boost::shared_ptr& caCertificate, const boost
return rc == 1;
}
+bool ComparePassword(const String hash, const String password, const String salt)
+{
+ String otherHash = HashPassword(password, salt);
+
+ const char *p1 = otherHash.CStr();
+ const char *p2 = hash.CStr();
+
+ volatile char c = 0;
+
+ for (size_t i=0; i<64; ++i)
+ c |= p1[i] ^ p2[i];
+
+ return (c == 0);
+}
+
+String HashPassword(const String& password, const String& salt, const bool shadow)
+{
+ if (shadow)
+ //Using /etc/shadow password format. The 5 means SHA256 is being used
+ return String("$5$" + salt + "$" + PBKDF2_SHA256(password, salt, 1000));
+ else
+ return PBKDF2_SHA256(password, salt, 1000);
+}
+
}
diff --git a/lib/base/tlsutility.hpp b/lib/base/tlsutility.hpp
index 2ab230f6c..96bdc63b0 100644
--- a/lib/base/tlsutility.hpp
+++ b/lib/base/tlsutility.hpp
@@ -57,6 +57,8 @@ String I2_BASE_API SHA1(const String& s, bool binary = false);
String I2_BASE_API SHA256(const String& s);
String I2_BASE_API RandomString(int length);
bool I2_BASE_API VerifyCertificate(const boost::shared_ptr& caCertificate, const boost::shared_ptr& certificate);
+bool I2_BASE_API ComparePassword(const String hash, const String password, const String Salt);
+String I2_BASE_API HashPassword(const String& password, const String& salt, const bool shadow = false);
class I2_BASE_API openssl_error : virtual public std::exception, virtual public boost::exception { };
diff --git a/lib/cli/apiusercommand.cpp b/lib/cli/apiusercommand.cpp
index 9d43e120f..1cd5b4858 100644
--- a/lib/cli/apiusercommand.cpp
+++ b/lib/cli/apiusercommand.cpp
@@ -68,7 +68,7 @@ int ApiUserCommand::Run(const boost::program_options::variables_map& vm, const s
String passwd = vm["passwd"].as();
String salt = vm.count("salt") ? String(vm["salt"].as()) : RandomString(8);
- String hashedPassword = ApiUser::CreateHashedPasswordString(passwd, salt, true);
+ String hashedPassword = HashPassword(passwd, salt, true);
std::cout
<< "object ApiUser \"" << user << "\" {\n"
diff --git a/lib/remote/apiuser.cpp b/lib/remote/apiuser.cpp
index fb847f9bb..0caac19ff 100644
--- a/lib/remote/apiuser.cpp
+++ b/lib/remote/apiuser.cpp
@@ -32,7 +32,7 @@ void ApiUser::OnConfigLoaded(void)
ObjectImpl::OnConfigLoaded();
if (this->GetPasswordHash().IsEmpty())
- SetPasswordHash(CreateHashedPasswordString(GetPassword(), RandomString(8), true));
+ SetPasswordHash(HashPassword(GetPassword(), RandomString(8), true));
}
ApiUser::Ptr ApiUser::GetByClientCN(const String& cn)
@@ -65,31 +65,17 @@ ApiUser::Ptr ApiUser::GetByAuthHeader(const String& auth_header)
const ApiUser::Ptr& user = ApiUser::GetByName(username);
/* Deny authentication if 1) given password is empty 2) configured password does not match. */
- if (password.IsEmpty())
- return nullptr;
- else if (user && user->GetPassword() != password)
+ if (!user || password.IsEmpty())
return nullptr;
+ else {
+ Dictionary::Ptr passwordDict = user->GetPasswordDict();
+ if (!ComparePassword(passwordDict->Get("password"), password, passwordDict->Get("salt")))
+ return nullptr;
+ }
return user;
}
-bool ApiUser::ComparePassword(String password) const
-{
- Dictionary::Ptr passwordDict = this->GetPasswordDict();
- String thisPassword = passwordDict->Get("password");
- String otherPassword = CreateHashedPasswordString(password, passwordDict->Get("salt"), false);
-
- const char *p1 = otherPassword.CStr();
- const char *p2 = thisPassword.CStr();
-
- volatile char c = 0;
-
- for (size_t i=0; i<64; ++i)
- c |= p1[i] ^ p2[i];
-
- return (c == 0);
-}
-
Dictionary::Ptr ApiUser::GetPasswordDict(void) const
{
String password = this->GetPasswordHash();
@@ -109,13 +95,3 @@ Dictionary::Ptr ApiUser::GetPasswordDict(void) const
return passwordDict;
}
-
-String ApiUser::CreateHashedPasswordString(const String& password, const String& salt, const bool shadow)
-{
- if (shadow)
- //Using /etc/shadow password format. The 5 means SHA256 is being used
- return String("$5$" + salt + "$" + PBKDF2_SHA256(password, salt, 1000));
- else
- return PBKDF2_SHA256(password, salt, 1000);
-
-}
diff --git a/lib/remote/apiuser.hpp b/lib/remote/apiuser.hpp
index 09ee1a4d0..5aacbae0b 100644
--- a/lib/remote/apiuser.hpp
+++ b/lib/remote/apiuser.hpp
@@ -39,10 +39,8 @@ public:
static ApiUser::Ptr GetByClientCN(const String& cn);
static ApiUser::Ptr GetByAuthHeader(const String& auth_header);
- static String CreateHashedPasswordString(const String& password, const String& salt, const bool shadow = false);
Dictionary::Ptr GetPasswordDict(void) const;
- bool ComparePassword(String password) const;
};
}
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index 57f44f22b..8a14b00e1 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -30,6 +30,7 @@
#include "base/logger.hpp"
#include "base/objectlock.hpp"
#include "base/timer.hpp"
+#include "base/tlsutility.hpp"
#include "base/utility.hpp"
#include
diff --git a/test/remote-user.cpp b/test/remote-user.cpp
index eafa0e721..1c327bacb 100644
--- a/test/remote-user.cpp
+++ b/test/remote-user.cpp
@@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE(password)
String passwd = RandomString(16);
String salt = RandomString(8);
user->SetPassword("ThisShouldBeIgnored");
- user->SetPasswordHash(ApiUser::CreateHashedPasswordString(passwd, salt, true));
+ user->SetPasswordHash(HashPassword(passwd, salt, true));
BOOST_CHECK(user->GetPasswordHash() != passwd);
@@ -44,8 +44,8 @@ BOOST_AUTO_TEST_CASE(password)
BOOST_CHECK(passwdd);
BOOST_CHECK(passwdd->Get("salt") == salt);
- BOOST_CHECK(user->ComparePassword(passwd));
- BOOST_CHECK(!user->ComparePassword("wrong password uwu!"));
+ BOOST_CHECK(ComparePassword(passwdd->Get("password"), passwd, salt));
+ BOOST_CHECK(!ComparePassword(passwdd->Get("password"), "wrong password uwu!", salt));
#endif
}
From 2e5aedd28a5e98628febd0025291405ce4390189 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Fri, 22 Dec 2017 12:58:39 +0100
Subject: [PATCH 28/57] Fix crash when using incorrectly formatted password
hash
---
lib/remote/apiuser.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/remote/apiuser.cpp b/lib/remote/apiuser.cpp
index 0caac19ff..606e66dcc 100644
--- a/lib/remote/apiuser.cpp
+++ b/lib/remote/apiuser.cpp
@@ -69,7 +69,7 @@ ApiUser::Ptr ApiUser::GetByAuthHeader(const String& auth_header)
return nullptr;
else {
Dictionary::Ptr passwordDict = user->GetPasswordDict();
- if (!ComparePassword(passwordDict->Get("password"), password, passwordDict->Get("salt")))
+ if (!passwordDict || !ComparePassword(passwordDict->Get("password"), password, passwordDict->Get("salt")))
return nullptr;
}
From aad44dfbb2097443ef29871500a4dcaefcac96e3 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Fri, 22 Dec 2017 13:01:51 +0100
Subject: [PATCH 29/57] Improve api user command
--oneline can now be used to print out only the password hash string.
This can be used to update ApiUser passwords through the API. There is
also now a validation to make use salt does not contain a '$' which
would break verification.
---
lib/cli/apiusercommand.cpp | 38 +++++++++++++++++++++++++-------------
1 file changed, 25 insertions(+), 13 deletions(-)
diff --git a/lib/cli/apiusercommand.cpp b/lib/cli/apiusercommand.cpp
index 1cd5b4858..8c20f5568 100644
--- a/lib/cli/apiusercommand.cpp
+++ b/lib/cli/apiusercommand.cpp
@@ -44,7 +44,8 @@ void ApiUserCommand::InitParameters(boost::program_options::options_description&
visibleDesc.add_options()
("user", po::value(), "API username")
("passwd", po::value(), "Password in clear text")
- ("salt", po::value(), "Optional salt (default: 8 random chars)");
+ ("salt", po::value(), "Optional salt (default: 8 random chars)")
+ ("oneline", "Print only the password hash");
}
/**
@@ -54,29 +55,40 @@ void ApiUserCommand::InitParameters(boost::program_options::options_description&
*/
int ApiUserCommand::Run(const boost::program_options::variables_map& vm, const std::vector& ap) const
{
- if (!vm.count("user")) {
+ String user, passwd, salt;
+ if (!vm.count("user") && !vm.count("oneline")) {
Log(LogCritical, "cli", "Username (--user) must be specified.");
return 1;
- }
+ } else
+ user = vm["user"].as();
if (!vm.count("passwd")) {
Log(LogCritical, "cli", "Password (--passwd) must be specified.");
return 1;
}
- String user = vm["user"].as();
- String passwd = vm["passwd"].as();
- String salt = vm.count("salt") ? String(vm["salt"].as()) : RandomString(8);
+ passwd = vm["passwd"].as();
+ salt = vm.count("salt") ? String(vm["salt"].as()) : RandomString(8);
+
+ std::cout << salt << '\n';
+ if (salt.FindFirstOf('$') != String::NPos) {
+ Log(LogCritical, "cli", "Salt (--salt) may not contain '$'");
+ return 1;
+ }
String hashedPassword = HashPassword(passwd, salt, true);
- std::cout
- << "object ApiUser \"" << user << "\" {\n"
- << " password_hash =\"" << hashedPassword << "\"\n"
- << " // client_cn = \"\"\n"
- << "\n"
- << " permissions = [ \"*\" ]\n"
- << "}\n";
+ if (vm.count("oneline"))
+ std::cout << '"' << hashedPassword << "\"\n";
+ else {
+ std::cout
+ << "object ApiUser \"" << user << "\" {\n"
+ << " password_hash =\"" << hashedPassword << "\"\n"
+ << " // client_cn = \"\"\n"
+ << "\n"
+ << " permissions = [ \"*\" ]\n"
+ << "}\n";
+ }
return 0;
}
From ed1dd36f090b73cbffd9edd1c3f553c399f71c2a Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Thu, 15 Feb 2018 15:48:53 +0100
Subject: [PATCH 30/57] Properly escape strings in ApiUserCommand::Run
---
lib/cli/apiusercommand.cpp | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/lib/cli/apiusercommand.cpp b/lib/cli/apiusercommand.cpp
index 8c20f5568..fc1ae6bc3 100644
--- a/lib/cli/apiusercommand.cpp
+++ b/lib/cli/apiusercommand.cpp
@@ -20,6 +20,7 @@
#include "cli/apiusercommand.hpp"
#include "base/logger.hpp"
#include "base/tlsutility.hpp"
+#include "base/configwriter.hpp"
#include "remote/apiuser.hpp"
#include
@@ -81,9 +82,16 @@ int ApiUserCommand::Run(const boost::program_options::variables_map& vm, const s
if (vm.count("oneline"))
std::cout << '"' << hashedPassword << "\"\n";
else {
- std::cout
- << "object ApiUser \"" << user << "\" {\n"
- << " password_hash =\"" << hashedPassword << "\"\n"
+ std::cout << "object ApiUser ";
+
+ ConfigWriter::EmitString(std::cout, user);
+
+ std::cout << "{\n"
+ << " password_hash = ";
+
+ ConfigWriter::EmitString(std::cout, hashedPassword);
+
+ std::cout << "\n"
<< " // client_cn = \"\"\n"
<< "\n"
<< " permissions = [ \"*\" ]\n"
From 492b590a29ab00dbf9ebe0bf8fdb1ab54698d914 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Thu, 15 Feb 2018 15:49:23 +0100
Subject: [PATCH 31/57] Remove debug output in ApiUserCommand::Run
---
lib/cli/apiusercommand.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/cli/apiusercommand.cpp b/lib/cli/apiusercommand.cpp
index fc1ae6bc3..6eb5c3bf3 100644
--- a/lib/cli/apiusercommand.cpp
+++ b/lib/cli/apiusercommand.cpp
@@ -71,7 +71,6 @@ int ApiUserCommand::Run(const boost::program_options::variables_map& vm, const s
passwd = vm["passwd"].as();
salt = vm.count("salt") ? String(vm["salt"].as()) : RandomString(8);
- std::cout << salt << '\n';
if (salt.FindFirstOf('$') != String::NPos) {
Log(LogCritical, "cli", "Salt (--salt) may not contain '$'");
return 1;
From 40e89c41844d8f181087b855307554d77d8ea1d4 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Thu, 22 Feb 2018 11:29:12 +0100
Subject: [PATCH 32/57] Add Upgrading to Icinga 2.8.2 chapter
---
doc/16-upgrading-icinga-2.md | 16 ++++++++++++++++
doc/17-language-reference.md | 14 +++++++-------
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/doc/16-upgrading-icinga-2.md b/doc/16-upgrading-icinga-2.md
index e66505627..b581afee1 100644
--- a/doc/16-upgrading-icinga-2.md
+++ b/doc/16-upgrading-icinga-2.md
@@ -7,6 +7,22 @@ Specific version upgrades are described below. Please note that version
updates are incremental. An upgrade from v2.6 to v2.8 requires to
follow the instructions for v2.7 too.
+## Upgrading to v2.8.2
+
+With version 2.8.2 the location of settings formerly found in `/etc/icinga2/init.conf` has changed. They are now
+located in the sysconfig (`/etc/sysconfig/icinga2` on most systems). The `init.conf` has been removed and its settings
+will be ignored. These changes are only relevant if you edited the `init.conf`. Below is a table displaying the new
+names for the affected settings.
+
+ Old `init.conf` | New `sysconfig/icinga2`
+ ----------------|------------------------
+ RunAsUser | ICINGA2\_USER
+ RunAsGroup | ICINGA2\_GROUP
+ RLimitFiles | ICINGA2\_RLIMIT\_FILES
+ RLimitProcesses | ICINGA2\_RLIMIT\_PROCESSES
+ RLimitStack | ICINGA2\_RLIMIT\_STACK
+
+
## Upgrading to v2.8
### DB IDO Schema Update to 2.8.0
diff --git a/doc/17-language-reference.md b/doc/17-language-reference.md
index e18a0a7c7..794f42839 100644
--- a/doc/17-language-reference.md
+++ b/doc/17-language-reference.md
@@ -402,13 +402,13 @@ BuildHostName |**Read-only.** The name of the host Icinga was built on, e.
Advanced runtime constants. Please only use them if advised by support or developers.
-Variable |Description
---------------------|-------------------
-EventEngine |**Read-write.** The name of the socket event engine, can be `poll` or `epoll`. The epoll interface is only supported on Linux.
-AttachDebugger |**Read-write.** Whether to attach a debugger when Icinga 2 crashes. Defaults to `false`.
-RLimitFiles |**Read-write.** Defines the resource limit for RLIMIT_NOFILE that should be set at start-up. Value cannot be set lower than the default `16 * 1024`. 0 disables the setting. Used in the `init.conf` configuration file.
-RLimitProcesses |**Read-write.** Defines the resource limit for RLIMIT_NPROC that should be set at start-up. Value cannot be set lower than the default `16 * 1024`. 0 disables the setting. Used in the `init.conf` configuration file.
-RLimitStack |**Read-write.** Defines the resource limit for RLIMIT_STACK that should be set at start-up. Value cannot be set lower than the default `256 * 1024`. 0 disables the setting. Used in the `init.conf` configuration file.
+Variable | Description
+---------------------------|-------------------
+EventEngine |**Read-write.** The name of the socket event engine, can be `poll` or `epoll`. The epoll interface is only supported on Linux.
+AttachDebugger |**Read-write.** Whether to attach a debugger when Icinga 2 crashes. Defaults to `false`.
+ICINGA2\_RLIMIT\_FILES |**Read-write.** Defines the resource limit for RLIMIT_NOFILE that should be set at start-up. Value cannot be set lower than the default `16 * 1024`. 0 disables the setting. Set in Icinga 2 sysconfig.
+ICINGA2\_RLIMIT\_PROCESSES |**Read-write.** Defines the resource limit for RLIMIT_NPROC that should be set at start-up. Value cannot be set lower than the default `16 * 1024`. 0 disables the setting. Set in Icinga 2 sysconfig.
+ICINGA2\_RLIMIT\_STACK |**Read-write.** Defines the resource limit for RLIMIT_STACK that should be set at start-up. Value cannot be set lower than the default `256 * 1024`. 0 disables the setting. Set in Icinga 2 sysconfig.
## Apply
From f282b68fbd36d7bb5c054d88cf3caee0facb4e09 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Thu, 22 Feb 2018 12:31:36 +0100
Subject: [PATCH 33/57] Add clarification on sysconfig location
---
doc/16-upgrading-icinga-2.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/16-upgrading-icinga-2.md b/doc/16-upgrading-icinga-2.md
index b581afee1..fb91aba7b 100644
--- a/doc/16-upgrading-icinga-2.md
+++ b/doc/16-upgrading-icinga-2.md
@@ -10,9 +10,9 @@ follow the instructions for v2.7 too.
## Upgrading to v2.8.2
With version 2.8.2 the location of settings formerly found in `/etc/icinga2/init.conf` has changed. They are now
-located in the sysconfig (`/etc/sysconfig/icinga2` on most systems). The `init.conf` has been removed and its settings
-will be ignored. These changes are only relevant if you edited the `init.conf`. Below is a table displaying the new
-names for the affected settings.
+located in the sysconfig, `/etc/sysconfig/icinga2` (RPM) or `/etc/default/icinga2` (DPKG) on most systems. The
+`init.conf` file has been removed and its settings will be ignored. These changes are only relevant if you edited the
+`init.conf`. Below is a table displaying the new names for the affected settings.
Old `init.conf` | New `sysconfig/icinga2`
----------------|------------------------
From 5aafc7eda5c1b026a993fc2782fa84b8f3e8e052 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Wed, 29 Nov 2017 13:56:10 +0100
Subject: [PATCH 34/57] Fix prepare-dirs permission exploit
refs #5793
---
etc/initsystem/icinga2.sysconfig.cmake | 7 +++---
etc/initsystem/prepare-dirs | 35 +++++++++++---------------
2 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/etc/initsystem/icinga2.sysconfig.cmake b/etc/initsystem/icinga2.sysconfig.cmake
index e7fa54baf..7daf305be 100644
--- a/etc/initsystem/icinga2.sysconfig.cmake
+++ b/etc/initsystem/icinga2.sysconfig.cmake
@@ -3,9 +3,10 @@ ICINGA2_CONFIG_FILE=@CMAKE_INSTALL_FULL_SYSCONFDIR@/icinga2/icinga2.conf
ICINGA2_RUN_DIR=@ICINGA2_RUNDIR@
ICINGA2_STATE_DIR=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@
ICINGA2_PID_FILE=$ICINGA2_RUN_DIR/icinga2/icinga2.pid
-ICINGA2_ERROR_LOG=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/error.log
-ICINGA2_STARTUP_LOG=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/startup.log
-ICINGA2_LOG=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/icinga2.log
+ICINGA2_LOG_DIR=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2
+ICINGA2_ERROR_LOG=$ICINGA2_LOG_DIR/error.log
+ICINGA2_STARTUP_LOG=$ICINGA2_LOG_DIR/startup.log
+ICINGA2_LOG=$ICINGA2_LOG_DIR/icinga2.log
ICINGA2_CACHE_DIR=$ICINGA2_STATE_DIR/cache/icinga2
ICINGA2_USER=@ICINGA2_USER@
ICINGA2_GROUP=@ICINGA2_GROUP@
diff --git a/etc/initsystem/prepare-dirs b/etc/initsystem/prepare-dirs
index 5d67d476d..799e3226f 100644
--- a/etc/initsystem/prepare-dirs
+++ b/etc/initsystem/prepare-dirs
@@ -29,33 +29,28 @@ getent passwd $ICINGA2_USER >/dev/null 2>&1 || (echo "Icinga user '$ICINGA2_USER
getent group $ICINGA2_GROUP >/dev/null 2>&1 || (echo "Icinga group '$ICINGA2_GROUP' does not exist. Exiting." && exit 6)
getent group $ICINGA2_COMMAND_GROUP >/dev/null 2>&1 || (echo "Icinga command group '$ICINGA2_COMMAND_GROUP' does not exist. Exiting." && exit 6)
-mkdir -p $(dirname -- $ICINGA2_PID_FILE)
-chown $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $(dirname -- $ICINGA2_PID_FILE)
-if [ -f $ICINGA2_PID_FILE ]; then
- chown $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_PID_FILE
+if [ ! -e "$ICINGA2_RUN_DIR"/icinga2 ]; then
+ mkdir "$ICINGA2_RUN_DIR"/icinga2
+ mkdir "$ICINGA2_RUN_DIR"/icinga2/cmd
+ chmod 755 "$ICINGA2_RUN_DIR"/icinga2
+ chmod 2750 "$ICINGA2_RUN_DIR"/icinga2/cmd
+ chown -R $ICINGA2_USER:$ICINGA2_COMMAND_GROUP "$ICINGA2_RUN_DIR"/icinga2
fi
-mkdir -p $(dirname -- $ICINGA2_ERROR_LOG)
-chown $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $(dirname -- $ICINGA2_ERROR_LOG)
-chmod 750 $(dirname -- $ICINGA2_ERROR_LOG)
-if [ -f $ICINGA2_ERROR_LOG ]; then
- chown $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $ICINGA2_ERROR_LOG
-fi
-if [ -f $ICINGA2_LOG ]; then
- chown $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $ICINGA2_LOG
+# Could be undefined in installations where sysconf is not overridden on upgrade
+if [ -z "$ICINGA2_LOG_DIR" ]; then
+ $ICINGA2_LOG_DIR=$(dirname -- "$ICINGA2_LOG")
fi
-mkdir -p $ICINGA2_RUN_DIR/icinga2/cmd
-chown $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $ICINGA2_RUN_DIR/icinga2/cmd
+test -e "$ICINGA2_LOG_DIR" || install -m 750 -o $ICINGA2_USER -g $ICINGA2_COMMAND_GROUP -d "$ICINGA2_LOG_DIR"
+
if type restorecon >/dev/null 2>&1; then
- restorecon -R $ICINGA2_RUN_DIR/icinga2/
+ restorecon -R "$ICINGA2_RUN_DIR"/icinga2/
fi
-chmod 2750 $ICINGA2_RUN_DIR/icinga2/cmd
# Add a fallback if the user did not specify this directory in the sysconfig file
if [ -z "$ICINGA2_CACHE_DIR" ]; then
- ICINGA2_CACHE_DIR=$ICINGA2_STATE_DIR/cache/icinga2
+ ICINGA2_CACHE_DIR="$ICINGA2_STATE_DIR"/cache/icinga2
fi
-mkdir -p $ICINGA2_CACHE_DIR
-chown $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_CACHE_DIR
-chmod 750 $ICINGA2_CACHE_DIR
+
+test -e "$ICINGA2_CACHE_DIR" || install -m 750 -o $ICINGA2_USER -g $ICINGA2_COMMAND_GROUP -d "$ICINGA2_CACHE_DIR"
From 73dcebe25b766f8336efeb78eaa61d80fe0896af Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Wed, 17 Jan 2018 13:25:40 +0100
Subject: [PATCH 35/57] Get ICINGA2_USER and GROUP from sysconfig
---
etc/initsystem/icinga2.init.d.cmake | 14 ++++++--------
etc/initsystem/prepare-dirs | 14 ++++++--------
2 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/etc/initsystem/icinga2.init.d.cmake b/etc/initsystem/icinga2.init.d.cmake
index 080fb2779..ac494a8a2 100644
--- a/etc/initsystem/icinga2.init.d.cmake
+++ b/etc/initsystem/icinga2.init.d.cmake
@@ -31,16 +31,14 @@ if [ ! -e $ICINGA2_CONFIG_FILE ]; then
exit 6
fi
-ICINGA2_USER=`$DAEMON variable get --current RunAsUser`
-if [ $? != 0 ]; then
- echo "Could not fetch RunAsUser variable. Error '$ICINGA2_USER'. Exiting."
- exit 6
+if [ ! $ICINGA2_USER ]; then
+ echo "Could not fetch \$ICINGA2_USER. Exiting."
+ exit 6
fi
-ICINGA2_GROUP=`$DAEMON variable get --current RunAsGroup`
-if [ $? != 0 ]; then
- echo "Could not fetch RunAsGroup variable. Error '$ICINGA2_GROUP'. Exiting."
- exit 6
+if [ ! $ICINGA2_GROUP ]; then
+ echo "Could not fetch \$ICINGA2_GROUP. Exiting."
+ exit 6
fi
getent passwd $ICINGA2_USER >/dev/null 2>&1 || (echo "Icinga user '$ICINGA2_USER' does not exist. Exiting." && exit 6)
diff --git a/etc/initsystem/prepare-dirs b/etc/initsystem/prepare-dirs
index 799e3226f..44b8343a8 100644
--- a/etc/initsystem/prepare-dirs
+++ b/etc/initsystem/prepare-dirs
@@ -13,16 +13,14 @@ else
fi
-ICINGA2_USER=`$DAEMON variable get --current RunAsUser`
-if [ $? != 0 ]; then
- echo "Could not fetch RunAsUser variable. Error '$ICINGA2_USER'. Exiting."
- exit 6
+if [ ! $ICINGA2_USER ]; then
+ echo "Could not fetch \$ICINGA2_USER. Exiting."
+ exit 6
fi
-ICINGA2_GROUP=`$DAEMON variable get --current RunAsGroup`
-if [ $? != 0 ]; then
- echo "Could not fetch RunAsGroup variable. Error '$ICINGA2_GROUP'. Exiting."
- exit 6
+if [ ! $ICINGA2_GROUP ]; then
+ echo "Could not fetch \$ICINGA2_GROUP. Exiting."
+ exit 6
fi
getent passwd $ICINGA2_USER >/dev/null 2>&1 || (echo "Icinga user '$ICINGA2_USER' does not exist. Exiting." && exit 6)
From c6b86680a028f4f4c609aadd708e2454eae53cb0 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Wed, 17 Jan 2018 13:26:19 +0100
Subject: [PATCH 36/57] Add cli tool to send signals as Icinga user
fixes #5991
---
etc/initsystem/icinga2.init.d.cmake | 88 ++++++++++++++---------------
lib/cli/CMakeLists.txt | 2 +-
lib/cli/internalsignalcommand.cpp | 84 +++++++++++++++++++++++++++
lib/cli/internalsignalcommand.hpp | 50 ++++++++++++++++
4 files changed, 179 insertions(+), 45 deletions(-)
create mode 100644 lib/cli/internalsignalcommand.cpp
create mode 100644 lib/cli/internalsignalcommand.hpp
diff --git a/etc/initsystem/icinga2.init.d.cmake b/etc/initsystem/icinga2.init.d.cmake
index ac494a8a2..bc41ccf67 100644
--- a/etc/initsystem/icinga2.init.d.cmake
+++ b/etc/initsystem/icinga2.init.d.cmake
@@ -47,14 +47,14 @@ getent group $ICINGA2_COMMAND_GROUP >/dev/null 2>&1 || (echo "Icinga command gro
# Get function from functions library
if [ -f /etc/rc.d/init.d/functions ]; then
- . /etc/rc.d/init.d/functions
+ . /etc/rc.d/init.d/functions
elif [ -f /etc/init.d/functions ]; then
- . /etc/init.d/functions
+ . /etc/init.d/functions
fi
# Load extra environment variables
if [ -f /etc/default/icinga2 ]; then
- . /etc/default/icinga2
+ . /etc/default/icinga2
fi
# Start Icinga 2
@@ -72,34 +72,33 @@ start() {
# Restart Icinga 2
stop() {
- printf "Stopping Icinga 2: "
+ printf "Stopping Icinga 2: "
- if [ ! -e $ICINGA2_PID_FILE ]; then
- echo "The PID file '$ICINGA2_PID_FILE' does not exist."
- if [ "x$1" = "xnofail" ]; then
+ if [ ! -e $ICINGA2_PID_FILE ]; then
+ echo "The PID file '$ICINGA2_PID_FILE' does not exist."
+ if [ "x$1" = "xnofail" ]; then
return
else
exit 7
fi
- fi
+ fi
pid=`cat $ICINGA2_PID_FILE`
-
- if kill -INT $pid >/dev/null 2>&1; then
+
+ if icinga2 internal signal -s SIGINT -p $pid >/dev/null 2>&1; then
for i in 1 2 3 4 5 6 7 8 9 10; do
- if ! kill -CHLD $pid >/dev/null 2>&1; then
+ if ! icinga2 internal signal -s SIGCHLD -p $pid >/dev/null 2>&1; then
break
fi
printf '.'
-
sleep 3
done
fi
- if kill -CHLD $pid >/dev/null 2>&1; then
- kill -KILL $pid
- fi
+ if icinga2 internal signal -s SIGCHLD -p $pid >/dev/null 2>&1; then
+ icinga2 internal signal -s SIGKILL -p $pid >/dev/null 2>&1
+ fi
echo "Done"
}
@@ -114,21 +113,21 @@ checkconfig() {
printf "Checking configuration: "
if ! $DAEMON daemon -c $ICINGA2_CONFIG_FILE -C > $ICINGA2_STARTUP_LOG 2>&1; then
- if [ "x$1" = "x" ]; then
+ if [ "x$1" = "x" ]; then
cat $ICINGA2_STARTUP_LOG
echo "Icinga 2 detected configuration errors. Check '$ICINGA2_STARTUP_LOG' for details."
- exit 1
- else
+ exit 1
+ else
echo "Not "$1"ing Icinga 2 due to configuration errors. Check '$ICINGA2_STARTUP_LOG' for details."
- if [ "x$2" = "xfail" ]; then
- exit 1
- fi
- fi
- fi
-
+ if [ "x$2" = "xfail" ]; then
+ exit 1
+ fi
+ fi
+ fi
+
echo "Done"
# no arguments requires full output
- if [ "x$1" = "x" ]; then
+ if [ "x$1" = "x" ]; then
cat $ICINGA2_STARTUP_LOG
fi
}
@@ -143,7 +142,7 @@ status() {
fi
pid=`cat $ICINGA2_PID_FILE`
- if kill -CHLD $pid >/dev/null 2>&1; then
+ if icinga2 internal signal -s SIGCHLD -p $pid >/dev/null 2>&1; then
echo "Running"
else
echo "Not running"
@@ -155,33 +154,34 @@ status() {
case "$1" in
start)
checkconfig start fail
- start
- ;;
+ start
+ ;;
stop)
- stop
- ;;
+ stop
+ ;;
status)
- status
- ;;
+ status
+ ;;
restart)
checkconfig restart fail
- stop nofail
- start
- ;;
+ stop nofail
+ start
+ ;;
condrestart)
- status > /dev/null 2>&1 || exit 0
- checkconfig restart fail
- stop nofail
- start
- ;;
+ status > /dev/null 2>&1 || exit 0
+ checkconfig restart fail
+ stop nofail
+ start
+ ;;
reload)
reload
- ;;
+ ;;
checkconfig)
checkconfig
- ;;
+ ;;
*)
- echo "Usage: $0 {start|stop|restart|reload|checkconfig|status}"
- exit 3
+ echo "Usage: $0 {start|stop|restart|reload|checkconfig|status}"
+ exit 3
esac
+
exit 0
diff --git a/lib/cli/CMakeLists.txt b/lib/cli/CMakeLists.txt
index f4783fa6f..941c983e1 100644
--- a/lib/cli/CMakeLists.txt
+++ b/lib/cli/CMakeLists.txt
@@ -26,7 +26,7 @@ set(cli_SOURCES
objectlistcommand.cpp objectlistutility.cpp
pkinewcacommand.cpp pkinewcertcommand.cpp pkisigncsrcommand.cpp pkirequestcommand.cpp pkisavecertcommand.cpp pkiticketcommand.cpp
variablegetcommand.cpp variablelistcommand.cpp variableutility.cpp
- apiusercommand.cpp troubleshootcommand.cpp
+ internalsignalcommand.cpp apiusercommand.cpp troubleshootcommand.cpp
)
if(ICINGA2_UNITY_BUILD)
diff --git a/lib/cli/internalsignalcommand.cpp b/lib/cli/internalsignalcommand.cpp
new file mode 100644
index 000000000..3e196728d
--- /dev/null
+++ b/lib/cli/internalsignalcommand.cpp
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License *
+ * as published by the Free Software Foundation; either version 2 *
+ * of the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software Foundation *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ******************************************************************************/
+
+#include "cli/internalsignalcommand.hpp"
+#include "base/logger.hpp"
+#include
+
+using namespace icinga;
+namespace po = boost::program_options;
+
+REGISTER_CLICOMMAND("internal/signal", InternalSignalCommand);
+
+String InternalSignalCommand::GetDescription() const
+{
+ return "Send signal as Icinga user";
+}
+
+String InternalSignalCommand::GetShortDescription() const
+{
+ return "Send signal as Icinga user";
+}
+
+ImpersonationLevel InternalSignalCommand::GetImpersonationLevel() const
+{
+ return ImpersonateIcinga;
+}
+
+bool InternalSignalCommand::IsHidden() const
+{
+ return true;
+}
+
+void InternalSignalCommand::InitParameters(boost::program_options::options_description& visibleDesc,
+ boost::program_options::options_description& hiddenDesc) const
+{
+ visibleDesc.add_options()
+ ("pid,p", po::value(), "Target PID")
+ ("sig,s", po::value(), "Signal (POSIX string) to send")
+ ;
+}
+
+/**
+ * The entry point for the "internal signal" CLI command.
+ *
+ * @returns An exit status.
+ */
+int InternalSignalCommand::Run(const boost::program_options::variables_map& vm, const std::vector& ap) const
+{
+#ifndef _WIN32
+ String signal = vm["sig"].as();
+
+ /* Thank POSIX */
+ if (signal == "SIGKILL")
+ return kill(vm["pid"].as(), SIGKILL);
+ if (signal == "SIGINT")
+ return kill(vm["pid"].as(), SIGINT);
+ if (signal == "SIGCHLD")
+ return kill(vm["pid"].as(), SIGCHLD);
+ if (signal == "SIGHUP")
+ return kill(vm["pid"].as(), SIGHUP);
+
+ Log(LogCritical, "cli") << "Unsupported signal \"" << signal << "\"";
+#else
+ Log(LogCritical, "cli", "Unsupported action on Windows.");
+#endif /* _Win32 */
+ return 1;
+}
+
diff --git a/lib/cli/internalsignalcommand.hpp b/lib/cli/internalsignalcommand.hpp
new file mode 100644
index 000000000..44830ccd9
--- /dev/null
+++ b/lib/cli/internalsignalcommand.hpp
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License *
+ * as published by the Free Software Foundation; either version 2 *
+ * of the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software Foundation *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ******************************************************************************/
+
+#ifndef INTERNALSIGNALCOMMAND_H
+#define INTERNALSIGNALCOMMAND_H
+
+#include "cli/clicommand.hpp"
+
+namespace icinga
+{
+
+/**
+ * The "internal signal" command.
+ *
+ * @ingroup cli
+ */
+class InternalSignalCommand final : public CLICommand
+{
+public:
+ DECLARE_PTR_TYPEDEFS(InternalSignalCommand);
+
+ String GetDescription() const override;
+ String GetShortDescription() const override;
+ ImpersonationLevel GetImpersonationLevel() const override;
+ bool IsHidden() const override;
+ void InitParameters(boost::program_options::options_description& visibleDesc,
+ boost::program_options::options_description& hiddenDesc) const override;
+ int Run(const boost::program_options::variables_map& vm, const std::vector& ap) const override;
+
+};
+
+}
+
+#endif /* INTERNALSIGNALCOMMAND_H */
From d4b336ad20e27eae08c7252c80f6052e5acdb261 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Fri, 26 Jan 2018 16:27:16 +0100
Subject: [PATCH 37/57] Remove need for RunAsUser/Group
They are now read form the sysconfig file which is owned by root
---
config.h.cmake | 2 +-
etc/icinga2/init.conf.cmake | 2 --
icinga-app/icinga.cpp | 14 ++++++++++++--
lib/base/application.cpp | 21 +++++++++++++++++++++
lib/base/application.hpp | 3 +++
lib/base/utility.cpp | 32 ++++++++++++++++++++++++++++++++
lib/base/utility.hpp | 2 ++
7 files changed, 71 insertions(+), 5 deletions(-)
diff --git a/config.h.cmake b/config.h.cmake
index 1903b287c..7529f05ab 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -20,7 +20,7 @@
#define ICINGA_INCLUDECONFDIR "${CMAKE_INSTALL_FULL_DATADIR}/icinga2/include"
#define ICINGA_USER "${ICINGA2_USER}"
#define ICINGA_GROUP "${ICINGA2_GROUP}"
-
+#define ICINGA_SYSCONFIGFILE "${ICINGA2_SYSCONFIGFILE}"
#define ICINGA_BUILD_HOST_NAME "${ICINGA2_BUILD_HOST_NAME}"
#define ICINGA_BUILD_COMPILER_NAME "${ICINGA2_BUILD_COMPILER_NAME}"
#define ICINGA_BUILD_COMPILER_VERSION "${ICINGA2_BUILD_COMPILER_VERSION}"
diff --git a/etc/icinga2/init.conf.cmake b/etc/icinga2/init.conf.cmake
index 9f57bca82..22406a998 100644
--- a/etc/icinga2/init.conf.cmake
+++ b/etc/icinga2/init.conf.cmake
@@ -3,5 +3,3 @@
* configuration file (icinga2.conf) is processed.
*/
-const RunAsUser = "@ICINGA2_USER@"
-const RunAsGroup = "@ICINGA2_GROUP@"
diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp
index f5665c983..368906876 100644
--- a/icinga-app/icinga.cpp
+++ b/icinga-app/icinga.cpp
@@ -142,6 +142,7 @@ int Main(void)
#endif /* _WIN32 */
Application::DeclarePrefixDir(ICINGA_PREFIX);
+ Application::DeclareSysconfigFile(ICINGA_SYSCONFIGFILE);
Application::DeclareSysconfDir(ICINGA_SYSCONFDIR);
Application::DeclareRunDir(ICINGA_RUNDIR);
Application::DeclareLocalStateDir(ICINGA_LOCALSTATEDIR);
@@ -152,8 +153,17 @@ int Main(void)
#endif /* _WIN32 */
Application::DeclareZonesDir(Application::GetSysconfDir() + "/icinga2/zones.d");
- Application::DeclareRunAsUser(ICINGA_USER);
- Application::DeclareRunAsGroup(ICINGA_GROUP);
+
+ String icinga_user = Utility::GetFromSysconfig("ICINGA2_USER");
+ if (icinga_user.IsEmpty())
+ icinga_user = ICINGA_USER;
+
+ String icinga_group = Utility::GetFromSysconfig("ICINGA2_GROUP");
+ if (icinga_group.IsEmpty())
+ icinga_group = ICINGA_GROUP;
+
+ Application::DeclareRunAsUser(icinga_user);
+ Application::DeclareRunAsGroup(icinga_group);
#ifdef __linux__
Application::DeclareRLimitFiles(Application::GetDefaultRLimitFiles());
Application::DeclareRLimitProcesses(Application::GetDefaultRLimitProcesses());
diff --git a/lib/base/application.cpp b/lib/base/application.cpp
index ce4982e2a..70b2c40e9 100644
--- a/lib/base/application.cpp
+++ b/lib/base/application.cpp
@@ -1286,6 +1286,27 @@ void Application::DeclareStatePath(const String& path)
ScriptGlobal::Set("StatePath", path);
}
+/**
+ * Retrives the path of the sysconfig file.
+ *
+ * @returns The path.
+ */
+String Application::GetSysconfigFile(void)
+{
+ return ScriptGlobal::Get("SysconfigFile");
+}
+
+/**
+ * Sets the path of the sysconfig file.
+ *
+ * @param path The new path.
+ */
+void Application::DeclareSysconfigFile(const String& path)
+{
+ if (!ScriptGlobal::Exists("SysconfigFile"))
+ ScriptGlobal::Set("SysconfigFile", path);
+}
+
/**
* Retrieves the path for the modified attributes file.
*
diff --git a/lib/base/application.hpp b/lib/base/application.hpp
index bd04bbd02..05b2e5d91 100644
--- a/lib/base/application.hpp
+++ b/lib/base/application.hpp
@@ -105,6 +105,9 @@ public:
static String GetIncludeConfDir(void);
static void DeclareIncludeConfDir(const String& path);
+ static String GetSysconfigFile(void);
+ static void DeclareSysconfigFile(const String& path);
+
static String GetStatePath(void);
static void DeclareStatePath(const String& path);
diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp
index 836393b03..9aaddb8ba 100644
--- a/lib/base/utility.cpp
+++ b/lib/base/utility.cpp
@@ -1950,3 +1950,35 @@ String Utility::GetIcingaDataPath(void)
}
#endif /* _WIN32 */
+
+String Utility::GetFromSysconfig(const String& env)
+{
+#ifndef _WIN32
+ String sysconf = Application::GetSysconfigFile();
+ if (sysconf.IsEmpty())
+ return "";
+
+ String cmdInner = ". " + EscapeShellArg(sysconf) + " 2>&1 >/dev/null;echo \"$" + env + "\"";
+ String cmd = "sh -c " + EscapeShellArg(cmdInner);
+
+ FILE *fp = popen(cmd.CStr(), "r");
+
+ if (!fp)
+ return "";
+
+ char line[1024];
+ String out;
+
+ if (fgets(line, sizeof(line), fp))
+ out = line;
+ else
+ return "";
+
+ pclose(fp);
+
+ return out.Trim();
+#else
+ //TODO: Figure out how to do this on windows
+ return "";
+#endif /* _WIN32 */
+}
diff --git a/lib/base/utility.hpp b/lib/base/utility.hpp
index 3e19301f0..08c1f1999 100644
--- a/lib/base/utility.hpp
+++ b/lib/base/utility.hpp
@@ -148,6 +148,8 @@ public:
static String GetIcingaDataPath(void);
#endif /* _WIN32 */
+ static String GetFromSysconfig(const String& env);
+
#ifdef I2_DEBUG
static void SetTime(double);
static void IncrementTime(double);
From 3970662bf4fb76dab0c194b029aeb88f81854fe0 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Mon, 29 Jan 2018 14:23:53 +0100
Subject: [PATCH 38/57] Remove need for init.conf
---
doc/17-language-reference.md | 4 +--
etc/CMakeLists.txt | 4 ---
etc/icinga2/init.conf.cmake | 5 ---
icinga-app/icinga.cpp | 67 ++++++++++++++++++++++++++++--------
4 files changed, 55 insertions(+), 25 deletions(-)
delete mode 100644 etc/icinga2/init.conf.cmake
diff --git a/doc/17-language-reference.md b/doc/17-language-reference.md
index 794f42839..4afdb522e 100644
--- a/doc/17-language-reference.md
+++ b/doc/17-language-reference.md
@@ -389,8 +389,8 @@ ObjectsPath |**Read-write.** Contains the path of the Icinga 2 objects f
PidPath |**Read-write.** Contains the path of the Icinga 2 PID file. Defaults to RunDir + "/icinga2/icinga2.pid".
Vars |**Read-write.** Contains a dictionary with global custom attributes. Not set by default.
NodeName |**Read-write.** Contains the cluster node name. Set to the local hostname by default.
-RunAsUser |**Read-write.** Defines the user the Icinga 2 daemon is running as. Used in the `init.conf` configuration file.
-RunAsGroup |**Read-write.** Defines the group the Icinga 2 daemon is running as. Used in the `init.conf` configuration file.
+RunAsUser |**Read-write.** Defines the user the Icinga 2 daemon is running as. Set in the Icinga 2 sysconfig.
+RunAsGroup |**Read-write.** Defines the group the Icinga 2 daemon is running as. Set in the Icinga 2 sysconfig.
PlatformName |**Read-only.** The name of the operating system, e.g. "Ubuntu".
PlatformVersion |**Read-only.** The version of the operating system, e.g. "14.04.3 LTS".
PlatformKernel |**Read-only.** The name of the operating system kernel, e.g. "Linux".
diff --git a/etc/CMakeLists.txt b/etc/CMakeLists.txt
index f6b005d25..83903093c 100644
--- a/etc/CMakeLists.txt
+++ b/etc/CMakeLists.txt
@@ -15,8 +15,6 @@
# along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-configure_file(icinga2/init.conf.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga2/init.conf @ONLY)
-
if(NOT WIN32)
configure_file(icinga2/constants.conf.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga2/constants.conf @ONLY)
endif()
@@ -25,8 +23,6 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
configure_file(logrotate.d/icinga2.cmake ${CMAKE_CURRENT_BINARY_DIR}/logrotate.d/icinga2 @ONLY)
endif()
-install_if_not_exists(${CMAKE_CURRENT_BINARY_DIR}/icinga2/init.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
-
if(NOT WIN32)
install_if_not_exists(${CMAKE_CURRENT_BINARY_DIR}/icinga2/constants.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
install_if_not_exists(icinga2/icinga2.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
diff --git a/etc/icinga2/init.conf.cmake b/etc/icinga2/init.conf.cmake
deleted file mode 100644
index 22406a998..000000000
--- a/etc/icinga2/init.conf.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * This file is read by Icinga 2 before the main
- * configuration file (icinga2.conf) is processed.
- */
-
diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp
index 368906876..a8caaabea 100644
--- a/icinga-app/icinga.cpp
+++ b/icinga-app/icinga.cpp
@@ -154,22 +154,61 @@ int Main(void)
Application::DeclareZonesDir(Application::GetSysconfDir() + "/icinga2/zones.d");
- String icinga_user = Utility::GetFromSysconfig("ICINGA2_USER");
- if (icinga_user.IsEmpty())
- icinga_user = ICINGA_USER;
+ String icingaUser = Utility::GetFromSysconfig("ICINGA2_USER");
+ if (icingaUser.IsEmpty())
+ icingaUser = ICINGA_USER;
- String icinga_group = Utility::GetFromSysconfig("ICINGA2_GROUP");
- if (icinga_group.IsEmpty())
- icinga_group = ICINGA_GROUP;
+ String icingaGroup = Utility::GetFromSysconfig("ICINGA2_GROUP");
+ if (icingaGroup.IsEmpty())
+ icingaGroup = ICINGA_GROUP;
- Application::DeclareRunAsUser(icinga_user);
- Application::DeclareRunAsGroup(icinga_group);
-#ifdef __linux__
- Application::DeclareRLimitFiles(Application::GetDefaultRLimitFiles());
- Application::DeclareRLimitProcesses(Application::GetDefaultRLimitProcesses());
- Application::DeclareRLimitStack(Application::GetDefaultRLimitStack());
-#endif /* __linux__ */
- Application::DeclareConcurrency(boost::thread::hardware_concurrency());
+ Application::DeclareRunAsUser(icingaUser);
+ Application::DeclareRunAsGroup(icingaGroup);
+
+#ifdef RLIMIT_NOFILE
+ String rLimitFiles = Utility::GetFromSysconfig("ICINGA2_RLIMIT_FILES");
+ if (rLimitFiles.IsEmpty())
+ Application::DeclareRLimitFiles(Application::GetDefaultRLimitFiles());
+ else {
+ try {
+ Application::DeclareRLimitFiles(Convert::ToLong(rLimitFiles));
+ } catch (const std::invalid_argument& ex) {
+ std::cout
+ << "Error while parsing \"ICINGA2_RLIMIT_FILES\" from sysconfig: " << ex.what() << '\n';
+ return EXIT_FAILURE;
+ }
+ }
+#endif /* RLIMIT_NOFILE */
+
+#ifdef RLIMIT_NPROC
+ String rLimitProcesses = Utility::GetFromSysconfig("ICINGA2_RLIMIT_PROCESSES");
+ if (rLimitProcesses.IsEmpty())
+ Application::DeclareRLimitProcesses(Application::GetDefaultRLimitProcesses());
+ else {
+ try {
+ Application::DeclareRLimitProcesses(Convert::ToLong(rLimitProcesses));
+ } catch (const std::invalid_argument& ex) {
+ std::cout
+ << "Error while parsing \"ICINGA2_RLIMIT_PROCESSES\" from sysconfig: " << ex.what() << '\n';
+ return EXIT_FAILURE;
+ }
+ }
+#endif /* RLIMIT_NPROC */
+
+#ifdef RLIMIT_STACK
+ String rLimitStack = Utility::GetFromSysconfig("ICINGA2_RLIMIT_STACK");
+ if (rLimitStack.IsEmpty())
+ Application::DeclareRLimitStack(Application::GetDefaultRLimitStack());
+ else {
+ try {
+ Application::DeclareRLimitStack(Convert::ToLong(rLimitStack));
+ } catch (const std::invalid_argument& ex) {
+ std::cout
+ << "Error while parsing \"ICINGA2_RLIMIT_STACK\" from sysconfig: " << ex.what() << '\n';
+ return EXIT_FAILURE;
+ }
+ }
+#endif /* RLIMIT_STACK */
ScriptGlobal::Set("AttachDebugger", false);
From 360d1092110a177407c42de164976d463a5ec3f8 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Fri, 23 Feb 2018 13:25:59 +0100
Subject: [PATCH 39/57] Fix typo in prepare-dirs
refs #5850
---
etc/initsystem/prepare-dirs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/etc/initsystem/prepare-dirs b/etc/initsystem/prepare-dirs
index 44b8343a8..74bb85a5b 100644
--- a/etc/initsystem/prepare-dirs
+++ b/etc/initsystem/prepare-dirs
@@ -37,7 +37,7 @@ fi
# Could be undefined in installations where sysconf is not overridden on upgrade
if [ -z "$ICINGA2_LOG_DIR" ]; then
- $ICINGA2_LOG_DIR=$(dirname -- "$ICINGA2_LOG")
+ ICINGA2_LOG_DIR=$(dirname -- "$ICINGA2_LOG")
fi
test -e "$ICINGA2_LOG_DIR" || install -m 750 -o $ICINGA2_USER -g $ICINGA2_COMMAND_GROUP -d "$ICINGA2_LOG_DIR"
From 952e3616e5ed9110e98f62e18ffc4cb2d02182b8 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Fri, 23 Feb 2018 14:29:18 +0100
Subject: [PATCH 40/57] Fix incorrect size of request limits
refs #6103
---
lib/remote/httpserverconnection.cpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index 8a14b00e1..d5837a856 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -189,14 +189,14 @@ bool HttpServerConnection::ProcessMessage(void)
bool HttpServerConnection::ManageHeaders(HttpResponse& response)
{
- static const size_t defaultContentLengthLimit = 1 * 1028 * 1028;
+ static const size_t defaultContentLengthLimit = 1 * 1024 * 1024;
static const Dictionary::Ptr specialContentLengthLimits = new Dictionary;
- specialContentLengthLimits->Set("*", 512 * 1028 * 1028);
- specialContentLengthLimits->Set("config/modify", 512 * 1028 * 1028);
- specialContentLengthLimits->Set("console", 512 * 1028 * 1028);
- specialContentLengthLimits->Set("objects/create", 512 * 1028 * 1028);
- specialContentLengthLimits->Set("objects/modify", 512 * 1028 * 1028);
- specialContentLengthLimits->Set("objects/delete", 512 * 1028 * 1028);
+ specialContentLengthLimits->Set("*", 512 * 1024 * 1024);
+ specialContentLengthLimits->Set("config/modify", 512 * 1024 * 1024);
+ specialContentLengthLimits->Set("console", 512 * 1024 * 1024);
+ specialContentLengthLimits->Set("objects/create", 512 * 1024 * 1024);
+ specialContentLengthLimits->Set("objects/modify", 512 * 1024 * 1024);
+ specialContentLengthLimits->Set("objects/delete", 512 * 1024 * 1024);
if (m_CurrentRequest.Headers->Get("expect") == "100-continue") {
String continueResponse = "HTTP/1.1 100 Continue\r\n\r\n";
From 6400a300cd900aa4b8d7f6427f0ba55903803506 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Wed, 28 Feb 2018 10:50:33 +0100
Subject: [PATCH 41/57] Fix incorrect return value
---
lib/remote/httprequest.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/remote/httprequest.cpp b/lib/remote/httprequest.cpp
index 9e8f36c27..1f085c220 100644
--- a/lib/remote/httprequest.cpp
+++ b/lib/remote/httprequest.cpp
@@ -119,7 +119,7 @@ bool HttpRequest::ParseBody(StreamReadContext& src, bool may_wait)
/* we're done if the request doesn't contain a message body */
if (!Headers->Contains("content-length") && !Headers->Contains("transfer-encoding")) {
CompleteBody = true;
- return false;
+ return true;
} else if (!m_Body)
m_Body = new FIFO();
From 6e7421eab079a13d7732037240dfae58003b4523 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Wed, 28 Feb 2018 11:07:19 +0100
Subject: [PATCH 42/57] Fix null ptr dereference in
HttpServerConnection::ProcessMessageAsync
---
lib/remote/httpresponse.cpp | 17 +++++++++++------
lib/remote/httpresponse.hpp | 4 +++-
lib/remote/httpserverconnection.cpp | 2 ++
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/lib/remote/httpresponse.cpp b/lib/remote/httpresponse.cpp
index fd7578ed0..09076ed8c 100644
--- a/lib/remote/httpresponse.cpp
+++ b/lib/remote/httpresponse.cpp
@@ -29,7 +29,7 @@
using namespace icinga;
HttpResponse::HttpResponse(const Stream::Ptr& stream, const HttpRequest& request)
- : Complete(false), m_State(HttpResponseStart), m_Request(request), m_Stream(stream)
+ : Complete(false), m_State(HttpResponseStart), m_Request(&request), m_Stream(stream)
{ }
void HttpResponse::SetStatus(int code, const String& message)
@@ -44,7 +44,7 @@ void HttpResponse::SetStatus(int code, const String& message)
String status = "HTTP/";
- if (m_Request.ProtocolVersion == HttpVersion10)
+ if (m_Request->ProtocolVersion == HttpVersion10)
status += "1.0";
else
status += "1.1";
@@ -64,7 +64,7 @@ void HttpResponse::AddHeader(const String& key, const String& value)
void HttpResponse::FinishHeaders(void)
{
if (m_State == HttpResponseHeaders) {
- if (m_Request.ProtocolVersion == HttpVersion11)
+ if (m_Request->ProtocolVersion == HttpVersion11)
AddHeader("Transfer-Encoding", "chunked");
AddHeader("Server", "Icinga/" + Application::GetAppVersion());
@@ -81,7 +81,7 @@ void HttpResponse::WriteBody(const char *data, size_t count)
{
ASSERT(m_State == HttpResponseHeaders || m_State == HttpResponseBody);
- if (m_Request.ProtocolVersion == HttpVersion10) {
+ if (m_Request->ProtocolVersion == HttpVersion10) {
if (!m_Body)
m_Body = new FIFO();
@@ -97,7 +97,7 @@ void HttpResponse::Finish(void)
{
ASSERT(m_State != HttpResponseEnd);
- if (m_Request.ProtocolVersion == HttpVersion10) {
+ if (m_Request->ProtocolVersion == HttpVersion10) {
if (m_Body)
AddHeader("Content-Length", Convert::ToString(m_Body->GetAvailableBytes()));
@@ -115,7 +115,7 @@ void HttpResponse::Finish(void)
m_State = HttpResponseEnd;
- if (m_Request.ProtocolVersion == HttpVersion10 || m_Request.Headers->Get("connection") == "close")
+ if (m_Request->ProtocolVersion == HttpVersion10 || m_Request->Headers->Get("connection") == "close")
m_Stream->Shutdown();
}
@@ -267,3 +267,8 @@ bool HttpResponse::IsPeerConnected(void) const
{
return !m_Stream->IsEof();
}
+
+void HttpResponse::RebindRequest(const HttpRequest& request)
+{
+ m_Request = &request;
+}
diff --git a/lib/remote/httpresponse.hpp b/lib/remote/httpresponse.hpp
index da6afd66b..6137a65f5 100644
--- a/lib/remote/httpresponse.hpp
+++ b/lib/remote/httpresponse.hpp
@@ -65,10 +65,12 @@ public:
bool IsPeerConnected(void) const;
+ void RebindRequest(const HttpRequest& request);
+
private:
HttpResponseState m_State;
boost::shared_ptr m_ChunkContext;
- const HttpRequest& m_Request;
+ const HttpRequest *m_Request;
Stream::Ptr m_Stream;
FIFO::Ptr m_Body;
std::vector m_Headers;
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index d5837a856..550778751 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -316,6 +316,8 @@ bool HttpServerConnection::ManageHeaders(HttpResponse& response)
void HttpServerConnection::ProcessMessageAsync(HttpRequest& request, HttpResponse& response, const ApiUser::Ptr& user)
{
+ response.RebindRequest(request);
+
try {
HttpHandler::ProcessRequest(user, request, response);
} catch (const std::exception& ex) {
From 419103b407795525c2f37669cc68fd18559e33ed Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Tue, 27 Feb 2018 14:48:37 +0100
Subject: [PATCH 43/57] Add cork
---
lib/base/stream.cpp | 12 +++++++++++-
lib/base/stream.hpp | 5 +++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/lib/base/stream.cpp b/lib/base/stream.cpp
index 4e0ad72dc..4a0ebd377 100644
--- a/lib/base/stream.cpp
+++ b/lib/base/stream.cpp
@@ -60,7 +60,7 @@ void Stream::SignalDataAvailable(void)
}
}
-bool Stream::WaitForData()
+bool Stream::WaitForData(void)
{
if (!SupportsWaiting())
BOOST_THROW_EXCEPTION(std::runtime_error("Stream does not support waiting."));
@@ -94,6 +94,16 @@ bool Stream::WaitForData(int timeout)
static void StreamDummyCallback(void)
{ }
+void Stream::SetCorked(bool corked)
+{
+ m_Corked = corked;
+}
+
+bool Stream::IsCorked(void) const
+{
+ return m_Corked;
+}
+
void Stream::Close(void)
{
OnDataAvailable.disconnect_all_slots();
diff --git a/lib/base/stream.hpp b/lib/base/stream.hpp
index 63ac31599..79c8aa0c8 100644
--- a/lib/base/stream.hpp
+++ b/lib/base/stream.hpp
@@ -131,6 +131,9 @@ public:
virtual bool SupportsWaiting(void) const;
+ virtual void SetCorked(bool corked);
+ bool IsCorked(void) const;
+
virtual bool IsDataAvailable(void) const;
void RegisterDataHandler(const boost::function& handler);
@@ -145,6 +148,8 @@ private:
boost::mutex m_Mutex;
boost::condition_variable m_CV;
+
+ bool m_Corked{false};
};
}
From 8b334fe25917c31aa8a60c9e45fbc0990c3eebef Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Tue, 27 Feb 2018 14:49:15 +0100
Subject: [PATCH 44/57] Use cork in tlsstream and HTTP connection
---
lib/base/tlsstream.cpp | 21 +++++++++++++++++++--
lib/base/tlsstream.hpp | 2 ++
lib/remote/httpserverconnection.cpp | 4 +++-
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp
index 1fda60382..403daf336 100644
--- a/lib/base/tlsstream.cpp
+++ b/lib/base/tlsstream.cpp
@@ -152,12 +152,17 @@ void TlsStream::OnEvent(int revents)
char buffer[64 * 1024];
if (m_CurrentAction == TlsActionNone) {
- if (revents & (POLLIN | POLLERR | POLLHUP))
+ bool corked = IsCorked();
+ if (!corked && (revents & (POLLIN | POLLERR | POLLHUP)))
m_CurrentAction = TlsActionRead;
else if (m_SendQ->GetAvailableBytes() > 0 && (revents & POLLOUT))
m_CurrentAction = TlsActionWrite;
else {
- ChangeEvents(POLLIN);
+ if (corked)
+ ChangeEvents(0);
+ else
+ ChangeEvents(POLLIN);
+
return;
}
}
@@ -404,3 +409,15 @@ Socket::Ptr TlsStream::GetSocket(void) const
{
return m_Socket;
}
+
+void TlsStream::SetCorked(bool corked)
+{
+ Stream::SetCorked(corked);
+
+ boost::mutex::scoped_lock lock(m_Mutex);
+
+ if (corked)
+ m_CurrentAction = TlsActionNone;
+ else
+ ChangeEvents(POLLIN | POLLOUT);
+}
diff --git a/lib/base/tlsstream.hpp b/lib/base/tlsstream.hpp
index 6f7f71738..5c475500f 100644
--- a/lib/base/tlsstream.hpp
+++ b/lib/base/tlsstream.hpp
@@ -73,6 +73,8 @@ public:
bool IsVerifyOK(void) const;
String GetVerifyError(void) const;
+ virtual void SetCorked(bool corked) override;
+
private:
boost::shared_ptr m_SSL;
bool m_Eof;
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index 550778751..e087437e6 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -97,7 +97,6 @@ void HttpServerConnection::Disconnect(void)
bool HttpServerConnection::ProcessMessage(void)
{
-
bool res;
HttpResponse response(m_Stream, m_CurrentRequest);
@@ -175,6 +174,8 @@ bool HttpServerConnection::ProcessMessage(void)
return res;
}
+ m_Stream->SetCorked(true);
+
m_RequestQueue.Enqueue(std::bind(&HttpServerConnection::ProcessMessageAsync,
HttpServerConnection::Ptr(this), m_CurrentRequest, response, m_AuthenticatedUser));
@@ -328,6 +329,7 @@ void HttpServerConnection::ProcessMessageAsync(HttpRequest& request, HttpRespons
response.Finish();
m_PendingRequests--;
+ m_Stream->SetCorked(false);
}
void HttpServerConnection::DataAvailableHandler(void)
From 85858e6a36246dc5ac4e129d0f48f09b88b6558e Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Wed, 28 Feb 2018 11:42:05 +0100
Subject: [PATCH 45/57] Add SetCorked() calls to the JsonRpcConnection class
---
lib/remote/jsonrpcconnection.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/remote/jsonrpcconnection.cpp b/lib/remote/jsonrpcconnection.cpp
index 0be3fb46e..161a9d015 100644
--- a/lib/remote/jsonrpcconnection.cpp
+++ b/lib/remote/jsonrpcconnection.cpp
@@ -144,6 +144,8 @@ void JsonRpcConnection::MessageHandlerWrapper(const String& jsonString)
try {
MessageHandler(jsonString);
+
+ m_Stream->SetCorked(false);
} catch (const std::exception& ex) {
Log(LogWarning, "JsonRpcConnection")
<< "Error while reading JSON-RPC message for identity '" << m_Identity
@@ -242,6 +244,8 @@ bool JsonRpcConnection::ProcessMessage(void)
if (srs != StatusNewItem)
return false;
+ m_Stream->SetCorked(true);
+
l_JsonRpcConnectionWorkQueues[m_ID % l_JsonRpcConnectionWorkQueueCount].Enqueue(boost::bind(&JsonRpcConnection::MessageHandlerWrapper, JsonRpcConnection::Ptr(this), message));
return true;
From 622127276b62846b699a5113aff387d1993455f4 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Wed, 28 Feb 2018 12:06:01 +0100
Subject: [PATCH 46/57] Fix incorrect HTTP content length limits
---
doc/12-icinga2-api.md | 8 +++---
lib/remote/httpserverconnection.cpp | 39 ++++++++++++++++++-----------
2 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/doc/12-icinga2-api.md b/doc/12-icinga2-api.md
index 8351c90e0..01d0e2d28 100644
--- a/doc/12-icinga2-api.md
+++ b/doc/12-icinga2-api.md
@@ -230,12 +230,12 @@ Available permissions for specific URL endpoints:
actions/<action> | /v1/actions | Yes | 1
config/query | /v1/config | No | 1
config/modify | /v1/config | No | 512
- console | /v1/console | No | 512
+ console | /v1/console | No | 1
events/<type> | /v1/events | No | 1
objects/query/<type> | /v1/objects | Yes | 1
- objects/create/<type> | /v1/objects | No | 512
- objects/modify/<type> | /v1/objects | Yes | 512
- objects/delete/<type> | /v1/objects | Yes | 512
+ objects/create/<type> | /v1/objects | No | 1
+ objects/modify/<type> | /v1/objects | Yes | 1
+ objects/delete/<type> | /v1/objects | Yes | 1
status/query | /v1/status | Yes | 1
templates/<type> | /v1/templates | Yes | 1
types | /v1/types | Yes | 1
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index e087437e6..fdb87097d 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -190,15 +190,6 @@ bool HttpServerConnection::ProcessMessage(void)
bool HttpServerConnection::ManageHeaders(HttpResponse& response)
{
- static const size_t defaultContentLengthLimit = 1 * 1024 * 1024;
- static const Dictionary::Ptr specialContentLengthLimits = new Dictionary;
- specialContentLengthLimits->Set("*", 512 * 1024 * 1024);
- specialContentLengthLimits->Set("config/modify", 512 * 1024 * 1024);
- specialContentLengthLimits->Set("console", 512 * 1024 * 1024);
- specialContentLengthLimits->Set("objects/create", 512 * 1024 * 1024);
- specialContentLengthLimits->Set("objects/modify", 512 * 1024 * 1024);
- specialContentLengthLimits->Set("objects/delete", 512 * 1024 * 1024);
-
if (m_CurrentRequest.Headers->Get("expect") == "100-continue") {
String continueResponse = "HTTP/1.1 100 Continue\r\n\r\n";
m_Stream->Write(continueResponse.CStr(), continueResponse.GetLength());
@@ -289,16 +280,34 @@ bool HttpServerConnection::ManageHeaders(HttpResponse& response)
return false;
}
+ static const size_t defaultContentLengthLimit = 1 * 1024 * 1024;
size_t maxSize = defaultContentLengthLimit;
Array::Ptr permissions = m_AuthenticatedUser->GetPermissions();
- ObjectLock olock(permissions);
- for (const Value& permission : permissions) {
- std::vector permissionParts = String(permission).Split("/");
- String permissionPath = permissionParts[0] + (permissionParts.size() > 1 ? "/" + permissionParts[1] : "");
- int size = specialContentLengthLimits->Get(permissionPath);
- maxSize = size > maxSize ? size : maxSize;
+ if (permissions) {
+ ObjectLock olock(permissions);
+
+ for (const Value& permissionInfo : permissions) {
+ String permission;
+
+ if (permissionInfo.IsObjectType())
+ permission = static_cast(permissionInfo)->Get("permission");
+ else
+ permission = permissionInfo;
+
+ static std::vector> specialContentLengthLimits {
+ { "config/modify", 512 * 1024 * 1024 }
+ };
+
+ for (const auto& limitInfo : specialContentLengthLimits) {
+ if (limitInfo.second <= maxSize)
+ continue;
+
+ if (Utility::Match(permission, limitInfo.first))
+ maxSize = limitInfo.second;
+ }
+ }
}
size_t contentLength = m_CurrentRequest.Headers->Get("content-length");
From fdf2dc43d55d1ed4287dd06b4381e954b1dff558 Mon Sep 17 00:00:00 2001
From: Noah Hilverling
Date: Thu, 1 Mar 2018 09:47:29 +0100
Subject: [PATCH 47/57] Limit JSON-RPC message size
---
lib/base/netstring.cpp | 10 +++++++++-
lib/base/netstring.hpp | 5 +++--
lib/remote/jsonrpc.cpp | 4 ++--
lib/remote/jsonrpc.hpp | 4 ++--
lib/remote/jsonrpcconnection.cpp | 7 ++++++-
5 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/lib/base/netstring.cpp b/lib/base/netstring.cpp
index 934097e2b..e77a41285 100644
--- a/lib/base/netstring.cpp
+++ b/lib/base/netstring.cpp
@@ -32,7 +32,8 @@ using namespace icinga;
* @exception invalid_argument The input stream is invalid.
* @see https://github.com/PeterScott/netstring-c/blob/master/netstring.c
*/
-StreamReadStatus NetString::ReadStringFromStream(const Stream::Ptr& stream, String *str, StreamReadContext& context, bool may_wait)
+StreamReadStatus NetString::ReadStringFromStream(const Stream::Ptr& stream, String *str, StreamReadContext& context,
+ bool may_wait, ssize_t maxMessageLength)
{
if (context.Eof)
return StatusEof;
@@ -84,6 +85,13 @@ StreamReadStatus NetString::ReadStringFromStream(const Stream::Ptr& stream, Stri
/* read the whole message */
size_t data_length = len + 1;
+ if (maxMessageLength >= 0 && data_length > maxMessageLength) {
+ std::stringstream errorMessage;
+ errorMessage << "Max data length exceeded: " << (maxMessageLength / 1024 / 1024) << " MB";
+
+ BOOST_THROW_EXCEPTION(std::invalid_argument(errorMessage.str()));
+ }
+
char *data = context.Buffer + header_length + 1;
if (context.Size < header_length + 1 + data_length) {
diff --git a/lib/base/netstring.hpp b/lib/base/netstring.hpp
index c24cba028..045ef5b0b 100644
--- a/lib/base/netstring.hpp
+++ b/lib/base/netstring.hpp
@@ -38,8 +38,9 @@ class String;
class I2_BASE_API NetString
{
public:
- static StreamReadStatus ReadStringFromStream(const Stream::Ptr& stream, String *message, StreamReadContext& context, bool may_wait = false);
- static void WriteStringToStream(const Stream::Ptr& stream, const String& message);
+ static StreamReadStatus ReadStringFromStream(const Stream::Ptr& stream, String *message, StreamReadContext& context,
+ bool may_wait = false, ssize_t maxMessageLength = -1);
+ static size_t WriteStringToStream(const Stream::Ptr& stream, const String& message);
static void WriteStringToStream(std::ostream& stream, const String& message);
private:
diff --git a/lib/remote/jsonrpc.cpp b/lib/remote/jsonrpc.cpp
index 1d3efd5ca..f0cca71f6 100644
--- a/lib/remote/jsonrpc.cpp
+++ b/lib/remote/jsonrpc.cpp
@@ -70,10 +70,10 @@ void JsonRpc::SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& mess
NetString::WriteStringToStream(stream, json);
}
-StreamReadStatus JsonRpc::ReadMessage(const Stream::Ptr& stream, String *message, StreamReadContext& src, bool may_wait)
+StreamReadStatus JsonRpc::ReadMessage(const Stream::Ptr& stream, String *message, StreamReadContext& src, bool may_wait, ssize_t maxMessageLength)
{
String jsonString;
- StreamReadStatus srs = NetString::ReadStringFromStream(stream, &jsonString, src, may_wait);
+ StreamReadStatus srs = NetString::ReadStringFromStream(stream, &jsonString, src, may_wait, maxMessageLength);
if (srs != StatusNewItem)
return srs;
diff --git a/lib/remote/jsonrpc.hpp b/lib/remote/jsonrpc.hpp
index 3589b365a..6ab83e35f 100644
--- a/lib/remote/jsonrpc.hpp
+++ b/lib/remote/jsonrpc.hpp
@@ -35,8 +35,8 @@ namespace icinga
class I2_REMOTE_API JsonRpc
{
public:
- static void SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& message);
- static StreamReadStatus ReadMessage(const Stream::Ptr& stream, String *message, StreamReadContext& src, bool may_wait = false);
+ static size_t SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& message);
+ static StreamReadStatus ReadMessage(const Stream::Ptr& stream, String *message, StreamReadContext& src, bool may_wait = false, ssize_t maxMessageLength = -1);
static Dictionary::Ptr DecodeMessage(const String& message);
private:
diff --git a/lib/remote/jsonrpcconnection.cpp b/lib/remote/jsonrpcconnection.cpp
index 161a9d015..ac23a1060 100644
--- a/lib/remote/jsonrpcconnection.cpp
+++ b/lib/remote/jsonrpcconnection.cpp
@@ -237,9 +237,14 @@ void JsonRpcConnection::MessageHandler(const String& jsonString)
bool JsonRpcConnection::ProcessMessage(void)
{
+ ssize_t maxMessageLength = 64 * 1024;
+
+ if (m_Endpoint)
+ maxMessageLength = -1; /* no limit */
+
String message;
- StreamReadStatus srs = JsonRpc::ReadMessage(m_Stream, &message, m_Context, false);
+ StreamReadStatus srs = JsonRpc::ReadMessage(m_Stream, &message, m_Context, false, maxMessageLength);
if (srs != StatusNewItem)
return false;
From fda4faac0622e095970a6be6304e62bb2af0ca2f Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Mon, 5 Mar 2018 13:22:43 +0100
Subject: [PATCH 48/57] Limit anonymous connections to 25
---
lib/base/netstring.cpp | 2 +-
lib/remote/apilistener.cpp | 14 +++++++++++---
lib/remote/apilistener.hpp | 2 +-
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/lib/base/netstring.cpp b/lib/base/netstring.cpp
index e77a41285..f23853864 100644
--- a/lib/base/netstring.cpp
+++ b/lib/base/netstring.cpp
@@ -87,7 +87,7 @@ StreamReadStatus NetString::ReadStringFromStream(const Stream::Ptr& stream, Stri
if (maxMessageLength >= 0 && data_length > maxMessageLength) {
std::stringstream errorMessage;
- errorMessage << "Max data length exceeded: " << (maxMessageLength / 1024 / 1024) << " MB";
+ errorMessage << "Max data length exceeded: " << (maxMessageLength / 1024) << " KB";
BOOST_THROW_EXCEPTION(std::invalid_argument(errorMessage.str()));
}
diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp
index 107c142b7..65adce3be 100644
--- a/lib/remote/apilistener.cpp
+++ b/lib/remote/apilistener.cpp
@@ -546,8 +546,12 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
endpoint->AddClient(aclient);
m_SyncQueue.Enqueue(boost::bind(&ApiListener::SyncClient, this, aclient, endpoint, needSync));
- } else
- AddAnonymousClient(aclient);
+ } else {
+ if (!AddAnonymousClient(aclient)) {
+ Log(LogNotice, "ApiListener", "Ignoring anonymous JSON-RPC connection. Max connections exceeded.");
+ aclient->Disconnect();
+ }
+ }
} else {
Log(LogNotice, "ApiListener", "New HTTP client");
@@ -1358,10 +1362,14 @@ double ApiListener::CalculateZoneLag(const Endpoint::Ptr& endpoint)
return 0;
}
-void ApiListener::AddAnonymousClient(const JsonRpcConnection::Ptr& aclient)
+bool ApiListener::AddAnonymousClient(const JsonRpcConnection::Ptr& aclient)
{
boost::mutex::scoped_lock lock(m_AnonymousClientsLock);
+ if (m_AnonymousClients.size() > 25)
+ return false;
+
m_AnonymousClients.insert(aclient);
+ return true;
}
void ApiListener::RemoveAnonymousClient(const JsonRpcConnection::Ptr& aclient)
diff --git a/lib/remote/apilistener.hpp b/lib/remote/apilistener.hpp
index 1ce70316c..da492517c 100644
--- a/lib/remote/apilistener.hpp
+++ b/lib/remote/apilistener.hpp
@@ -79,7 +79,7 @@ public:
static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
std::pair GetStatus(void);
- void AddAnonymousClient(const JsonRpcConnection::Ptr& aclient);
+ bool AddAnonymousClient(const JsonRpcConnection::Ptr& aclient);
void RemoveAnonymousClient(const JsonRpcConnection::Ptr& aclient);
std::set GetAnonymousClients(void) const;
From 0b9869917fa92dc2be4a801a8a29da8832ccb061 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Tue, 6 Mar 2018 08:54:47 +0100
Subject: [PATCH 49/57] Fix incorrect argument type for JsonRpc::SendMessage
---
lib/base/win32.hpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/base/win32.hpp b/lib/base/win32.hpp
index 0965e1bd8..ef90352c1 100644
--- a/lib/base/win32.hpp
+++ b/lib/base/win32.hpp
@@ -40,6 +40,7 @@
#endif /* __MINGW32__ */
typedef int socklen_t;
+typedef SSIZE_T ssize_t;
#define MAXPATHLEN MAX_PATH
From 6670024f625b554a1d5a91b2f39af50d46db4348 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Tue, 6 Mar 2018 08:49:43 +0100
Subject: [PATCH 50/57] Ensure that SetCorked() works properly
---
lib/base/socketevents-poll.cpp | 10 ++++++++--
lib/base/tlsstream.cpp | 8 ++++++--
lib/remote/httpserverconnection.cpp | 8 +++++---
lib/remote/jsonrpcconnection.cpp | 8 ++++----
4 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/lib/base/socketevents-poll.cpp b/lib/base/socketevents-poll.cpp
index 76c13cfc6..705ebed21 100644
--- a/lib/base/socketevents-poll.cpp
+++ b/lib/base/socketevents-poll.cpp
@@ -57,11 +57,17 @@ void SocketEventEnginePoll::ThreadProc(int tid)
if (desc.second.Events == 0)
continue;
- if (desc.second.EventInterface)
+ int events = desc.second.Events;
+
+ if (desc.second.EventInterface) {
desc.second.EventInterface->m_EnginePrivate = &pfds[i];
+ if (!desc.second.EventInterface->m_Events)
+ events = 0;
+ }
+
pfds[i].fd = desc.first;
- pfds[i].events = desc.second.Events;
+ pfds[i].events = events;
descriptors[i] = desc.second;
i++;
diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp
index 403daf336..3d310c0bf 100644
--- a/lib/base/tlsstream.cpp
+++ b/lib/base/tlsstream.cpp
@@ -174,6 +174,8 @@ void TlsStream::OnEvent(int revents)
*/
ERR_clear_error();
+ size_t readTotal = 0;
+
switch (m_CurrentAction) {
case TlsActionRead:
do {
@@ -182,8 +184,10 @@ void TlsStream::OnEvent(int revents)
if (rc > 0) {
m_RecvQ->Write(buffer, rc);
success = true;
+
+ readTotal += rc;
}
- } while (rc > 0);
+ } while (rc > 0 && readTotal < 64 * 1024);
if (success)
m_CV.notify_all();
@@ -265,7 +269,7 @@ void TlsStream::OnEvent(int revents)
lock.unlock();
- while (m_RecvQ->IsDataAvailable() && IsHandlingEvents())
+ while (!IsCorked() && m_RecvQ->IsDataAvailable() && IsHandlingEvents())
SignalDataAvailable();
}
diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
index fdb87097d..69d57343d 100644
--- a/lib/remote/httpserverconnection.cpp
+++ b/lib/remote/httpserverconnection.cpp
@@ -174,9 +174,7 @@ bool HttpServerConnection::ProcessMessage(void)
return res;
}
- m_Stream->SetCorked(true);
-
- m_RequestQueue.Enqueue(std::bind(&HttpServerConnection::ProcessMessageAsync,
+ m_RequestQueue.Enqueue(boost::bind(&HttpServerConnection::ProcessMessageAsync,
HttpServerConnection::Ptr(this), m_CurrentRequest, response, m_AuthenticatedUser));
m_Seen = Utility::GetTime();
@@ -348,6 +346,8 @@ void HttpServerConnection::DataAvailableHandler(void)
if (!m_Stream->IsEof()) {
boost::mutex::scoped_lock lock(m_DataHandlerMutex);
+ m_Stream->SetCorked(true);
+
try {
while (ProcessMessage())
; /* empty loop body */
@@ -357,6 +357,8 @@ void HttpServerConnection::DataAvailableHandler(void)
close = true;
}
+
+ m_RequestQueue.Enqueue(boost::bind(&Stream::SetCorked, m_Stream, false));
} else
close = true;
diff --git a/lib/remote/jsonrpcconnection.cpp b/lib/remote/jsonrpcconnection.cpp
index ac23a1060..add6e1a70 100644
--- a/lib/remote/jsonrpcconnection.cpp
+++ b/lib/remote/jsonrpcconnection.cpp
@@ -144,8 +144,6 @@ void JsonRpcConnection::MessageHandlerWrapper(const String& jsonString)
try {
MessageHandler(jsonString);
-
- m_Stream->SetCorked(false);
} catch (const std::exception& ex) {
Log(LogWarning, "JsonRpcConnection")
<< "Error while reading JSON-RPC message for identity '" << m_Identity
@@ -249,8 +247,6 @@ bool JsonRpcConnection::ProcessMessage(void)
if (srs != StatusNewItem)
return false;
- m_Stream->SetCorked(true);
-
l_JsonRpcConnectionWorkQueues[m_ID % l_JsonRpcConnectionWorkQueueCount].Enqueue(boost::bind(&JsonRpcConnection::MessageHandlerWrapper, JsonRpcConnection::Ptr(this), message));
return true;
@@ -266,6 +262,8 @@ void JsonRpcConnection::DataAvailableHandler(void)
if (!m_Stream->IsEof()) {
boost::mutex::scoped_lock lock(m_DataHandlerMutex);
+ m_Stream->SetCorked(true);
+
try {
while (ProcessMessage())
; /* empty loop body */
@@ -278,6 +276,8 @@ void JsonRpcConnection::DataAvailableHandler(void)
return;
}
+
+ l_JsonRpcConnectionWorkQueues[m_ID % l_JsonRpcConnectionWorkQueueCount].Enqueue(boost::bind(&Stream::SetCorked, m_Stream, false));
} else
close = true;
From 9886f3914c7d08799ec4c16ce973fc30fbcd8978 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Tue, 6 Mar 2018 09:30:22 +0100
Subject: [PATCH 51/57] Fix ApiUser unit test
---
test/remote-user.cpp | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/test/remote-user.cpp b/test/remote-user.cpp
index 1c327bacb..f43816a19 100644
--- a/test/remote-user.cpp
+++ b/test/remote-user.cpp
@@ -29,14 +29,13 @@ BOOST_AUTO_TEST_SUITE(api_user)
BOOST_AUTO_TEST_CASE(password)
{
-#ifndef I2_DEBUG
- std::cout << "Only enabled in Debug builds..." << std::endl;
-#else
ApiUser::Ptr user = new ApiUser();
String passwd = RandomString(16);
String salt = RandomString(8);
- user->SetPassword("ThisShouldBeIgnored");
- user->SetPasswordHash(HashPassword(passwd, salt, true));
+ user->SetPasswordHash(CreateHashedPasswordString(passwd, salt));
+ user->OnConfigLoaded();
+ user->OnAllConfigLoaded();
+ user->Start();
BOOST_CHECK(user->GetPasswordHash() != passwd);
@@ -46,7 +45,6 @@ BOOST_AUTO_TEST_CASE(password)
BOOST_CHECK(passwdd->Get("salt") == salt);
BOOST_CHECK(ComparePassword(passwdd->Get("password"), passwd, salt));
BOOST_CHECK(!ComparePassword(passwdd->Get("password"), "wrong password uwu!", salt));
-#endif
}
BOOST_AUTO_TEST_SUITE_END()
From f357439485e4f2d57dda055b99a3496f6fd6a160 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Fri, 16 Feb 2018 10:31:00 +0100
Subject: [PATCH 52/57] Code style
---
lib/base/tlsutility.cpp | 24 +++++++++++++++---------
lib/base/tlsutility.hpp | 4 ++--
lib/cli/apiusercommand.cpp | 12 ++++++++----
lib/remote/apiuser.cpp | 8 ++++++--
4 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/lib/base/tlsutility.cpp b/lib/base/tlsutility.cpp
index 04d8ea49f..c28f8e44f 100644
--- a/lib/base/tlsutility.cpp
+++ b/lib/base/tlsutility.cpp
@@ -761,28 +761,34 @@ bool VerifyCertificate(const boost::shared_ptr& caCertificate, const boost
return rc == 1;
}
-bool ComparePassword(const String hash, const String password, const String salt)
+bool ComparePassword(const String& hash, const String& password, const String& salt)
{
- String otherHash = HashPassword(password, salt);
+ String otherHash = PBKDF2_SHA256(password, salt, 1000);
+ VERIFY(otherHash.GetLength() == 64 && hash.GetLength() == 64);
const char *p1 = otherHash.CStr();
const char *p2 = hash.CStr();
+ /* By Novelocrat, https://stackoverflow.com/a/25374036 */
volatile char c = 0;
- for (size_t i=0; i<64; ++i)
+ for (size_t i = 0; i < 64; ++i)
c |= p1[i] ^ p2[i];
return (c == 0);
}
-String HashPassword(const String& password, const String& salt, const bool shadow)
+/* Returns a String in the format $algorithm$salt$hash or returns an empty string in case of an error */
+String CreateHashedPasswordString(const String& password, const String& salt, int algorithm)
{
- if (shadow)
- //Using /etc/shadow password format. The 5 means SHA256 is being used
- return String("$5$" + salt + "$" + PBKDF2_SHA256(password, salt, 1000));
- else
- return PBKDF2_SHA256(password, salt, 1000);
+ // We currently only support SHA256
+ if (algorithm != 5)
+ return String();
+
+ if (salt.FindFirstOf('$') != String::NPos)
+ return String();
+
+ return String("$5$" + salt + "$" + PBKDF2_SHA256(password, salt, 1000));
}
}
diff --git a/lib/base/tlsutility.hpp b/lib/base/tlsutility.hpp
index 96bdc63b0..6e5c68d29 100644
--- a/lib/base/tlsutility.hpp
+++ b/lib/base/tlsutility.hpp
@@ -57,8 +57,8 @@ String I2_BASE_API SHA1(const String& s, bool binary = false);
String I2_BASE_API SHA256(const String& s);
String I2_BASE_API RandomString(int length);
bool I2_BASE_API VerifyCertificate(const boost::shared_ptr& caCertificate, const boost::shared_ptr& certificate);
-bool I2_BASE_API ComparePassword(const String hash, const String password, const String Salt);
-String I2_BASE_API HashPassword(const String& password, const String& salt, const bool shadow = false);
+bool ComparePassword(const String& hash, const String& password, const String& Salt);
+String CreateHashedPasswordString(const String& password, const String& salt, int algorithm = 5);
class I2_BASE_API openssl_error : virtual public std::exception, virtual public boost::exception { };
diff --git a/lib/cli/apiusercommand.cpp b/lib/cli/apiusercommand.cpp
index 6eb5c3bf3..188691ae0 100644
--- a/lib/cli/apiusercommand.cpp
+++ b/lib/cli/apiusercommand.cpp
@@ -44,7 +44,7 @@ void ApiUserCommand::InitParameters(boost::program_options::options_description&
{
visibleDesc.add_options()
("user", po::value(), "API username")
- ("passwd", po::value(), "Password in clear text")
+ ("password", po::value(), "Password in clear text")
("salt", po::value(), "Optional salt (default: 8 random chars)")
("oneline", "Print only the password hash");
}
@@ -63,8 +63,8 @@ int ApiUserCommand::Run(const boost::program_options::variables_map& vm, const s
} else
user = vm["user"].as();
- if (!vm.count("passwd")) {
- Log(LogCritical, "cli", "Password (--passwd) must be specified.");
+ if (!vm.count("password")) {
+ Log(LogCritical, "cli", "Password (--password) must be specified.");
return 1;
}
@@ -76,7 +76,11 @@ int ApiUserCommand::Run(const boost::program_options::variables_map& vm, const s
return 1;
}
- String hashedPassword = HashPassword(passwd, salt, true);
+ String hashedPassword = CreateHashedPasswordString(passwd, salt, 5);
+ if (hashedPassword == String()) {
+ Log(LogCritical, "cli") << "Failed to hash password \"" << passwd << "\" with salt \"" << salt << "\"";
+ return 1;
+ }
if (vm.count("oneline"))
std::cout << '"' << hashedPassword << "\"\n";
diff --git a/lib/remote/apiuser.cpp b/lib/remote/apiuser.cpp
index 606e66dcc..f3e2215ef 100644
--- a/lib/remote/apiuser.cpp
+++ b/lib/remote/apiuser.cpp
@@ -31,8 +31,12 @@ void ApiUser::OnConfigLoaded(void)
{
ObjectImpl::OnConfigLoaded();
- if (this->GetPasswordHash().IsEmpty())
- SetPasswordHash(HashPassword(GetPassword(), RandomString(8), true));
+ if (GetPasswordHash().IsEmpty()) {
+ String hashedPassword = CreateHashedPasswordString(GetPassword(), RandomString(8), 5);
+ VERIFY(hashedPassword != String());
+ SetPasswordHash(hashedPassword);
+ SetPassword("********");
+ }
}
ApiUser::Ptr ApiUser::GetByClientCN(const String& cn)
From ddab94feb35050d4e50ab13a1958e65dfbc058b6 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner
Date: Wed, 7 Mar 2018 09:56:42 +0100
Subject: [PATCH 53/57] Build fix
---
lib/base/netstring.hpp | 2 +-
lib/base/tlsutility.hpp | 4 ++--
lib/remote/jsonrpc.hpp | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/base/netstring.hpp b/lib/base/netstring.hpp
index 045ef5b0b..a8aa91c4e 100644
--- a/lib/base/netstring.hpp
+++ b/lib/base/netstring.hpp
@@ -40,7 +40,7 @@ class I2_BASE_API NetString
public:
static StreamReadStatus ReadStringFromStream(const Stream::Ptr& stream, String *message, StreamReadContext& context,
bool may_wait = false, ssize_t maxMessageLength = -1);
- static size_t WriteStringToStream(const Stream::Ptr& stream, const String& message);
+ static void WriteStringToStream(const Stream::Ptr& stream, const String& message);
static void WriteStringToStream(std::ostream& stream, const String& message);
private:
diff --git a/lib/base/tlsutility.hpp b/lib/base/tlsutility.hpp
index 6e5c68d29..21cb6ffa0 100644
--- a/lib/base/tlsutility.hpp
+++ b/lib/base/tlsutility.hpp
@@ -57,8 +57,8 @@ String I2_BASE_API SHA1(const String& s, bool binary = false);
String I2_BASE_API SHA256(const String& s);
String I2_BASE_API RandomString(int length);
bool I2_BASE_API VerifyCertificate(const boost::shared_ptr& caCertificate, const boost::shared_ptr& certificate);
-bool ComparePassword(const String& hash, const String& password, const String& Salt);
-String CreateHashedPasswordString(const String& password, const String& salt, int algorithm = 5);
+bool I2_BASE_API ComparePassword(const String& hash, const String& password, const String& Salt);
+String I2_BASE_API CreateHashedPasswordString(const String& password, const String& salt, int algorithm = 5);
class I2_BASE_API openssl_error : virtual public std::exception, virtual public boost::exception { };
diff --git a/lib/remote/jsonrpc.hpp b/lib/remote/jsonrpc.hpp
index 6ab83e35f..6463ca2ea 100644
--- a/lib/remote/jsonrpc.hpp
+++ b/lib/remote/jsonrpc.hpp
@@ -35,7 +35,7 @@ namespace icinga
class I2_REMOTE_API JsonRpc
{
public:
- static size_t SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& message);
+ static void SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& message);
static StreamReadStatus ReadMessage(const Stream::Ptr& stream, String *message, StreamReadContext& src, bool may_wait = false, ssize_t maxMessageLength = -1);
static Dictionary::Ptr DecodeMessage(const String& message);
From 1969a9071a488398a1bb906285e1f94b3c5f54bb Mon Sep 17 00:00:00 2001
From: Michael Friedrich
Date: Wed, 7 Mar 2018 13:27:31 +0100
Subject: [PATCH 54/57] Improve error handling for empty packages in
/v1/config/packages
- If there is no package main directory, assume "empty packages".
- Catch exceptions thrown through GlobRecursive() and present a better http 500
to the user.
The packages directory tree is automatically created with the first
package creation, either from the user, or by the `_api` package.
fixes #6129
---
lib/remote/configpackageshandler.cpp | 12 +++++++++---
lib/remote/configpackageutility.cpp | 12 ++++++++++--
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/lib/remote/configpackageshandler.cpp b/lib/remote/configpackageshandler.cpp
index 0b41cd65b..48a624cf3 100644
--- a/lib/remote/configpackageshandler.cpp
+++ b/lib/remote/configpackageshandler.cpp
@@ -49,7 +49,14 @@ void ConfigPackagesHandler::HandleGet(const ApiUser::Ptr& user, HttpRequest& req
{
FilterUtility::CheckPermission(user, "config/query");
- std::vector packages = ConfigPackageUtility::GetPackages();
+ std::vector packages;
+
+ try {
+ packages = ConfigPackageUtility::GetPackages();
+ } catch (const std::exception& ex) {
+ HttpUtility::SendJsonError(response, 500, "Could not retrieve packages.");
+ return;
+ }
Array::Ptr results = new Array();
@@ -91,8 +98,7 @@ void ConfigPackagesHandler::HandlePost(const ApiUser::Ptr& user, HttpRequest& re
boost::mutex::scoped_lock lock(ConfigPackageUtility::GetStaticMutex());
ConfigPackageUtility::CreatePackage(packageName);
} catch (const std::exception& ex) {
- HttpUtility::SendJsonError(response, 500, "Could not create package.",
- HttpUtility::GetLastParameter(params, "verboseErrors") ? DiagnosticInformation(ex) : "");
+ HttpUtility::SendJsonError(response, 500, "Could not create package.", "");
}
result1->Set("code", 200);
diff --git a/lib/remote/configpackageutility.cpp b/lib/remote/configpackageutility.cpp
index b7f04a18f..8760f9e25 100644
--- a/lib/remote/configpackageutility.cpp
+++ b/lib/remote/configpackageutility.cpp
@@ -58,9 +58,17 @@ void ConfigPackageUtility::DeletePackage(const String& name)
std::vector ConfigPackageUtility::GetPackages(void)
{
+ String packageDir = GetPackageDir();
+
std::vector packages;
- Utility::Glob(GetPackageDir() + "/*", boost::bind(&ConfigPackageUtility::CollectDirNames,
- _1, boost::ref(packages)), GlobDirectory);
+
+ /* Package directory does not exist, no packages have been created thus far. */
+ if (!Utility::PathExists(packageDir))
+ return packages;
+
+ Utility::Glob(packageDir + "/*", boost::bind(&ConfigPackageUtility::CollectDirNames,
+ _1, std::ref(packages)), GlobDirectory);
+
return packages;
}
From 4f12142d52db6b69e89f13f8aa498582179e4178 Mon Sep 17 00:00:00 2001
From: Michael Friedrich
Date: Tue, 20 Mar 2018 11:50:52 +0100
Subject: [PATCH 55/57] Docs: Add a note to only query the NSClient++ API from
the local Icinga 2 client
refs #6172
---
doc/06-distributed-monitoring.md | 8 ++++++--
doc/10-icinga-template-library.md | 6 +++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/doc/06-distributed-monitoring.md b/doc/06-distributed-monitoring.md
index dafd55cde..9ca5cec5f 100644
--- a/doc/06-distributed-monitoring.md
+++ b/doc/06-distributed-monitoring.md
@@ -1976,10 +1976,14 @@ you'll also need to ensure that port `5665` is enabled.
#### NSClient++ API
If the [check_nscp_api](06-distributed-monitoring.md#distributed-monitoring-windows-nscp-check-api)
-plugin is used to query NSClient++ remotely, you need to ensure that its port is enabled.
+plugin is used to query NSClient++, you need to ensure that its port is enabled.
C:\WINDOWS\system32>netsh advfirewall firewall add rule name="Open port 8443 (NSClient++ API)" dir=in action=allow protocol=TCP localport=8443
+For security reasons, it is advised to enable the NSClient++ HTTP API for local
+connection from the Icinga 2 client only. Remote connections to the HTTP API
+are not recommended with using the legacy HTTP API.
+
### Windows Client and Plugins
The Icinga 2 package on Windows already provides several plugins.
@@ -2038,7 +2042,7 @@ for the requirements.
There are two methods available for querying NSClient++:
-* Query the [HTTP API](06-distributed-monitoring.md#distributed-monitoring-windows-nscp-check-api) locally or remotely (requires a running NSClient++ service)
+* Query the [HTTP API](06-distributed-monitoring.md#distributed-monitoring-windows-nscp-check-api) locally from an Icinga 2 client (requires a running NSClient++ service)
* Run a [local CLI check](06-distributed-monitoring.md#distributed-monitoring-windows-nscp-check-local) (does not require NSClient++ as a service)
Both methods have their advantages and disadvantages. One thing to
diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md
index 4b74930c0..0cb419ed5 100644
--- a/doc/10-icinga-template-library.md
+++ b/doc/10-icinga-template-library.md
@@ -1668,13 +1668,17 @@ users\_win\_crit | **Optional**. The critical threshold.
There are two methods available for querying NSClient++:
-* Query the [HTTP API](10-icinga-template-library.md#nscp-check-api) locally or remotely (requires a running NSClient++ service)
+* Query the [HTTP API](06-distributed-monitoring.md#distributed-monitoring-windows-nscp-check-api) locally from an Icinga 2 client (requires a running NSClient++ service)
* Run a [local CLI check](10-icinga-template-library.md#nscp-check-local) (does not require NSClient++ as a service)
Both methods have their advantages and disadvantages. One thing to
note: If you rely on performance counter delta calculations such as
CPU utilization, please use the HTTP API instead of the CLI sample call.
+For security reasons, it is advised to enable the NSClient++ HTTP API for local
+connection from the Icinga 2 client only. Remote connections to the HTTP API
+are not recommended with using the legacy HTTP API.
+
### nscp_api
`check_nscp_api` is part of the Icinga 2 plugins. This plugin is available for
From e5539073c1fec18f5da5910b2a108d8c9fd72e26 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Thu, 22 Mar 2018 10:35:02 +0100
Subject: [PATCH 56/57] Update mailmap
---
AUTHORS | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index de2060835..49ea4498d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -10,6 +10,8 @@ Andrew Meyer
Andy Grunwald
Arnd Hannemann
Assaf Flatto
+Bård Dahlmo-Lerbæk
+bascarsija
Bastian Guse
Benedikt Heine
Bernd Erk
@@ -19,7 +21,6 @@ Brendan Jurd
Brian De Wolf
Brian Dockter
Bruno Lingner
-Bård Dahlmo-Lerbæk
Carlos Cesario
Carsten Köbke
Christian Birk
@@ -32,6 +33,8 @@ Christian Schmidt
Claudio Bilotta
Claudio Kuenzler
Conrad Clement
+cstegm
+ctrlaltca
Daniel Helgenberger
Daniel Kesselberg
Daniil Yaroslavtsev
@@ -44,6 +47,7 @@ Dolf Schimmel
Edgar Fuß
Eduard Güldner
Edvin Seferovic
+Élie Bouttier
Eric Lippmann
Evgeni Golov
Ewoud Kohl van Wijngaarden
@@ -55,6 +59,7 @@ Georg Faerber
Georg Haas
Gerd von Egidy
Gerhardt Roman
+gitmopp
Glauco Vinicius
Gunnar Beutner
Hannes Happle
@@ -72,16 +77,17 @@ Jean Flach
Jean-Louis Dupond
Jens Schanz
Jeremy Armstrong
+Jérôme Drouet
Jesse Morgan
Jo Goossens
Johannes Meyer
Jonas Meurer
Joseph L. Casale
Julian Brost
-Jérôme Drouet
Kai Goller
-Konstantin Kelemen
Kálmán Szalai - KAMI
+Konstantin Kelemen
+krishna
Lars Engels
Lars Krüger
Lee Clemens
@@ -91,8 +97,8 @@ Luca Lesinigo
Lucas Fairchild-Madar
Malte Rabenseifner
Manuel Reiter
-Marcus van Dam
MarcusCaepio
+Marcus van Dam
Marianne Spiller
Marius Bergmann
Marius Sturm
@@ -115,11 +121,13 @@ Michael Newton
Mikesch-mp
Mirco Bauer
Mirko Nardin
+mocruz
Nicolai
Nicolas Limage
Nicole Lang
Niflou
Noah Hilverling
+noobahoi <20069422+noobahoi@users.noreply.github.com>
Pall Sigurdsson
Paolo Schiro
Patrick Huy
@@ -130,6 +138,7 @@ Peter Eckel
Petr Ruzicka
Phil Hutchinson
Philipp Dallig
+pv2b
Ralph Breier
Reto Zeder
Ricardo Bartels
@@ -138,6 +147,7 @@ Roland Hopferwieser
Roman Gerhardt
Rudy Gevaert
Rune Darrud
+ryanohnemus
Sam Kottler
Sebastian Brückner
Sebastian Chrostek
@@ -157,8 +167,8 @@ Thomas Gelf
Thomas Niedermeier
Thomas Widhalm
Tim Hardeck
-Tim Weippert
Timo Buhrmester
+Tim Weippert
Tobias Birnbaum
Tobias von der Krone
Tom Geissler
@@ -172,13 +182,3 @@ Yannick Charton
Yohan Jarosz
Zachary McGibbon
Zoltan Nagy
-bascarsija
-cstegm
-ctrlaltca
-gitmopp
-krishna
-mocruz
-noobahoi <20069422+noobahoi@users.noreply.github.com>
-pv2b
-ryanohnemus
-Élie Bouttier
From ada573dcf0eead48d66652c8ef397b223a805295 Mon Sep 17 00:00:00 2001
From: Jean Flach
Date: Thu, 22 Mar 2018 11:17:13 +0100
Subject: [PATCH 57/57] Release version 2.8.2
---
CHANGELOG.md | 4530 +++++++++++++++++++++++++-------------------------
icinga2.spec | 2 +-
2 files changed, 2292 insertions(+), 2240 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc291c684..05c822087 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,53 +1,105 @@
# Icinga 2.x CHANGELOG
+## 2.8.2 (2018-03-22)
+
+### Notes
+
+A bugfix release with a focus on security.
+
+Most of these have been brought to our attention by the community and we are very thankful for that. Special thanks to Michael H., Julian and Michael O., who helped by reporting and assisting us in fixing security bugs. CVEs have also been requested for these issues, they are as follows: CVE-2017-16933, CVE-2018-6532, CVE-2018-6533, CVE-2018-6534, CVE-2018-6535, CVE-2018-6536.
+
+### Enhancement
+
+* [#5715](https://github.com/icinga/icinga2/issues/5715) (API, PR): Hash API password and comparison
+
+### Bug
+
+* [#6153](https://github.com/icinga/icinga2/issues/6153) (API, PR): Improve error handling for empty packages in /v1/config/packages
+* [#6147](https://github.com/icinga/icinga2/issues/6147) (PR): Fix incorrect argument type for JsonRpc::SendMessage
+* [#6146](https://github.com/icinga/icinga2/issues/6146) (PR): Ensure that SetCorked\(\) works properly
+* [#6134](https://github.com/icinga/icinga2/issues/6134) (PR): Fix incorrect HTTP content length limits
+* [#6133](https://github.com/icinga/icinga2/issues/6133) (PR): Limit the number of HTTP/JSON-RPC requests we read in parallel
+* [#6132](https://github.com/icinga/icinga2/issues/6132) (PR): Fix HTTP parser crash/hang
+* [#6129](https://github.com/icinga/icinga2/issues/6129): api/packages not created by prepare-dir/daemon
+* [#5995](https://github.com/icinga/icinga2/issues/5995) (InfluxDB, PR): Fix InfluxDB requests
+* [#5991](https://github.com/icinga/icinga2/issues/5991): Partial privilege escalation via PID file manipulation
+* [#5987](https://github.com/icinga/icinga2/issues/5987) (Elasticsearch, InfluxDB, Metrics): InfluxDBWriter and ElasticsearchWriter stop writing to HTTP API
+* [#5943](https://github.com/icinga/icinga2/issues/5943) (PR): Fix incorrect ::Start call
+* [#5793](https://github.com/icinga/icinga2/issues/5793): CVE-2017-16933: root privilege escalation via prepare-dirs \(init script and systemd service file\)
+* [#5760](https://github.com/icinga/icinga2/issues/5760) (Crash, PR): Fix incorrect socket handling for the HTTP client
+
+### Documentation
+
+* [#6172](https://github.com/icinga/icinga2/issues/6172) (Documentation, PR): Docs: Add a note to only query the NSClient++ API from the local Icinga 2 client
+* [#6111](https://github.com/icinga/icinga2/issues/6111) (Documentation, PR): Add Upgrading to Icinga 2.8.2 chapter
+* [#6089](https://github.com/icinga/icinga2/issues/6089) (Documentation, PR): Docs: Fix bracket in notification example
+* [#6086](https://github.com/icinga/icinga2/issues/6086) (Documentation, PR): Upgrading: Make it more clear that the Director script is just an example
+* [#6075](https://github.com/icinga/icinga2/issues/6075) (Documentation, PR): Explain how to register functions in the global scope
+* [#6014](https://github.com/icinga/icinga2/issues/6014) (Documentation, PR): Docs: Add IDO DB tuning tips
+* [#6006](https://github.com/icinga/icinga2/issues/6006) (Documentation, PR): Fix wrong nscp-local include in the docs
+
+### Support
+
+* [#6148](https://github.com/icinga/icinga2/issues/6148) (PR): Fix ApiUser unit test
+* [#6135](https://github.com/icinga/icinga2/issues/6135) (API, Cluster, PR): Limit JSON RPC message size
+* [#6115](https://github.com/icinga/icinga2/issues/6115) (PR): Fix incorrect size of request limits
+* [#6114](https://github.com/icinga/icinga2/issues/6114) (PR): Fix typo in prepare-dirs
+* [#6104](https://github.com/icinga/icinga2/issues/6104) (PR): Fix nullptr dereferences
+* [#6103](https://github.com/icinga/icinga2/issues/6103) (PR): HTTP Security fixes
+* [#5982](https://github.com/icinga/icinga2/issues/5982) (Packages, PR): SELinux: Allows icinga2\_t to send sigkill to all domains it transitions to
+* [#5916](https://github.com/icinga/icinga2/issues/5916) (Packages): Unable to kill process group after check timeout if SElinux is enabled
+* [#5850](https://github.com/icinga/icinga2/issues/5850) (Installation, PR): init script security fixes
+* [#5764](https://github.com/icinga/icinga2/issues/5764) (InfluxDB, code-quality, PR): Improve InfluxdbWriter performance
+* [#5759](https://github.com/icinga/icinga2/issues/5759) (code-quality, PR): Make default getters and setters non-virtual
+
## 2.8.1 (2018-01-17)
### Enhancement
-* [#5856](https://github.com/Icinga/icinga2/issues/5856) (PR): Implement AppLocal deployment support for UCRT
+* [#5856](https://github.com/icinga/icinga2/issues/5856) (PR): Implement AppLocal deployment support for UCRT
### Bug
-* [#5986](https://github.com/Icinga/icinga2/issues/5986) (DB IDO, PR): Fix wrong schema constraint for fresh 2.8.0 installations
-* [#5947](https://github.com/Icinga/icinga2/issues/5947) (DB IDO): Duplicate entry constraint violations in 2.8
-* [#5907](https://github.com/Icinga/icinga2/issues/5907) (PR): Windows plugin check\_swap build fix
-* [#5808](https://github.com/Icinga/icinga2/issues/5808) (Crash, PR): Fix missing variable name which can lead to segfaults
-* [#5807](https://github.com/Icinga/icinga2/issues/5807) (Crash): icinga v2.8.0 crashes frequently with "segmentation fault" on Debian 8.9
-* [#5804](https://github.com/Icinga/icinga2/issues/5804) (Log, PR): Silence UpdateRepository message errors
-* [#5776](https://github.com/Icinga/icinga2/issues/5776) (Cluster, Log): 2.8.0: warning/JsonRpcConnection: Call to non-existent function 'event::UpdateRepository'
-* [#5746](https://github.com/Icinga/icinga2/issues/5746) (Livestatus, PR): livestatus: custom variables return empty arrays instead of strings
-* [#5716](https://github.com/Icinga/icinga2/issues/5716) (Livestatus, PR): add bogus zero reply in livestatus when aggregate and non matching filter
-* [#5626](https://github.com/Icinga/icinga2/issues/5626) (Livestatus, help wanted): Empty result set with non-matching filters in Livestatus stats query
+* [#5986](https://github.com/icinga/icinga2/issues/5986) (DB IDO, PR): Fix wrong schema constraint for fresh 2.8.0 installations
+* [#5947](https://github.com/icinga/icinga2/issues/5947) (DB IDO): Duplicate entry constraint violations in 2.8
+* [#5907](https://github.com/icinga/icinga2/issues/5907) (PR): Windows plugin check\_swap build fix
+* [#5808](https://github.com/icinga/icinga2/issues/5808) (Crash, PR): Fix missing variable name which can lead to segfaults
+* [#5807](https://github.com/icinga/icinga2/issues/5807) (Crash): icinga v2.8.0 crashes frequently with "segmentation fault" on Debian 8.9
+* [#5804](https://github.com/icinga/icinga2/issues/5804) (Log, PR): Silence UpdateRepository message errors
+* [#5776](https://github.com/icinga/icinga2/issues/5776) (Cluster, Log): 2.8.0: warning/JsonRpcConnection: Call to non-existent function 'event::UpdateRepository'
+* [#5746](https://github.com/icinga/icinga2/issues/5746) (Livestatus, PR): livestatus: custom variables return empty arrays instead of strings
+* [#5716](https://github.com/icinga/icinga2/issues/5716) (Livestatus, PR): add bogus zero reply in livestatus when aggregate and non matching filter
+* [#5626](https://github.com/icinga/icinga2/issues/5626) (Livestatus, help wanted): Empty result set with non-matching filters in Livestatus stats query
### ITL
-* [#5785](https://github.com/Icinga/icinga2/issues/5785) (ITL, PR): ITL: Drop ssl\_sni default setting
-* [#5775](https://github.com/Icinga/icinga2/issues/5775) (ITL): Default usage of ssl\_sni in check\_tcp
+* [#5785](https://github.com/icinga/icinga2/issues/5785) (ITL, PR): ITL: Drop ssl\_sni default setting
+* [#5775](https://github.com/icinga/icinga2/issues/5775) (ITL): Default usage of ssl\_sni in check\_tcp
### Documentation
-* [#5972](https://github.com/Icinga/icinga2/issues/5972) (Documentation, PR): Update 08-advanced-topics.md
-* [#5942](https://github.com/Icinga/icinga2/issues/5942) (Documentation, PR): Add some technical insights into the cluster-zone health check and log lag
-* [#5922](https://github.com/Icinga/icinga2/issues/5922) (Documentation, PR): Fix link format in documentation
-* [#5918](https://github.com/Icinga/icinga2/issues/5918) (Documentation, PR): Fix typo in SELinux documentation
-* [#5911](https://github.com/Icinga/icinga2/issues/5911) (Documentation, PR): Update ElasticsearchWriter docs for 5.x support only
-* [#5866](https://github.com/Icinga/icinga2/issues/5866) (Documentation, PR): Remove redundant FreeBSD from restart instructions and add openSUSE
-* [#5864](https://github.com/Icinga/icinga2/issues/5864) (Documentation, PR): Add missing initdb to PostgreSQL documentation
-* [#5835](https://github.com/Icinga/icinga2/issues/5835) (Documentation, PR): Fixes postgres schema upgrade path
-* [#5833](https://github.com/Icinga/icinga2/issues/5833) (Documentation, PR): fix formatting error
-* [#5790](https://github.com/Icinga/icinga2/issues/5790) (Documentation, PR): Documentation fixes
-* [#5783](https://github.com/Icinga/icinga2/issues/5783) (Documentation, PR): Fix formatting in value types docs
-* [#5773](https://github.com/Icinga/icinga2/issues/5773) (Documentation, Windows, PR): Update Windows Client requirements for 2.8
-* [#5757](https://github.com/Icinga/icinga2/issues/5757) (Documentation, PR): Add documentation about automatic service restarts with systemd
+* [#5972](https://github.com/icinga/icinga2/issues/5972) (Documentation, PR): Update 08-advanced-topics.md
+* [#5942](https://github.com/icinga/icinga2/issues/5942) (Documentation, PR): Add some technical insights into the cluster-zone health check and log lag
+* [#5922](https://github.com/icinga/icinga2/issues/5922) (Documentation, PR): Fix link format in documentation
+* [#5918](https://github.com/icinga/icinga2/issues/5918) (Documentation, PR): Fix typo in SELinux documentation
+* [#5911](https://github.com/icinga/icinga2/issues/5911) (Documentation, PR): Update ElasticsearchWriter docs for 5.x support only
+* [#5866](https://github.com/icinga/icinga2/issues/5866) (Documentation, PR): Remove redundant FreeBSD from restart instructions and add openSUSE
+* [#5864](https://github.com/icinga/icinga2/issues/5864) (Documentation, PR): Add missing initdb to PostgreSQL documentation
+* [#5835](https://github.com/icinga/icinga2/issues/5835) (Documentation, PR): Fixes postgres schema upgrade path
+* [#5833](https://github.com/icinga/icinga2/issues/5833) (Documentation, PR): fix formatting error
+* [#5790](https://github.com/icinga/icinga2/issues/5790) (Documentation, PR): Documentation fixes
+* [#5783](https://github.com/icinga/icinga2/issues/5783) (Documentation, PR): Fix formatting in value types docs
+* [#5773](https://github.com/icinga/icinga2/issues/5773) (Documentation, Windows, PR): Update Windows Client requirements for 2.8
+* [#5757](https://github.com/icinga/icinga2/issues/5757) (Documentation, PR): Add documentation about automatic service restarts with systemd
### Support
-* [#5989](https://github.com/Icinga/icinga2/issues/5989) (PR): changelog.py: Adjust categories and labels: Enhancement, Bug, ITL, Documentation, Support
-* [#5938](https://github.com/Icinga/icinga2/issues/5938) (Packages, Windows): chocolatey outdated version
-* [#5893](https://github.com/Icinga/icinga2/issues/5893) (code-quality, PR): Whitespace fix
-* [#5892](https://github.com/Icinga/icinga2/issues/5892) (Installation, PR): Enable installing the init scripts on Solaris
-* [#5851](https://github.com/Icinga/icinga2/issues/5851) (Plugins, Windows, PR): Fix check\_service returning Warning instead of Critical
-* [#5780](https://github.com/Icinga/icinga2/issues/5780) (Packages, Windows): Icinga Agent Windows 2.8.0 msvcr120.dll is missing
+* [#5989](https://github.com/icinga/icinga2/issues/5989) (PR): changelog.py: Adjust categories and labels: Enhancement, Bug, ITL, Documentation, Support
+* [#5938](https://github.com/icinga/icinga2/issues/5938) (Packages, Windows): chocolatey outdated version
+* [#5893](https://github.com/icinga/icinga2/issues/5893) (code-quality, PR): Whitespace fix
+* [#5892](https://github.com/icinga/icinga2/issues/5892) (Installation, PR): Enable installing the init scripts on Solaris
+* [#5851](https://github.com/icinga/icinga2/issues/5851) (Plugins, Windows, PR): Fix check\_service returning Warning instead of Critical
+* [#5780](https://github.com/icinga/icinga2/issues/5780) (Packages, Windows): Icinga Agent Windows 2.8.0 msvcr120.dll is missing
## 2.8.0 (2017-11-16)
@@ -70,132 +122,132 @@
### Enhancement
-* [#5682](https://github.com/Icinga/icinga2/issues/5682) (Cluster, Configuration, PR): Implement support for migrating certificates to /var/lib/icinga2/certs
-* [#5681](https://github.com/Icinga/icinga2/issues/5681) (CLI, Cluster, Windows): Update Windows wizard from enhanced CSR signing \(optional ticket\)
-* [#5679](https://github.com/Icinga/icinga2/issues/5679) (CLI, Cluster): Migration path for improved certificate signing in the cluster
-* [#5606](https://github.com/Icinga/icinga2/issues/5606) (Cluster, PR): Remove bottom-up client mode
-* [#5602](https://github.com/Icinga/icinga2/issues/5602) (Windows, PR): Add windows process elevation and log message if user does not have privileges to read/write files
-* [#5587](https://github.com/Icinga/icinga2/issues/5587) (Log, PR): SyslogLogger: Implement option to set syslog facility
-* [#5580](https://github.com/Icinga/icinga2/issues/5580) (Configuration, PR): Implement new script functions: path\_exists, glob and glob\_recursive
-* [#5571](https://github.com/Icinga/icinga2/issues/5571) (CLI, Cluster, PR): Implement support for forwarding certificate signing requests in the cluster
-* [#5569](https://github.com/Icinga/icinga2/issues/5569) (Performance Data, PR): ElasticWriter: Add basic auth and TLS support for Elasticsearch behind an HTTP proxy
-* [#5554](https://github.com/Icinga/icinga2/issues/5554) (API, Cluster, PR): Add subjectAltName extension for all non-CA certificates
-* [#5547](https://github.com/Icinga/icinga2/issues/5547) (API, PR): Add optional reload parameter to config stage upload
-* [#5538](https://github.com/Icinga/icinga2/issues/5538) (Performance Data): Add ElasticsearchWriter feature
-* [#5534](https://github.com/Icinga/icinga2/issues/5534) (Configuration, PR): Implement get\_services\(host {name,object}\) and add host object support for get\_service\(\)
-* [#5527](https://github.com/Icinga/icinga2/issues/5527) (API, PR): API: Add execution\_{start,end} attribute to 'process-check-result' action
-* [#5450](https://github.com/Icinga/icinga2/issues/5450) (CLI, Cluster): Enhance CSR Autosigning \(CA proxy, etc.\)
-* [#5443](https://github.com/Icinga/icinga2/issues/5443) (API, PR): Add CORS support and set response header 'Access-Control-Allow-Origin'
-* [#5435](https://github.com/Icinga/icinga2/issues/5435) (Plugins, Windows, PR): Add -d option to check\_service
-* [#5002](https://github.com/Icinga/icinga2/issues/5002) (API, wishlist): API process-check-result allow setting timestamp
-* [#4912](https://github.com/Icinga/icinga2/issues/4912) (Configuration): new function get\_services\(host\_name\)
-* [#4799](https://github.com/Icinga/icinga2/issues/4799) (Cluster): Remove cluster/client mode "bottom up" w/ repository.d and node update-config
-* [#4769](https://github.com/Icinga/icinga2/issues/4769) (API): Validate and activate config package stages without triggering a reload
-* [#4326](https://github.com/Icinga/icinga2/issues/4326) (API): API should provide CORS Header
-* [#3891](https://github.com/Icinga/icinga2/issues/3891) (Plugins): Add option to specify ServiceDescription instead of ServiceName with check\_service.exe
+* [#5682](https://github.com/icinga/icinga2/issues/5682) (Cluster, Configuration, PR): Implement support for migrating certificates to /var/lib/icinga2/certs
+* [#5681](https://github.com/icinga/icinga2/issues/5681) (CLI, Cluster, Windows): Update Windows wizard from enhanced CSR signing \(optional ticket\)
+* [#5679](https://github.com/icinga/icinga2/issues/5679) (CLI, Cluster): Migration path for improved certificate signing in the cluster
+* [#5606](https://github.com/icinga/icinga2/issues/5606) (Cluster, PR): Remove bottom-up client mode
+* [#5602](https://github.com/icinga/icinga2/issues/5602) (Windows, PR): Add windows process elevation and log message if user does not have privileges to read/write files
+* [#5587](https://github.com/icinga/icinga2/issues/5587) (Log, PR): SyslogLogger: Implement option to set syslog facility
+* [#5580](https://github.com/icinga/icinga2/issues/5580) (Configuration, PR): Implement new script functions: path\_exists, glob and glob\_recursive
+* [#5571](https://github.com/icinga/icinga2/issues/5571) (CLI, Cluster, PR): Implement support for forwarding certificate signing requests in the cluster
+* [#5569](https://github.com/icinga/icinga2/issues/5569) (Metrics, PR): ElasticWriter: Add basic auth and TLS support for Elasticsearch behind an HTTP proxy
+* [#5554](https://github.com/icinga/icinga2/issues/5554) (API, Cluster, PR): Add subjectAltName extension for all non-CA certificates
+* [#5547](https://github.com/icinga/icinga2/issues/5547) (API, PR): Add optional reload parameter to config stage upload
+* [#5538](https://github.com/icinga/icinga2/issues/5538) (Metrics): Add ElasticsearchWriter feature
+* [#5534](https://github.com/icinga/icinga2/issues/5534) (Configuration, PR): Implement get\_services\(host {name,object}\) and add host object support for get\_service\(\)
+* [#5527](https://github.com/icinga/icinga2/issues/5527) (API, PR): API: Add execution\_{start,end} attribute to 'process-check-result' action
+* [#5450](https://github.com/icinga/icinga2/issues/5450) (CLI, Cluster): Enhance CSR Autosigning \(CA proxy, etc.\)
+* [#5443](https://github.com/icinga/icinga2/issues/5443) (API, PR): Add CORS support and set response header 'Access-Control-Allow-Origin'
+* [#5435](https://github.com/icinga/icinga2/issues/5435) (Plugins, Windows, PR): Add -d option to check\_service
+* [#5002](https://github.com/icinga/icinga2/issues/5002) (API, wishlist): API process-check-result allow setting timestamp
+* [#4912](https://github.com/icinga/icinga2/issues/4912) (Configuration): new function get\_services\(host\_name\)
+* [#4799](https://github.com/icinga/icinga2/issues/4799) (Cluster): Remove cluster/client mode "bottom up" w/ repository.d and node update-config
+* [#4769](https://github.com/icinga/icinga2/issues/4769) (API): Validate and activate config package stages without triggering a reload
+* [#4326](https://github.com/icinga/icinga2/issues/4326) (API): API should provide CORS Header
+* [#3891](https://github.com/icinga/icinga2/issues/3891) (Plugins): Add option to specify ServiceDescription instead of ServiceName with check\_service.exe
### Bug
-* [#5728](https://github.com/Icinga/icinga2/issues/5728) (Plugins, Windows, PR): Fix check\_service not working with names
-* [#5720](https://github.com/Icinga/icinga2/issues/5720) (Check Execution): Flapping tests and bugs
-* [#5710](https://github.com/Icinga/icinga2/issues/5710) (CLI, Configuration, PR): Include default global zones during node wizard/setup
-* [#5707](https://github.com/Icinga/icinga2/issues/5707) (CLI): node wizard/setup override zones.conf but do not include default global zones \(director-global, global-templates\)
-* [#5696](https://github.com/Icinga/icinga2/issues/5696) (PR): Fix fork error handling
-* [#5641](https://github.com/Icinga/icinga2/issues/5641) (PR): Fix compiler warnings on macOS 10.13
-* [#5635](https://github.com/Icinga/icinga2/issues/5635) (Configuration, PR): Fix match\(\), regex\(\), cidr\_match\(\) behaviour with MatchAll and empty arrays
-* [#5634](https://github.com/Icinga/icinga2/issues/5634) (Configuration): match\(\) for arrays returns boolean true if array is empty
-* [#5620](https://github.com/Icinga/icinga2/issues/5620) (API, PR): Ensure that the REST API config package/stage creation is atomic
-* [#5617](https://github.com/Icinga/icinga2/issues/5617): Crash with premature EOF on resource limited OS
-* [#5614](https://github.com/Icinga/icinga2/issues/5614) (PR): Fixed missing include statement in unit tests
-* [#5584](https://github.com/Icinga/icinga2/issues/5584) (Windows): Build error on Windows
-* [#5581](https://github.com/Icinga/icinga2/issues/5581) (API, Cluster, Crash, PR): Fix possible race condition in ApiListener locking
-* [#5558](https://github.com/Icinga/icinga2/issues/5558) (API, PR): Don't sent scheme and hostname in request
-* [#5515](https://github.com/Icinga/icinga2/issues/5515) (Windows): Config validation fails on Windows with unprivileged account
-* [#5500](https://github.com/Icinga/icinga2/issues/5500) (Crash, PR): Process: Fix JSON parsing error on process helper crash
-* [#5497](https://github.com/Icinga/icinga2/issues/5497) (API, PR): API: Fix requested attrs/joins/meta type errors in object query response
-* [#5485](https://github.com/Icinga/icinga2/issues/5485) (DB IDO, PR): Ensure that expired/removed downtimes/comments are correctly updated in DB IDO
-* [#5377](https://github.com/Icinga/icinga2/issues/5377) (API, Log): Sending wrong value for key causes ugly stacktrace
-* [#5231](https://github.com/Icinga/icinga2/issues/5231) (Check Execution, PR): Report failure to kill check command after exceeding timeout
-* [#4981](https://github.com/Icinga/icinga2/issues/4981) (Check Execution): Failure to kill check command after exceeding timeout is not reported
+* [#5728](https://github.com/icinga/icinga2/issues/5728) (Plugins, Windows, PR): Fix check\_service not working with names
+* [#5720](https://github.com/icinga/icinga2/issues/5720) (Check Execution): Flapping tests and bugs
+* [#5710](https://github.com/icinga/icinga2/issues/5710) (CLI, Configuration, PR): Include default global zones during node wizard/setup
+* [#5707](https://github.com/icinga/icinga2/issues/5707) (CLI): node wizard/setup override zones.conf but do not include default global zones \(director-global, global-templates\)
+* [#5696](https://github.com/icinga/icinga2/issues/5696) (PR): Fix fork error handling
+* [#5641](https://github.com/icinga/icinga2/issues/5641) (PR): Fix compiler warnings on macOS 10.13
+* [#5635](https://github.com/icinga/icinga2/issues/5635) (Configuration, PR): Fix match\(\), regex\(\), cidr\_match\(\) behaviour with MatchAll and empty arrays
+* [#5634](https://github.com/icinga/icinga2/issues/5634) (Configuration): match\(\) for arrays returns boolean true if array is empty
+* [#5620](https://github.com/icinga/icinga2/issues/5620) (API, PR): Ensure that the REST API config package/stage creation is atomic
+* [#5617](https://github.com/icinga/icinga2/issues/5617): Crash with premature EOF on resource limited OS
+* [#5614](https://github.com/icinga/icinga2/issues/5614) (PR): Fixed missing include statement in unit tests
+* [#5584](https://github.com/icinga/icinga2/issues/5584) (Windows): Build error on Windows
+* [#5581](https://github.com/icinga/icinga2/issues/5581) (API, Cluster, Crash, PR): Fix possible race condition in ApiListener locking
+* [#5558](https://github.com/icinga/icinga2/issues/5558) (API, PR): Don't sent scheme and hostname in request
+* [#5515](https://github.com/icinga/icinga2/issues/5515) (Windows): Config validation fails on Windows with unprivileged account
+* [#5500](https://github.com/icinga/icinga2/issues/5500) (Crash, PR): Process: Fix JSON parsing error on process helper crash
+* [#5497](https://github.com/icinga/icinga2/issues/5497) (API, PR): API: Fix requested attrs/joins/meta type errors in object query response
+* [#5485](https://github.com/icinga/icinga2/issues/5485) (DB IDO, PR): Ensure that expired/removed downtimes/comments are correctly updated in DB IDO
+* [#5377](https://github.com/icinga/icinga2/issues/5377) (API, Log): Sending wrong value for key causes ugly stacktrace
+* [#5231](https://github.com/icinga/icinga2/issues/5231) (Check Execution, PR): Report failure to kill check command after exceeding timeout
+* [#4981](https://github.com/icinga/icinga2/issues/4981) (Check Execution): Failure to kill check command after exceeding timeout is not reported
### ITL
-* [#5678](https://github.com/Icinga/icinga2/issues/5678) (ITL, PR): Added missing "-q" parameter to check\_ntp\_peer
-* [#5672](https://github.com/Icinga/icinga2/issues/5672) (ITL, PR): add itl snmp-service for manubulon plugin check\_snmp\_win.pl
-* [#5647](https://github.com/Icinga/icinga2/issues/5647) (ITL, PR): Allow to disable thresholds for ipmi CheckCommand
-* [#5640](https://github.com/Icinga/icinga2/issues/5640) (ITL, PR): ITL: Support weathermap data in snmp\_interface CheckCommand
-* [#5638](https://github.com/Icinga/icinga2/issues/5638) (ITL, PR): Add support for check\_address as default in database CheckCommand objects
-* [#5578](https://github.com/Icinga/icinga2/issues/5578) (ITL, PR): ITL: Re-Add ssl\_sni attribute for check\_tcp
-* [#5577](https://github.com/Icinga/icinga2/issues/5577) (ITL): ssl CheckCommand does not support SNI
-* [#5570](https://github.com/Icinga/icinga2/issues/5570) (ITL, PR): check\_esxi\_hardware.py with new --no-lcd parameter
-* [#5559](https://github.com/Icinga/icinga2/issues/5559) (ITL, PR): Exclude configfs from disk checks
-* [#5427](https://github.com/Icinga/icinga2/issues/5427) (ITL): Update negate CheckCommand definition
-* [#5401](https://github.com/Icinga/icinga2/issues/5401) (ITL, PR): itl: Add manubulon/check\_snmp\_env.pl as CheckCommand snmp-env
-* [#5394](https://github.com/Icinga/icinga2/issues/5394) (ITL, PR): itl: add additional mssql\_health arguments
-* [#5387](https://github.com/Icinga/icinga2/issues/5387) (ITL, PR): Add missing options to snmp CheckCommand definition
+* [#5678](https://github.com/icinga/icinga2/issues/5678) (ITL, PR): Added missing "-q" parameter to check\_ntp\_peer
+* [#5672](https://github.com/icinga/icinga2/issues/5672) (ITL, PR): add itl snmp-service for manubulon plugin check\_snmp\_win.pl
+* [#5647](https://github.com/icinga/icinga2/issues/5647) (ITL, PR): Allow to disable thresholds for ipmi CheckCommand
+* [#5640](https://github.com/icinga/icinga2/issues/5640) (ITL, PR): ITL: Support weathermap data in snmp\_interface CheckCommand
+* [#5638](https://github.com/icinga/icinga2/issues/5638) (ITL, PR): Add support for check\_address as default in database CheckCommand objects
+* [#5578](https://github.com/icinga/icinga2/issues/5578) (ITL, PR): ITL: Re-Add ssl\_sni attribute for check\_tcp
+* [#5577](https://github.com/icinga/icinga2/issues/5577) (ITL): ssl CheckCommand does not support SNI
+* [#5570](https://github.com/icinga/icinga2/issues/5570) (ITL, PR): check\_esxi\_hardware.py with new --no-lcd parameter
+* [#5559](https://github.com/icinga/icinga2/issues/5559) (ITL, PR): Exclude configfs from disk checks
+* [#5427](https://github.com/icinga/icinga2/issues/5427) (ITL): Update negate CheckCommand definition
+* [#5401](https://github.com/icinga/icinga2/issues/5401) (ITL, PR): itl: Add manubulon/check\_snmp\_env.pl as CheckCommand snmp-env
+* [#5394](https://github.com/icinga/icinga2/issues/5394) (ITL, PR): itl: add additional mssql\_health arguments
+* [#5387](https://github.com/icinga/icinga2/issues/5387) (ITL, PR): Add missing options to snmp CheckCommand definition
### Documentation
-* [#5768](https://github.com/Icinga/icinga2/issues/5768) (Documentation, PR): Update .mailmap and AUTHORS
-* [#5761](https://github.com/Icinga/icinga2/issues/5761) (Documentation, PR): Fix wrong anchors in the documentation
-* [#5755](https://github.com/Icinga/icinga2/issues/5755) (Documentation, PR): Fix missing Accept header in troubleshooting docs
-* [#5754](https://github.com/Icinga/icinga2/issues/5754) (Documentation, PR): Improve documentation of cipher\_list
-* [#5752](https://github.com/Icinga/icinga2/issues/5752) (Documentation, PR): Add Noah Hilverling to .mailmap
-* [#5748](https://github.com/Icinga/icinga2/issues/5748) (Documentation, PR): Fix missing word in pin checks in a zone doc chapter
-* [#5741](https://github.com/Icinga/icinga2/issues/5741) (Documentation, PR): Fix manual certificate creation chapter in the docs
-* [#5738](https://github.com/Icinga/icinga2/issues/5738) (Documentation, PR): Update release docs
-* [#5734](https://github.com/Icinga/icinga2/issues/5734) (Documentation, PR): Fix broken links inside the documentation
-* [#5727](https://github.com/Icinga/icinga2/issues/5727) (Documentation, PR): Update upgrading documentation for 2.8
-* [#5708](https://github.com/Icinga/icinga2/issues/5708) (Documentation, PR): Fixed grammar and spelling mistakes
-* [#5703](https://github.com/Icinga/icinga2/issues/5703) (Documentation): Minor documentation typos in flapping detection description
-* [#5695](https://github.com/Icinga/icinga2/issues/5695) (Documentation, PR): Enhance Security chapter for Distributed Monitoring documentation
-* [#5691](https://github.com/Icinga/icinga2/issues/5691) (Documentation, PR): Fixed doc formatting
-* [#5690](https://github.com/Icinga/icinga2/issues/5690) (Documentation): Improve documentation of cipher\_list
-* [#5688](https://github.com/Icinga/icinga2/issues/5688) (Documentation, PR): Fixed typos and punctuation
-* [#5680](https://github.com/Icinga/icinga2/issues/5680) (Documentation): Review documentation for enhanced CSR signing and update migration chapter for 2.8
-* [#5677](https://github.com/Icinga/icinga2/issues/5677) (Documentation, PR): Fix typo in threshold syntax documentation
-* [#5668](https://github.com/Icinga/icinga2/issues/5668) (Documentation, PR): Enhance Monitoring Basics in the documentation
-* [#5667](https://github.com/Icinga/icinga2/issues/5667) (Documentation): Explain which values can be used for set\_if in command arguments
-* [#5666](https://github.com/Icinga/icinga2/issues/5666) (Documentation): Explain the notification with users defined on host/service in a dedicated docs chapter
-* [#5665](https://github.com/Icinga/icinga2/issues/5665) (Documentation): Better explanations and iteration details for "apply for" documentation
-* [#5664](https://github.com/Icinga/icinga2/issues/5664) (Documentation): Add usage examples to the "apply" chapter based on custom attribute values
-* [#5663](https://github.com/Icinga/icinga2/issues/5663) (Documentation): Explain custom attribute value types and nested dictionaries
-* [#5662](https://github.com/Icinga/icinga2/issues/5662) (Documentation): Explain how to use a different host check command
-* [#5655](https://github.com/Icinga/icinga2/issues/5655) (Documentation, PR): Enhance documentation with more details on value types for object attributes
-* [#5576](https://github.com/Icinga/icinga2/issues/5576) (Documentation, PR): Fixed downtime example in documentation
-* [#5568](https://github.com/Icinga/icinga2/issues/5568) (Documentation, PR): Add documentation for multi-line plugin output for API actions
-* [#5511](https://github.com/Icinga/icinga2/issues/5511) (Cluster, Documentation, Windows): SSL errors with leading zeros in certificate serials \(created \< v2.4\) with OpenSSL 1.1.0
-* [#5379](https://github.com/Icinga/icinga2/issues/5379) (Documentation, PR): Set shell prompt for commands to be \#
-* [#5186](https://github.com/Icinga/icinga2/issues/5186) (Documentation): Document boolean values understood by set\_if
-* [#5060](https://github.com/Icinga/icinga2/issues/5060) (Documentation): Missing documentation for macro\(\)
-* [#4015](https://github.com/Icinga/icinga2/issues/4015) (Documentation): Add documentation for host state calculation from plugin exit codes
+* [#5768](https://github.com/icinga/icinga2/issues/5768) (Documentation, PR): Update .mailmap and AUTHORS
+* [#5761](https://github.com/icinga/icinga2/issues/5761) (Documentation, PR): Fix wrong anchors in the documentation
+* [#5755](https://github.com/icinga/icinga2/issues/5755) (Documentation, PR): Fix missing Accept header in troubleshooting docs
+* [#5754](https://github.com/icinga/icinga2/issues/5754) (Documentation, PR): Improve documentation of cipher\_list
+* [#5752](https://github.com/icinga/icinga2/issues/5752) (Documentation, PR): Add Noah Hilverling to .mailmap
+* [#5748](https://github.com/icinga/icinga2/issues/5748) (Documentation, PR): Fix missing word in pin checks in a zone doc chapter
+* [#5741](https://github.com/icinga/icinga2/issues/5741) (Documentation, PR): Fix manual certificate creation chapter in the docs
+* [#5738](https://github.com/icinga/icinga2/issues/5738) (Documentation, PR): Update release docs
+* [#5734](https://github.com/icinga/icinga2/issues/5734) (Documentation, PR): Fix broken links inside the documentation
+* [#5727](https://github.com/icinga/icinga2/issues/5727) (Documentation, PR): Update upgrading documentation for 2.8
+* [#5708](https://github.com/icinga/icinga2/issues/5708) (Documentation, PR): Fixed grammar and spelling mistakes
+* [#5703](https://github.com/icinga/icinga2/issues/5703) (Documentation): Minor documentation typos in flapping detection description
+* [#5695](https://github.com/icinga/icinga2/issues/5695) (Documentation, PR): Enhance Security chapter for Distributed Monitoring documentation
+* [#5691](https://github.com/icinga/icinga2/issues/5691) (Documentation, PR): Fixed doc formatting
+* [#5690](https://github.com/icinga/icinga2/issues/5690) (Documentation): Improve documentation of cipher\_list
+* [#5688](https://github.com/icinga/icinga2/issues/5688) (Documentation, PR): Fixed typos and punctuation
+* [#5680](https://github.com/icinga/icinga2/issues/5680) (Documentation): Review documentation for enhanced CSR signing and update migration chapter for 2.8
+* [#5677](https://github.com/icinga/icinga2/issues/5677) (Documentation, PR): Fix typo in threshold syntax documentation
+* [#5668](https://github.com/icinga/icinga2/issues/5668) (Documentation, PR): Enhance Monitoring Basics in the documentation
+* [#5667](https://github.com/icinga/icinga2/issues/5667) (Documentation): Explain which values can be used for set\_if in command arguments
+* [#5666](https://github.com/icinga/icinga2/issues/5666) (Documentation): Explain the notification with users defined on host/service in a dedicated docs chapter
+* [#5665](https://github.com/icinga/icinga2/issues/5665) (Documentation): Better explanations and iteration details for "apply for" documentation
+* [#5664](https://github.com/icinga/icinga2/issues/5664) (Documentation): Add usage examples to the "apply" chapter based on custom attribute values
+* [#5663](https://github.com/icinga/icinga2/issues/5663) (Documentation): Explain custom attribute value types and nested dictionaries
+* [#5662](https://github.com/icinga/icinga2/issues/5662) (Documentation): Explain how to use a different host check command
+* [#5655](https://github.com/icinga/icinga2/issues/5655) (Documentation, PR): Enhance documentation with more details on value types for object attributes
+* [#5576](https://github.com/icinga/icinga2/issues/5576) (Documentation, PR): Fixed downtime example in documentation
+* [#5568](https://github.com/icinga/icinga2/issues/5568) (Documentation, PR): Add documentation for multi-line plugin output for API actions
+* [#5511](https://github.com/icinga/icinga2/issues/5511) (Cluster, Documentation, Windows): SSL errors with leading zeros in certificate serials \(created \< v2.4\) with OpenSSL 1.1.0
+* [#5379](https://github.com/icinga/icinga2/issues/5379) (Documentation, PR): Set shell prompt for commands to be \#
+* [#5186](https://github.com/icinga/icinga2/issues/5186) (Documentation): Document boolean values understood by set\_if
+* [#5060](https://github.com/icinga/icinga2/issues/5060) (Documentation): Missing documentation for macro\(\)
+* [#4015](https://github.com/icinga/icinga2/issues/4015) (Documentation): Add documentation for host state calculation from plugin exit codes
### Support
-* [#5765](https://github.com/Icinga/icinga2/issues/5765) (Configuration, PR): Fix default configuration example for ElasticsearchWriter
-* [#5739](https://github.com/Icinga/icinga2/issues/5739) (Performance Data, PR): Rename ElasticWriter to ElasticsearchWriter
-* [#5732](https://github.com/Icinga/icinga2/issues/5732) (Check Execution, DB IDO, PR): Fix flapping calculation and events
-* [#5730](https://github.com/Icinga/icinga2/issues/5730) (PR): Add missing trims to GetMasterHostPort and remove Convert.ToString from variables that are strings already
-* [#5719](https://github.com/Icinga/icinga2/issues/5719) (Cluster, Installation, Windows, PR): Update Windows Wizard for 2.8 and new signing methods
-* [#5687](https://github.com/Icinga/icinga2/issues/5687) (Cluster, Log, PR): Improve error message for unknown cluster message functions
-* [#5686](https://github.com/Icinga/icinga2/issues/5686) (Log): Ugly stacktrace with mismatching versions in cluster
-* [#5643](https://github.com/Icinga/icinga2/issues/5643) (PR): Fix debug builds on Apple Clang 9.0.0 \(macOS High Sierra\)
-* [#5637](https://github.com/Icinga/icinga2/issues/5637) (InfluxDB, PR): Fix unnecessary String\(\) casts in InfluxdbWriter
-* [#5629](https://github.com/Icinga/icinga2/issues/5629) (InfluxDB, Performance Data, code-quality): Remove the unnecessary String\(\) casts in influxdbwriter.cpp
-* [#5624](https://github.com/Icinga/icinga2/issues/5624) (PR): Fixed missing include statement in unit test
-* [#5619](https://github.com/Icinga/icinga2/issues/5619) (Packages, PR): Exit early in changelog.py if GitHub API fetch fails
-* [#5616](https://github.com/Icinga/icinga2/issues/5616) (PR): Fix a build warning
-* [#5608](https://github.com/Icinga/icinga2/issues/5608) (CLI, Cluster, PR): Fix certificate paths for installers
-* [#5604](https://github.com/Icinga/icinga2/issues/5604) (Packages, PR): Remove the icinga2-classicui-package and update documentation
-* [#5601](https://github.com/Icinga/icinga2/issues/5601) (Installation, Packages, PR): Ensure that the cache directory always is set and add a note to upgrading docs
-* [#5563](https://github.com/Icinga/icinga2/issues/5563) (Cluster, PR): Implement additional logging for the JsonRpc class
-* [#5545](https://github.com/Icinga/icinga2/issues/5545) (Installation, Windows, PR): Add Edit button to Windows Setup Wizard
-* [#5488](https://github.com/Icinga/icinga2/issues/5488) (code-quality, PR): Implement additional functions for printing values with LLDB/GDB
-* [#5486](https://github.com/Icinga/icinga2/issues/5486) (Graphite, PR): Graphite: Remove deprecated legacy schema mode
-* [#5301](https://github.com/Icinga/icinga2/issues/5301) (Installation, Packages): Remove the icinga2-classicui-config package
-* [#5258](https://github.com/Icinga/icinga2/issues/5258) (Installation, PR): Fix clang compiler detection on Fedora and macOS
-* [#4992](https://github.com/Icinga/icinga2/issues/4992) (Graphite): Remove deprecated GraphiteWriter feature enable\_legacy\_mode
-* [#4982](https://github.com/Icinga/icinga2/issues/4982) (Notifications, Tests): Verify and fix flapping detection
+* [#5765](https://github.com/icinga/icinga2/issues/5765) (Configuration, PR): Fix default configuration example for ElasticsearchWriter
+* [#5739](https://github.com/icinga/icinga2/issues/5739) (Metrics, PR): Rename ElasticWriter to ElasticsearchWriter
+* [#5732](https://github.com/icinga/icinga2/issues/5732) (Check Execution, DB IDO, PR): Fix flapping calculation and events
+* [#5730](https://github.com/icinga/icinga2/issues/5730) (PR): Add missing trims to GetMasterHostPort and remove Convert.ToString from variables that are strings already
+* [#5719](https://github.com/icinga/icinga2/issues/5719) (Cluster, Installation, Windows, PR): Update Windows Wizard for 2.8 and new signing methods
+* [#5687](https://github.com/icinga/icinga2/issues/5687) (Cluster, Log, PR): Improve error message for unknown cluster message functions
+* [#5686](https://github.com/icinga/icinga2/issues/5686) (Log): Ugly stacktrace with mismatching versions in cluster
+* [#5643](https://github.com/icinga/icinga2/issues/5643) (PR): Fix debug builds on Apple Clang 9.0.0 \(macOS High Sierra\)
+* [#5637](https://github.com/icinga/icinga2/issues/5637) (InfluxDB, PR): Fix unnecessary String\(\) casts in InfluxdbWriter
+* [#5629](https://github.com/icinga/icinga2/issues/5629) (InfluxDB, Metrics, code-quality): Remove the unnecessary String\(\) casts in influxdbwriter.cpp
+* [#5624](https://github.com/icinga/icinga2/issues/5624) (PR): Fixed missing include statement in unit test
+* [#5619](https://github.com/icinga/icinga2/issues/5619) (Packages, PR): Exit early in changelog.py if GitHub API fetch fails
+* [#5616](https://github.com/icinga/icinga2/issues/5616) (PR): Fix a build warning
+* [#5608](https://github.com/icinga/icinga2/issues/5608) (CLI, Cluster, PR): Fix certificate paths for installers
+* [#5604](https://github.com/icinga/icinga2/issues/5604) (Packages, PR): Remove the icinga2-classicui-package and update documentation
+* [#5601](https://github.com/icinga/icinga2/issues/5601) (Installation, Packages, PR): Ensure that the cache directory always is set and add a note to upgrading docs
+* [#5563](https://github.com/icinga/icinga2/issues/5563) (Cluster, PR): Implement additional logging for the JsonRpc class
+* [#5545](https://github.com/icinga/icinga2/issues/5545) (Installation, Windows, PR): Add Edit button to Windows Setup Wizard
+* [#5488](https://github.com/icinga/icinga2/issues/5488) (code-quality, PR): Implement additional functions for printing values with LLDB/GDB
+* [#5486](https://github.com/icinga/icinga2/issues/5486) (Graphite, PR): Graphite: Remove deprecated legacy schema mode
+* [#5301](https://github.com/icinga/icinga2/issues/5301) (Installation, Packages): Remove the icinga2-classicui-config package
+* [#5258](https://github.com/icinga/icinga2/issues/5258) (Installation, PR): Fix clang compiler detection on Fedora and macOS
+* [#4992](https://github.com/icinga/icinga2/issues/4992) (Graphite): Remove deprecated GraphiteWriter feature enable\_legacy\_mode
+* [#4982](https://github.com/icinga/icinga2/issues/4982) (Notifications, Tests): Verify and fix flapping detection
## 2.7.2 (2017-11-09)
@@ -208,20 +260,20 @@
### Bug
-* [#5636](https://github.com/Icinga/icinga2/issues/5636) (DB IDO, PR): Fix unique constraint matching for UPDATE downtime/comment runtime tables in DB IDO
-* [#5623](https://github.com/Icinga/icinga2/issues/5623) (DB IDO): Duplicate Key on MySQL after upgrading to v2.7.1
-* [#5603](https://github.com/Icinga/icinga2/issues/5603) (DB IDO): Icinga 2.7.1 IDO Unique Key Constraint Violation with PostgreSQL
+* [#5636](https://github.com/icinga/icinga2/issues/5636) (DB IDO, PR): Fix unique constraint matching for UPDATE downtime/comment runtime tables in DB IDO
+* [#5623](https://github.com/icinga/icinga2/issues/5623) (DB IDO): Duplicate Key on MySQL after upgrading to v2.7.1
+* [#5603](https://github.com/icinga/icinga2/issues/5603) (DB IDO): Icinga 2.7.1 IDO Unique Key Constraint Violation with PostgreSQL
### Documentation
-* [#5653](https://github.com/Icinga/icinga2/issues/5653) (Documentation, PR): Docs: Fix default value for `snmp\_nocrypt` for Manubulon CheckCommand definitions
-* [#5652](https://github.com/Icinga/icinga2/issues/5652) (Documentation, PR): Docs: Fix missing default value for cluster-zone checks
-* [#5632](https://github.com/Icinga/icinga2/issues/5632) (Documentation, PR): Docs: Mention SELinux in Getting Started chapter
+* [#5653](https://github.com/icinga/icinga2/issues/5653) (Documentation, PR): Docs: Fix default value for `snmp\_nocrypt` for Manubulon CheckCommand definitions
+* [#5652](https://github.com/icinga/icinga2/issues/5652) (Documentation, PR): Docs: Fix missing default value for cluster-zone checks
+* [#5632](https://github.com/icinga/icinga2/issues/5632) (Documentation, PR): Docs: Mention SELinux in Getting Started chapter
### Support
-* [#5736](https://github.com/Icinga/icinga2/issues/5736) (Packages, PR): Remove spec file
-* [#5612](https://github.com/Icinga/icinga2/issues/5612) (Documentation, Packages, PR): Improve documentation and systemd config on TaskMax
+* [#5736](https://github.com/icinga/icinga2/issues/5736) (Packages, PR): Remove spec file
+* [#5612](https://github.com/icinga/icinga2/issues/5612) (Documentation, Packages, PR): Improve documentation and systemd config on TaskMax
## 2.7.1 (2017-09-21)
@@ -237,69 +289,69 @@
### Enhancement
-* [#5523](https://github.com/Icinga/icinga2/issues/5523) (Cluster, Log, PR): Enhance client connect/sync logging and include bytes/zone in logs
-* [#5474](https://github.com/Icinga/icinga2/issues/5474) (Notifications, PR): Notification scripts - make HOSTADDRESS optional
-* [#5468](https://github.com/Icinga/icinga2/issues/5468) (Notifications, PR): Make notification mails more readable. Remove redundancy and cruft.
+* [#5523](https://github.com/icinga/icinga2/issues/5523) (Cluster, Log, PR): Enhance client connect/sync logging and include bytes/zone in logs
+* [#5474](https://github.com/icinga/icinga2/issues/5474) (Notifications, PR): Notification scripts - make HOSTADDRESS optional
+* [#5468](https://github.com/icinga/icinga2/issues/5468) (Notifications, PR): Make notification mails more readable. Remove redundancy and cruft.
### Bug
-* [#5585](https://github.com/Icinga/icinga2/issues/5585) (DB IDO, PR): Fix where clause for non-matching {downtime,comment}history IDO database updates
-* [#5566](https://github.com/Icinga/icinga2/issues/5566) (Cluster, Log, PR): Logs: Change config sync update to highlight an information, not an error
-* [#5539](https://github.com/Icinga/icinga2/issues/5539) (Plugins, Windows, PR): check\_nscp\_api: Allow arguments containing spaces
-* [#5537](https://github.com/Icinga/icinga2/issues/5537) (Plugins): check\_nscp\_api: support spaces in query arguments
-* [#5524](https://github.com/Icinga/icinga2/issues/5524) (Cluster, PR): Change FIFO::Optimize\(\) frequency for large messages
-* [#5513](https://github.com/Icinga/icinga2/issues/5513) (Cluster): Node in Cluster loses connection
-* [#5504](https://github.com/Icinga/icinga2/issues/5504) (InfluxDB, PR): Fix TLS Race Connecting to InfluxDB
-* [#5503](https://github.com/Icinga/icinga2/issues/5503) (Livestatus, PR): Fix grouping for Livestatus queries with 'Stats'
-* [#5502](https://github.com/Icinga/icinga2/issues/5502) (Notifications, PR): Fix duplicate variable in notification scripts
-* [#5495](https://github.com/Icinga/icinga2/issues/5495) (Notifications, PR): Fix parameter order for AcknowledgeSvcProblem / AcknowledgeHostProblem / apiactions:AcknowledgeProblem
-* [#5492](https://github.com/Icinga/icinga2/issues/5492) (DB IDO): Comments may not be removed correctly
-* [#5484](https://github.com/Icinga/icinga2/issues/5484) (Log): Timestamp comparison of config files logs a wrong message
-* [#5483](https://github.com/Icinga/icinga2/issues/5483) (DB IDO, PR): Fix config validation for DB IDO categories 'DbCatEverything'
-* [#5469](https://github.com/Icinga/icinga2/issues/5469) (InfluxDB): Failure to connect to InfluxDB increases CPU utilisation by 100% for every failure
-* [#5466](https://github.com/Icinga/icinga2/issues/5466) (DB IDO, PR): DB IDO: Fix host's unreachable state in history tables
-* [#5460](https://github.com/Icinga/icinga2/issues/5460) (InfluxDB): Icinga 2.7 InfluxdbWriter fails to write metrics to InfluxDB over HTTPS
-* [#5458](https://github.com/Icinga/icinga2/issues/5458) (DB IDO): IDO donwtimehistory records orphaned from scheduleddowntime records following restart
-* [#5405](https://github.com/Icinga/icinga2/issues/5405) (DB IDO): IDO statehistory table does not show hosts going to "UNREACHABLE" state.
-* [#5078](https://github.com/Icinga/icinga2/issues/5078) (Compat, Livestatus): Livestatus hostsbygroup and servicesbyhostgroup do not work
+* [#5585](https://github.com/icinga/icinga2/issues/5585) (DB IDO, PR): Fix where clause for non-matching {downtime,comment}history IDO database updates
+* [#5566](https://github.com/icinga/icinga2/issues/5566) (Cluster, Log, PR): Logs: Change config sync update to highlight an information, not an error
+* [#5539](https://github.com/icinga/icinga2/issues/5539) (Plugins, Windows, PR): check\_nscp\_api: Allow arguments containing spaces
+* [#5537](https://github.com/icinga/icinga2/issues/5537) (Plugins): check\_nscp\_api: support spaces in query arguments
+* [#5524](https://github.com/icinga/icinga2/issues/5524) (Cluster, PR): Change FIFO::Optimize\(\) frequency for large messages
+* [#5513](https://github.com/icinga/icinga2/issues/5513) (Cluster): Node in Cluster loses connection
+* [#5504](https://github.com/icinga/icinga2/issues/5504) (InfluxDB, PR): Fix TLS Race Connecting to InfluxDB
+* [#5503](https://github.com/icinga/icinga2/issues/5503) (Livestatus, PR): Fix grouping for Livestatus queries with 'Stats'
+* [#5502](https://github.com/icinga/icinga2/issues/5502) (Notifications, PR): Fix duplicate variable in notification scripts
+* [#5495](https://github.com/icinga/icinga2/issues/5495) (Notifications, PR): Fix parameter order for AcknowledgeSvcProblem / AcknowledgeHostProblem / apiactions:AcknowledgeProblem
+* [#5492](https://github.com/icinga/icinga2/issues/5492) (DB IDO): Comments may not be removed correctly
+* [#5484](https://github.com/icinga/icinga2/issues/5484) (Log): Timestamp comparison of config files logs a wrong message
+* [#5483](https://github.com/icinga/icinga2/issues/5483) (DB IDO, PR): Fix config validation for DB IDO categories 'DbCatEverything'
+* [#5469](https://github.com/icinga/icinga2/issues/5469) (InfluxDB): Failure to connect to InfluxDB increases CPU utilisation by 100% for every failure
+* [#5466](https://github.com/icinga/icinga2/issues/5466) (DB IDO, PR): DB IDO: Fix host's unreachable state in history tables
+* [#5460](https://github.com/icinga/icinga2/issues/5460) (InfluxDB): Icinga 2.7 InfluxdbWriter fails to write metrics to InfluxDB over HTTPS
+* [#5458](https://github.com/icinga/icinga2/issues/5458) (DB IDO): IDO donwtimehistory records orphaned from scheduleddowntime records following restart
+* [#5405](https://github.com/icinga/icinga2/issues/5405) (DB IDO): IDO statehistory table does not show hosts going to "UNREACHABLE" state.
+* [#5078](https://github.com/icinga/icinga2/issues/5078) (Compat, Livestatus): Livestatus hostsbygroup and servicesbyhostgroup do not work
### ITL
-* [#5543](https://github.com/Icinga/icinga2/issues/5543) (ITL, PR): ITL: Correct arguments for ipmi-sensor CheckCommand
+* [#5543](https://github.com/icinga/icinga2/issues/5543) (ITL, PR): ITL: Correct arguments for ipmi-sensor CheckCommand
### Documentation
-* [#5594](https://github.com/Icinga/icinga2/issues/5594) (Documentation, PR): Docs: Enhance certificate and configuration troubleshooting chapter
-* [#5593](https://github.com/Icinga/icinga2/issues/5593) (Documentation, PR): Docs: Add a note for upgrading to 2.7
-* [#5583](https://github.com/Icinga/icinga2/issues/5583) (Documentation, PR): Docs: Add example for Windows service monitoring with check\_nscp\_api
-* [#5582](https://github.com/Icinga/icinga2/issues/5582) (Documentation, PR): Docs: Add firewall details for check\_nscp\_api
-* [#5549](https://github.com/Icinga/icinga2/issues/5549) (Documentation, PR): Fix cli command used to enable debuglog feature on windows
-* [#5536](https://github.com/Icinga/icinga2/issues/5536) (Documentation, PR): Fixed nscp-disk service example
-* [#5522](https://github.com/Icinga/icinga2/issues/5522) (Documentation, PR): Docs: Update freshness checks; add chapter for external check results
-* [#5516](https://github.com/Icinga/icinga2/issues/5516) (Documentation, PR): Updates the install dependencies for Debian 9 'stretch'
-* [#5506](https://github.com/Icinga/icinga2/issues/5506) (Documentation, PR): Docs: Fix wrong parameter for ITL CheckCommand nscp\_api
-* [#5496](https://github.com/Icinga/icinga2/issues/5496) (Documentation, PR): Docs: Update examples for match/regex/cidr\_match and mode for arrays \(Match{All,Any}\)
-* [#5494](https://github.com/Icinga/icinga2/issues/5494) (Documentation, PR): Docs: Add section for multiple template imports
-* [#5491](https://github.com/Icinga/icinga2/issues/5491) (Documentation, PR): Update "Getting Started" documentation with Alpine Linux
-* [#5487](https://github.com/Icinga/icinga2/issues/5487) (Documentation, PR): Docs: Enhance Troubleshooting with nscp-local, check\_source, wrong thresholds
-* [#5476](https://github.com/Icinga/icinga2/issues/5476) (Documentation, PR): Docs: Fix ITL chapter TOC; add introduction with mini TOC
-* [#5475](https://github.com/Icinga/icinga2/issues/5475) (Documentation, PR): Docs: Add a note on required configuration updates for new notification scripts in v2.7.0
-* [#5461](https://github.com/Icinga/icinga2/issues/5461) (Documentation, PR): Update Icinga repository release rpm location
-* [#5457](https://github.com/Icinga/icinga2/issues/5457) (Documentation, PR): Add Changelog generation script for GitHub API
-* [#5428](https://github.com/Icinga/icinga2/issues/5428) (Documentation): "Plugin Check Commands" section inside ITL docs needs adjustments
+* [#5594](https://github.com/icinga/icinga2/issues/5594) (Documentation, PR): Docs: Enhance certificate and configuration troubleshooting chapter
+* [#5593](https://github.com/icinga/icinga2/issues/5593) (Documentation, PR): Docs: Add a note for upgrading to 2.7
+* [#5583](https://github.com/icinga/icinga2/issues/5583) (Documentation, PR): Docs: Add example for Windows service monitoring with check\_nscp\_api
+* [#5582](https://github.com/icinga/icinga2/issues/5582) (Documentation, PR): Docs: Add firewall details for check\_nscp\_api
+* [#5549](https://github.com/icinga/icinga2/issues/5549) (Documentation, PR): Fix cli command used to enable debuglog feature on windows
+* [#5536](https://github.com/icinga/icinga2/issues/5536) (Documentation, PR): Fixed nscp-disk service example
+* [#5522](https://github.com/icinga/icinga2/issues/5522) (Documentation, PR): Docs: Update freshness checks; add chapter for external check results
+* [#5516](https://github.com/icinga/icinga2/issues/5516) (Documentation, PR): Updates the install dependencies for Debian 9 'stretch'
+* [#5506](https://github.com/icinga/icinga2/issues/5506) (Documentation, PR): Docs: Fix wrong parameter for ITL CheckCommand nscp\_api
+* [#5496](https://github.com/icinga/icinga2/issues/5496) (Documentation, PR): Docs: Update examples for match/regex/cidr\_match and mode for arrays \(Match{All,Any}\)
+* [#5494](https://github.com/icinga/icinga2/issues/5494) (Documentation, PR): Docs: Add section for multiple template imports
+* [#5491](https://github.com/icinga/icinga2/issues/5491) (Documentation, PR): Update "Getting Started" documentation with Alpine Linux
+* [#5487](https://github.com/icinga/icinga2/issues/5487) (Documentation, PR): Docs: Enhance Troubleshooting with nscp-local, check\_source, wrong thresholds
+* [#5476](https://github.com/icinga/icinga2/issues/5476) (Documentation, PR): Docs: Fix ITL chapter TOC; add introduction with mini TOC
+* [#5475](https://github.com/icinga/icinga2/issues/5475) (Documentation, PR): Docs: Add a note on required configuration updates for new notification scripts in v2.7.0
+* [#5461](https://github.com/icinga/icinga2/issues/5461) (Documentation, PR): Update Icinga repository release rpm location
+* [#5457](https://github.com/icinga/icinga2/issues/5457) (Documentation, PR): Add Changelog generation script for GitHub API
+* [#5428](https://github.com/icinga/icinga2/issues/5428) (Documentation): "Plugin Check Commands" section inside ITL docs needs adjustments
### Support
-* [#5599](https://github.com/Icinga/icinga2/issues/5599) (PR): changelog.py: Add "backported" to the list of ignored labels
-* [#5590](https://github.com/Icinga/icinga2/issues/5590) (Cluster, Log, PR): Silence log level for configuration file updates
-* [#5529](https://github.com/Icinga/icinga2/issues/5529) (Log, PR): Change two more loglines for checkables so checkable is quoted
-* [#5528](https://github.com/Icinga/icinga2/issues/5528) (Log, PR): Change loglines for checkables so checkable is quoted
-* [#5501](https://github.com/Icinga/icinga2/issues/5501) (Installation, Packages, PR): SELinux: fixes for 2.7.0
-* [#5479](https://github.com/Icinga/icinga2/issues/5479) (Packages): Icinga2 2.7.0 requires SELinux boolean icinga2\_can\_connect\_all on CentOS 7 even for default port
-* [#5477](https://github.com/Icinga/icinga2/issues/5477) (Installation, Packages, PR): Systemd: Add DefaultTasksMax=infinity to service file
-* [#5392](https://github.com/Icinga/icinga2/issues/5392) (Packages, PR): Ensure the cache directory exists
-* [#4918](https://github.com/Icinga/icinga2/issues/4918) (Packages): cgroup: fork rejected by pids controller in /system.slice/icinga2.service
-* [#4414](https://github.com/Icinga/icinga2/issues/4414) (Packages): /usr/lib/icinga2/prepare-dirs does not create /var/cache/icinga2
+* [#5599](https://github.com/icinga/icinga2/issues/5599) (PR): changelog.py: Add "backported" to the list of ignored labels
+* [#5590](https://github.com/icinga/icinga2/issues/5590) (Cluster, Log, PR): Silence log level for configuration file updates
+* [#5529](https://github.com/icinga/icinga2/issues/5529) (Log, PR): Change two more loglines for checkables so checkable is quoted
+* [#5528](https://github.com/icinga/icinga2/issues/5528) (Log, PR): Change loglines for checkables so checkable is quoted
+* [#5501](https://github.com/icinga/icinga2/issues/5501) (Installation, Packages, PR): SELinux: fixes for 2.7.0
+* [#5479](https://github.com/icinga/icinga2/issues/5479) (Packages): Icinga2 2.7.0 requires SELinux boolean icinga2\_can\_connect\_all on CentOS 7 even for default port
+* [#5477](https://github.com/icinga/icinga2/issues/5477) (Installation, Packages, PR): Systemd: Add DefaultTasksMax=infinity to service file
+* [#5392](https://github.com/icinga/icinga2/issues/5392) (Packages, PR): Ensure the cache directory exists
+* [#4918](https://github.com/icinga/icinga2/issues/4918) (Packages): cgroup: fork rejected by pids controller in /system.slice/icinga2.service
+* [#4414](https://github.com/icinga/icinga2/issues/4414) (Packages): /usr/lib/icinga2/prepare-dirs does not create /var/cache/icinga2
## 2.7.0 (2017-08-02)
@@ -313,247 +365,247 @@
### Enhancement
-* [#5421](https://github.com/Icinga/icinga2/issues/5421) (Plugins, Windows, PR): Windows Plugins: Add new parameter to check\_disk to show used space
-* [#5348](https://github.com/Icinga/icinga2/issues/5348) (Configuration, PR): Implement support for handling exceptions in user scripts
-* [#5331](https://github.com/Icinga/icinga2/issues/5331) (Graylog, PR): GelfWriter: Add 'check\_command' to CHECK RESULT/\* NOTIFICATION/STATE CHANGE messages
-* [#5330](https://github.com/Icinga/icinga2/issues/5330) (Graphite, PR): GraphiteWriter: Add 'connected' to stats; fix reconnect exceptions
-* [#5329](https://github.com/Icinga/icinga2/issues/5329) (Graylog, PR): GelfWriter: Use async work queue and add feature metric stats
-* [#5320](https://github.com/Icinga/icinga2/issues/5320) (Configuration, PR): zones.conf: Add global-templates & director-global by default
-* [#5287](https://github.com/Icinga/icinga2/issues/5287) (Graphite, InfluxDB, Performance Data, PR): Use workqueues in Graphite and InfluxDB features
-* [#5284](https://github.com/Icinga/icinga2/issues/5284) (Check Execution, PR): Add feature stats to 'icinga' check as performance data metrics
-* [#5280](https://github.com/Icinga/icinga2/issues/5280) (API, Cluster, Log, PR): Implement WorkQueue metric stats and periodic logging
-* [#5266](https://github.com/Icinga/icinga2/issues/5266) (API, Cluster, PR): Add API & Cluster metric stats to /v1/status & icinga check incl. performance data
-* [#5264](https://github.com/Icinga/icinga2/issues/5264) (Configuration, PR): Implement new array match functionality
-* [#5247](https://github.com/Icinga/icinga2/issues/5247) (Log, PR): Add target object in cluster error messages to debug log
-* [#5246](https://github.com/Icinga/icinga2/issues/5246) (API, Cluster, PR): Add subjectAltName X509 ext for certificate requests
-* [#5242](https://github.com/Icinga/icinga2/issues/5242) (Configuration, PR): Allow expressions for the type in object/template declarations
-* [#5241](https://github.com/Icinga/icinga2/issues/5241) (InfluxDB, PR): Verbose InfluxDB Error Logging
-* [#5239](https://github.com/Icinga/icinga2/issues/5239) (Plugins, Windows, PR): Add NSCP API check plugin for NSClient++ HTTP API
-* [#5212](https://github.com/Icinga/icinga2/issues/5212) (Cluster, Log): Add additional logging for config sync
-* [#5145](https://github.com/Icinga/icinga2/issues/5145): Add a GitHub issue template
-* [#5133](https://github.com/Icinga/icinga2/issues/5133) (API, wishlist): ApiListener: Metrics for cluster data
-* [#5106](https://github.com/Icinga/icinga2/issues/5106) (Configuration): Add director-global as global zone to the default zones.conf configuration
-* [#4945](https://github.com/Icinga/icinga2/issues/4945) (API, Log): No hint for missing permissions in Icinga2 log for API user
-* [#4925](https://github.com/Icinga/icinga2/issues/4925): Update changelog generation scripts for GitHub
-* [#4411](https://github.com/Icinga/icinga2/issues/4411) (InfluxDB, Log, Performance Data): Better Debugging for InfluxdbWriter
-* [#4288](https://github.com/Icinga/icinga2/issues/4288) (Cluster, Log): Add check information to the debuglog when check result is discarded
-* [#4242](https://github.com/Icinga/icinga2/issues/4242) (Configuration): Default mail notification from header
-* [#3557](https://github.com/Icinga/icinga2/issues/3557) (Log): Log started and stopped features
+* [#5421](https://github.com/icinga/icinga2/issues/5421) (Plugins, Windows, PR): Windows Plugins: Add new parameter to check\_disk to show used space
+* [#5348](https://github.com/icinga/icinga2/issues/5348) (Configuration, PR): Implement support for handling exceptions in user scripts
+* [#5331](https://github.com/icinga/icinga2/issues/5331) (Graylog, PR): GelfWriter: Add 'check\_command' to CHECK RESULT/\* NOTIFICATION/STATE CHANGE messages
+* [#5330](https://github.com/icinga/icinga2/issues/5330) (Graphite, PR): GraphiteWriter: Add 'connected' to stats; fix reconnect exceptions
+* [#5329](https://github.com/icinga/icinga2/issues/5329) (Graylog, PR): GelfWriter: Use async work queue and add feature metric stats
+* [#5320](https://github.com/icinga/icinga2/issues/5320) (Configuration, PR): zones.conf: Add global-templates & director-global by default
+* [#5287](https://github.com/icinga/icinga2/issues/5287) (Graphite, InfluxDB, Metrics, PR): Use workqueues in Graphite and InfluxDB features
+* [#5284](https://github.com/icinga/icinga2/issues/5284) (Check Execution, PR): Add feature stats to 'icinga' check as performance data metrics
+* [#5280](https://github.com/icinga/icinga2/issues/5280) (API, Cluster, Log, PR): Implement WorkQueue metric stats and periodic logging
+* [#5266](https://github.com/icinga/icinga2/issues/5266) (API, Cluster, PR): Add API & Cluster metric stats to /v1/status & icinga check incl. performance data
+* [#5264](https://github.com/icinga/icinga2/issues/5264) (Configuration, PR): Implement new array match functionality
+* [#5247](https://github.com/icinga/icinga2/issues/5247) (Log, PR): Add target object in cluster error messages to debug log
+* [#5246](https://github.com/icinga/icinga2/issues/5246) (API, Cluster, PR): Add subjectAltName X509 ext for certificate requests
+* [#5242](https://github.com/icinga/icinga2/issues/5242) (Configuration, PR): Allow expressions for the type in object/template declarations
+* [#5241](https://github.com/icinga/icinga2/issues/5241) (InfluxDB, PR): Verbose InfluxDB Error Logging
+* [#5239](https://github.com/icinga/icinga2/issues/5239) (Plugins, Windows, PR): Add NSCP API check plugin for NSClient++ HTTP API
+* [#5212](https://github.com/icinga/icinga2/issues/5212) (Cluster, Log): Add additional logging for config sync
+* [#5145](https://github.com/icinga/icinga2/issues/5145): Add a GitHub issue template
+* [#5133](https://github.com/icinga/icinga2/issues/5133) (API, wishlist): ApiListener: Metrics for cluster data
+* [#5106](https://github.com/icinga/icinga2/issues/5106) (Configuration): Add director-global as global zone to the default zones.conf configuration
+* [#4945](https://github.com/icinga/icinga2/issues/4945) (API, Log): No hint for missing permissions in Icinga2 log for API user
+* [#4925](https://github.com/icinga/icinga2/issues/4925): Update changelog generation scripts for GitHub
+* [#4411](https://github.com/icinga/icinga2/issues/4411) (InfluxDB, Log, Metrics): Better Debugging for InfluxdbWriter
+* [#4288](https://github.com/icinga/icinga2/issues/4288) (Cluster, Log): Add check information to the debuglog when check result is discarded
+* [#4242](https://github.com/icinga/icinga2/issues/4242) (Configuration): Default mail notification from header
+* [#3557](https://github.com/icinga/icinga2/issues/3557) (Log): Log started and stopped features
### Bug
-* [#5433](https://github.com/Icinga/icinga2/issues/5433) (CLI, PR): Fix: update feature list help text
-* [#5367](https://github.com/Icinga/icinga2/issues/5367) (CLI, Crash): Unable to start icinga2 with kernel-3.10.0-514.21.2 RHEL7
-* [#5350](https://github.com/Icinga/icinga2/issues/5350) (Plugins): check\_nscp\_api not building on Debian wheezy
-* [#5316](https://github.com/Icinga/icinga2/issues/5316) (Livestatus, PR): Fix for stats min operator
-* [#5308](https://github.com/Icinga/icinga2/issues/5308) (Configuration, PR): Improve validation for attributes which must not be 'null'
-* [#5297](https://github.com/Icinga/icinga2/issues/5297) (PR): Fix compiler warnings
-* [#5295](https://github.com/Icinga/icinga2/issues/5295) (Notifications, PR): Fix missing apostrophe in notification log
-* [#5292](https://github.com/Icinga/icinga2/issues/5292) (PR): Build fix for OpenSSL 0.9.8 and stack\_st\_X509\_EXTENSION
-* [#5288](https://github.com/Icinga/icinga2/issues/5288) (Configuration): Hostgroup using assign for Host with groups = null segfault
-* [#5278](https://github.com/Icinga/icinga2/issues/5278) (PR): Build fix for I2\_LEAK\_DEBUG
-* [#5262](https://github.com/Icinga/icinga2/issues/5262) (Graylog, PR): Fix performance data processing in GelfWriter feature
-* [#5259](https://github.com/Icinga/icinga2/issues/5259) (API, PR): Don't allow acknowledgement expire timestamps in the past
-* [#5256](https://github.com/Icinga/icinga2/issues/5256) (Configuration): Config type changes break object serialization \(JsonEncode\)
-* [#5250](https://github.com/Icinga/icinga2/issues/5250) (API, Compat): Acknowledgement expire time in the past
-* [#5245](https://github.com/Icinga/icinga2/issues/5245) (Notifications, PR): Fix that host downtimes might be triggered even if their state is Up
-* [#5224](https://github.com/Icinga/icinga2/issues/5224) (Configuration, Notifications): Icinga sends notifications even though a Downtime object exists
-* [#5223](https://github.com/Icinga/icinga2/issues/5223) (Plugins, Windows): Wrong return Code for Windows ICMP
-* [#5219](https://github.com/Icinga/icinga2/issues/5219) (InfluxDB): InfluxDBWriter feature might block and leak memory
-* [#5211](https://github.com/Icinga/icinga2/issues/5211) (API, Cluster): Config received is always accepted by client even if own config is newer
-* [#5194](https://github.com/Icinga/icinga2/issues/5194) (API, CLI): No subjectAltName in Icinga CA created CSRs
-* [#5168](https://github.com/Icinga/icinga2/issues/5168) (Windows): include files from other volume/partition
-* [#5146](https://github.com/Icinga/icinga2/issues/5146) (Configuration): parsing of scheduled downtime object allow typing range instead of ranges
-* [#5132](https://github.com/Icinga/icinga2/issues/5132) (Graphite): GraphiteWriter can slow down Icinga's check result processing
-* [#5062](https://github.com/Icinga/icinga2/issues/5062) (Compat): icinga2 checkresults error
-* [#5043](https://github.com/Icinga/icinga2/issues/5043) (API): API POST request with 'attrs' as array returns bad\_cast error
-* [#5040](https://github.com/Icinga/icinga2/issues/5040) (Cluster): CRL loading fails due to incorrect return code check
-* [#5033](https://github.com/Icinga/icinga2/issues/5033) (DB IDO): Flexible downtimes which are not triggered must not update DB IDO's actual\_end\_time in downtimehistory table
-* [#4984](https://github.com/Icinga/icinga2/issues/4984) (API): Wrong response type when unauthorized
-* [#4983](https://github.com/Icinga/icinga2/issues/4983) (Livestatus): Typo in livestatus key worst\_services\_state for hostgroups table
-* [#4956](https://github.com/Icinga/icinga2/issues/4956) (DB IDO, PR): Fix persistent comments for Acknowledgements
-* [#4941](https://github.com/Icinga/icinga2/issues/4941) (Performance Data, PR): PerfData: Server Timeouts for InfluxDB Writer
-* [#4927](https://github.com/Icinga/icinga2/issues/4927) (InfluxDB, Performance Data): InfluxDbWriter error 500 hanging Icinga daemon
-* [#4913](https://github.com/Icinga/icinga2/issues/4913) (API): acknowledge-problem api sending notifications when notify is false
-* [#4909](https://github.com/Icinga/icinga2/issues/4909) (CLI): icinga2 feature disable fails on already disabled feature
-* [#4896](https://github.com/Icinga/icinga2/issues/4896) (Plugins): Windows Agent: performance data of check\_perfmon
-* [#4832](https://github.com/Icinga/icinga2/issues/4832) (API, Configuration): API max\_check\_attempts validation
-* [#4818](https://github.com/Icinga/icinga2/issues/4818): Acknowledgements marked with Persistent Comment are not honored
-* [#4779](https://github.com/Icinga/icinga2/issues/4779): Superflous error messages for non-exisiting lsb\_release/sw\_vers commands \(on NetBSD\)
-* [#4778](https://github.com/Icinga/icinga2/issues/4778): Fix for traditional glob\(3\) behaviour
-* [#4777](https://github.com/Icinga/icinga2/issues/4777): NetBSD execvpe.c fix
-* [#4709](https://github.com/Icinga/icinga2/issues/4709) (API): Posting config stage fails on FreeBSD
-* [#4696](https://github.com/Icinga/icinga2/issues/4696) (Notifications): Notifications are sent when reloading Icinga 2 even though they're deactivated via modified attributes
-* [#4666](https://github.com/Icinga/icinga2/issues/4666) (Graylog, Performance Data): GelfWriter with enable\_send\_perfdata breaks checks
-* [#4532](https://github.com/Icinga/icinga2/issues/4532) (Graylog, Performance Data): Icinga 2 "hangs" if the GelfWriter cannot send messages
-* [#4440](https://github.com/Icinga/icinga2/issues/4440) (DB IDO, Log): Exceptions might be better than exit in IDO
-* [#3664](https://github.com/Icinga/icinga2/issues/3664) (DB IDO): mysql\_error cannot be used for mysql\_init
-* [#3483](https://github.com/Icinga/icinga2/issues/3483) (Compat): Stacktrace on Command Pipe Error
-* [#3410](https://github.com/Icinga/icinga2/issues/3410) (Livestatus): Livestatus: Problem with stats min operator
-* [#121](https://github.com/Icinga/icinga2/issues/121) (CLI, PR): give only warnings if feature is already disabled
+* [#5433](https://github.com/icinga/icinga2/issues/5433) (CLI, PR): Fix: update feature list help text
+* [#5367](https://github.com/icinga/icinga2/issues/5367) (CLI, Crash): Unable to start icinga2 with kernel-3.10.0-514.21.2 RHEL7
+* [#5350](https://github.com/icinga/icinga2/issues/5350) (Plugins): check\_nscp\_api not building on Debian wheezy
+* [#5316](https://github.com/icinga/icinga2/issues/5316) (Livestatus, PR): Fix for stats min operator
+* [#5308](https://github.com/icinga/icinga2/issues/5308) (Configuration, PR): Improve validation for attributes which must not be 'null'
+* [#5297](https://github.com/icinga/icinga2/issues/5297) (PR): Fix compiler warnings
+* [#5295](https://github.com/icinga/icinga2/issues/5295) (Notifications, PR): Fix missing apostrophe in notification log
+* [#5292](https://github.com/icinga/icinga2/issues/5292) (PR): Build fix for OpenSSL 0.9.8 and stack\_st\_X509\_EXTENSION
+* [#5288](https://github.com/icinga/icinga2/issues/5288) (Configuration): Hostgroup using assign for Host with groups = null segfault
+* [#5278](https://github.com/icinga/icinga2/issues/5278) (PR): Build fix for I2\_LEAK\_DEBUG
+* [#5262](https://github.com/icinga/icinga2/issues/5262) (Graylog, PR): Fix performance data processing in GelfWriter feature
+* [#5259](https://github.com/icinga/icinga2/issues/5259) (API, PR): Don't allow acknowledgement expire timestamps in the past
+* [#5256](https://github.com/icinga/icinga2/issues/5256) (Configuration): Config type changes break object serialization \(JsonEncode\)
+* [#5250](https://github.com/icinga/icinga2/issues/5250) (API, Compat): Acknowledgement expire time in the past
+* [#5245](https://github.com/icinga/icinga2/issues/5245) (Notifications, PR): Fix that host downtimes might be triggered even if their state is Up
+* [#5224](https://github.com/icinga/icinga2/issues/5224) (Configuration, Notifications): Icinga sends notifications even though a Downtime object exists
+* [#5223](https://github.com/icinga/icinga2/issues/5223) (Plugins, Windows): Wrong return Code for Windows ICMP
+* [#5219](https://github.com/icinga/icinga2/issues/5219) (InfluxDB): InfluxDBWriter feature might block and leak memory
+* [#5211](https://github.com/icinga/icinga2/issues/5211) (API, Cluster): Config received is always accepted by client even if own config is newer
+* [#5194](https://github.com/icinga/icinga2/issues/5194) (API, CLI): No subjectAltName in Icinga CA created CSRs
+* [#5168](https://github.com/icinga/icinga2/issues/5168) (Windows): include files from other volume/partition
+* [#5146](https://github.com/icinga/icinga2/issues/5146) (Configuration): parsing of scheduled downtime object allow typing range instead of ranges
+* [#5132](https://github.com/icinga/icinga2/issues/5132) (Graphite): GraphiteWriter can slow down Icinga's check result processing
+* [#5062](https://github.com/icinga/icinga2/issues/5062) (Compat): icinga2 checkresults error
+* [#5043](https://github.com/icinga/icinga2/issues/5043) (API): API POST request with 'attrs' as array returns bad\_cast error
+* [#5040](https://github.com/icinga/icinga2/issues/5040) (Cluster): CRL loading fails due to incorrect return code check
+* [#5033](https://github.com/icinga/icinga2/issues/5033) (DB IDO): Flexible downtimes which are not triggered must not update DB IDO's actual\_end\_time in downtimehistory table
+* [#4984](https://github.com/icinga/icinga2/issues/4984) (API): Wrong response type when unauthorized
+* [#4983](https://github.com/icinga/icinga2/issues/4983) (Livestatus): Typo in livestatus key worst\_services\_state for hostgroups table
+* [#4956](https://github.com/icinga/icinga2/issues/4956) (DB IDO, PR): Fix persistent comments for Acknowledgements
+* [#4941](https://github.com/icinga/icinga2/issues/4941) (Metrics, PR): PerfData: Server Timeouts for InfluxDB Writer
+* [#4927](https://github.com/icinga/icinga2/issues/4927) (InfluxDB, Metrics): InfluxDbWriter error 500 hanging Icinga daemon
+* [#4913](https://github.com/icinga/icinga2/issues/4913) (API): acknowledge-problem api sending notifications when notify is false
+* [#4909](https://github.com/icinga/icinga2/issues/4909) (CLI): icinga2 feature disable fails on already disabled feature
+* [#4896](https://github.com/icinga/icinga2/issues/4896) (Plugins): Windows Agent: performance data of check\_perfmon
+* [#4832](https://github.com/icinga/icinga2/issues/4832) (API, Configuration): API max\_check\_attempts validation
+* [#4818](https://github.com/icinga/icinga2/issues/4818): Acknowledgements marked with Persistent Comment are not honored
+* [#4779](https://github.com/icinga/icinga2/issues/4779): Superflous error messages for non-exisiting lsb\_release/sw\_vers commands \(on NetBSD\)
+* [#4778](https://github.com/icinga/icinga2/issues/4778): Fix for traditional glob\(3\) behaviour
+* [#4777](https://github.com/icinga/icinga2/issues/4777): NetBSD execvpe.c fix
+* [#4709](https://github.com/icinga/icinga2/issues/4709) (API): Posting config stage fails on FreeBSD
+* [#4696](https://github.com/icinga/icinga2/issues/4696) (Notifications): Notifications are sent when reloading Icinga 2 even though they're deactivated via modified attributes
+* [#4666](https://github.com/icinga/icinga2/issues/4666) (Graylog, Metrics): GelfWriter with enable\_send\_perfdata breaks checks
+* [#4532](https://github.com/icinga/icinga2/issues/4532) (Graylog, Metrics): Icinga 2 "hangs" if the GelfWriter cannot send messages
+* [#4440](https://github.com/icinga/icinga2/issues/4440) (DB IDO, Log): Exceptions might be better than exit in IDO
+* [#3664](https://github.com/icinga/icinga2/issues/3664) (DB IDO): mysql\_error cannot be used for mysql\_init
+* [#3483](https://github.com/icinga/icinga2/issues/3483) (Compat): Stacktrace on Command Pipe Error
+* [#3410](https://github.com/icinga/icinga2/issues/3410) (Livestatus): Livestatus: Problem with stats min operator
+* [#121](https://github.com/icinga/icinga2/issues/121) (CLI, PR): give only warnings if feature is already disabled
### ITL
-* [#5384](https://github.com/Icinga/icinga2/issues/5384) (ITL, PR): Remove default value for 'dns\_query\_type'
-* [#5383](https://github.com/Icinga/icinga2/issues/5383) (ITL): Monitoring-Plugins check\_dns command does not support the `-q` flag
-* [#5372](https://github.com/Icinga/icinga2/issues/5372) (ITL, PR): Update ITL CheckCommand description attribute, part 2
-* [#5363](https://github.com/Icinga/icinga2/issues/5363) (ITL, PR): Update missing description attributes for ITL CheckCommand definitions
-* [#5347](https://github.com/Icinga/icinga2/issues/5347) (ITL, PR): Improve ITL CheckCommand description attribute
-* [#5344](https://github.com/Icinga/icinga2/issues/5344) (ITL, PR): Add ip4-or-ipv6 import to logstash ITL command
-* [#5343](https://github.com/Icinga/icinga2/issues/5343) (ITL): logstash ITL command misses import
-* [#5236](https://github.com/Icinga/icinga2/issues/5236) (ITL, PR): ITL: Add some missing arguments to ssl\_cert
-* [#5210](https://github.com/Icinga/icinga2/issues/5210) (ITL, PR): Add report mode to db2\_health
-* [#5170](https://github.com/Icinga/icinga2/issues/5170) (ITL, PR): Enhance mail notifications scripts and add support for command line parameters
-* [#5139](https://github.com/Icinga/icinga2/issues/5139) (ITL, PR): Add more options to ldap CheckCommand
-* [#5129](https://github.com/Icinga/icinga2/issues/5129) (ITL): Additional parameters for perfout manubulon scripts
-* [#5126](https://github.com/Icinga/icinga2/issues/5126) (ITL, PR): Added support to NRPE v2 in NRPE CheckCommand
-* [#5075](https://github.com/Icinga/icinga2/issues/5075) (ITL, PR): fix mitigation for nwc\_health
-* [#5063](https://github.com/Icinga/icinga2/issues/5063) (ITL, PR): Add additional arguments to mssql\_health
-* [#5046](https://github.com/Icinga/icinga2/issues/5046) (ITL): Add querytype to dns check
-* [#5019](https://github.com/Icinga/icinga2/issues/5019) (ITL, PR): Added CheckCommand definitions for SMART, RAID controller and IPMI ping check
-* [#5015](https://github.com/Icinga/icinga2/issues/5015) (ITL, PR): nwc\_health\_report attribute requires a value
-* [#4987](https://github.com/Icinga/icinga2/issues/4987) (ITL): Review `dummy` entry in ITL
-* [#4985](https://github.com/Icinga/icinga2/issues/4985) (ITL): Allow hpasm command from ITL to run in local mode
-* [#4964](https://github.com/Icinga/icinga2/issues/4964) (ITL, PR): ITL: check\_icmp: add missing TTL attribute
-* [#4839](https://github.com/Icinga/icinga2/issues/4839) (ITL): Remove deprecated dns\_expected\_answer attribute
-* [#4826](https://github.com/Icinga/icinga2/issues/4826) (ITL): Prepare icingacli-businessprocess for next release
-* [#4661](https://github.com/Icinga/icinga2/issues/4661) (ITL): ITL - check\_oracle\_health - report option to shorten output
-* [#124](https://github.com/Icinga/icinga2/issues/124) (ITL, PR): FreeBSD's /dev/fd can either be inside devfs, or be of type fdescfs.
-* [#123](https://github.com/Icinga/icinga2/issues/123) (ITL, PR): ITL: Update ipmi CheckCommand attributes
-* [#120](https://github.com/Icinga/icinga2/issues/120) (ITL, PR): Add new parameter for check\_http: -L: Wrap output in HTML link
-* [#117](https://github.com/Icinga/icinga2/issues/117) (ITL, PR): Support --only-critical for check\_apt
-* [#115](https://github.com/Icinga/icinga2/issues/115) (ITL, PR): Inverse Interface Switch for snmp-interface
-* [#114](https://github.com/Icinga/icinga2/issues/114) (ITL, PR): Adding -A to snmp interfaces check
+* [#5384](https://github.com/icinga/icinga2/issues/5384) (ITL, PR): Remove default value for 'dns\_query\_type'
+* [#5383](https://github.com/icinga/icinga2/issues/5383) (ITL): Monitoring-Plugins check\_dns command does not support the `-q` flag
+* [#5372](https://github.com/icinga/icinga2/issues/5372) (ITL, PR): Update ITL CheckCommand description attribute, part 2
+* [#5363](https://github.com/icinga/icinga2/issues/5363) (ITL, PR): Update missing description attributes for ITL CheckCommand definitions
+* [#5347](https://github.com/icinga/icinga2/issues/5347) (ITL, PR): Improve ITL CheckCommand description attribute
+* [#5344](https://github.com/icinga/icinga2/issues/5344) (ITL, PR): Add ip4-or-ipv6 import to logstash ITL command
+* [#5343](https://github.com/icinga/icinga2/issues/5343) (ITL): logstash ITL command misses import
+* [#5236](https://github.com/icinga/icinga2/issues/5236) (ITL, PR): ITL: Add some missing arguments to ssl\_cert
+* [#5210](https://github.com/icinga/icinga2/issues/5210) (ITL, PR): Add report mode to db2\_health
+* [#5170](https://github.com/icinga/icinga2/issues/5170) (ITL, PR): Enhance mail notifications scripts and add support for command line parameters
+* [#5139](https://github.com/icinga/icinga2/issues/5139) (ITL, PR): Add more options to ldap CheckCommand
+* [#5129](https://github.com/icinga/icinga2/issues/5129) (ITL): Additional parameters for perfout manubulon scripts
+* [#5126](https://github.com/icinga/icinga2/issues/5126) (ITL, PR): Added support to NRPE v2 in NRPE CheckCommand
+* [#5075](https://github.com/icinga/icinga2/issues/5075) (ITL, PR): fix mitigation for nwc\_health
+* [#5063](https://github.com/icinga/icinga2/issues/5063) (ITL, PR): Add additional arguments to mssql\_health
+* [#5046](https://github.com/icinga/icinga2/issues/5046) (ITL): Add querytype to dns check
+* [#5019](https://github.com/icinga/icinga2/issues/5019) (ITL, PR): Added CheckCommand definitions for SMART, RAID controller and IPMI ping check
+* [#5015](https://github.com/icinga/icinga2/issues/5015) (ITL, PR): nwc\_health\_report attribute requires a value
+* [#4987](https://github.com/icinga/icinga2/issues/4987) (ITL): Review `dummy` entry in ITL
+* [#4985](https://github.com/icinga/icinga2/issues/4985) (ITL): Allow hpasm command from ITL to run in local mode
+* [#4964](https://github.com/icinga/icinga2/issues/4964) (ITL, PR): ITL: check\_icmp: add missing TTL attribute
+* [#4839](https://github.com/icinga/icinga2/issues/4839) (ITL): Remove deprecated dns\_expected\_answer attribute
+* [#4826](https://github.com/icinga/icinga2/issues/4826) (ITL): Prepare icingacli-businessprocess for next release
+* [#4661](https://github.com/icinga/icinga2/issues/4661) (ITL): ITL - check\_oracle\_health - report option to shorten output
+* [#124](https://github.com/icinga/icinga2/issues/124) (ITL, PR): FreeBSD's /dev/fd can either be inside devfs, or be of type fdescfs.
+* [#123](https://github.com/icinga/icinga2/issues/123) (ITL, PR): ITL: Update ipmi CheckCommand attributes
+* [#120](https://github.com/icinga/icinga2/issues/120) (ITL, PR): Add new parameter for check\_http: -L: Wrap output in HTML link
+* [#117](https://github.com/icinga/icinga2/issues/117) (ITL, PR): Support --only-critical for check\_apt
+* [#115](https://github.com/icinga/icinga2/issues/115) (ITL, PR): Inverse Interface Switch for snmp-interface
+* [#114](https://github.com/icinga/icinga2/issues/114) (ITL, PR): Adding -A to snmp interfaces check
### Documentation
-* [#5448](https://github.com/Icinga/icinga2/issues/5448) (Documentation, PR): Update documentation for 2.7.0
-* [#5440](https://github.com/Icinga/icinga2/issues/5440) (Documentation, PR): Add missing notification state filter to documentation
-* [#5425](https://github.com/Icinga/icinga2/issues/5425) (Documentation, PR): Fix formatting in API docs
-* [#5410](https://github.com/Icinga/icinga2/issues/5410) (Documentation): Update docs for better compatibility with mkdocs
-* [#5393](https://github.com/Icinga/icinga2/issues/5393) (Documentation, PR): Fix typo in the documentation
-* [#5378](https://github.com/Icinga/icinga2/issues/5378) (Documentation, PR): Fixed warnings when using mkdocs
-* [#5370](https://github.com/Icinga/icinga2/issues/5370) (Documentation, PR): Rename ChangeLog to CHANGELOG.md
-* [#5366](https://github.com/Icinga/icinga2/issues/5366) (Documentation, PR): Fixed wrong node in documentation chapter Client/Satellite Linux Setup
-* [#5365](https://github.com/Icinga/icinga2/issues/5365) (Documentation, PR): Update package documentation for Debian Stretch
-* [#5358](https://github.com/Icinga/icinga2/issues/5358) (Documentation, PR): Add documentation for securing mysql on Debian/Ubuntu.
-* [#5357](https://github.com/Icinga/icinga2/issues/5357) (Documentation, Notifications, PR): Notification Scripts: Ensure that mail from address works on Debian/RHEL/SUSE \(mailutils vs mailx\)
-* [#5354](https://github.com/Icinga/icinga2/issues/5354) (Documentation, PR): Docs: Fix built-in template description and URLs
-* [#5349](https://github.com/Icinga/icinga2/issues/5349) (Documentation, PR): Docs: Fix broken format for notes/tips in CLI command chapter
-* [#5339](https://github.com/Icinga/icinga2/issues/5339) (Documentation, ITL, PR): Add accept\_cname to dns CheckCommand
-* [#5336](https://github.com/Icinga/icinga2/issues/5336) (Documentation, PR): Docs: Fix formatting issues and broken URLs
-* [#5333](https://github.com/Icinga/icinga2/issues/5333) (Documentation, PR): Update documentation for enhanced notification scripts
-* [#5324](https://github.com/Icinga/icinga2/issues/5324) (Documentation, PR): Fix phrasing in Getting Started chapter
-* [#5317](https://github.com/Icinga/icinga2/issues/5317) (Documentation, PR): Fix typo in INSTALL.md
-* [#5315](https://github.com/Icinga/icinga2/issues/5315) (Documentation, PR): Docs: Replace nagios-plugins by monitoring-plugins for Debian/Ubuntu
-* [#5314](https://github.com/Icinga/icinga2/issues/5314) (Documentation, PR): Document Common name \(CN\) in client setup
-* [#5309](https://github.com/Icinga/icinga2/issues/5309) (Documentation, PR): Docs: Replace the command pipe w/ the REST API as Icinga Web 2 requirement in 'Getting Started' chapter
-* [#5291](https://github.com/Icinga/icinga2/issues/5291) (Documentation): Update docs for RHEL/CentOS 5 EOL
-* [#5285](https://github.com/Icinga/icinga2/issues/5285) (Documentation, PR): Fix sysstat installation in troubleshooting docs
-* [#5279](https://github.com/Icinga/icinga2/issues/5279) (Documentation, PR): Docs: Add API query example for acknowledgements w/o expire time
-* [#5275](https://github.com/Icinga/icinga2/issues/5275) (Documentation, PR): Add troubleshooting hints for cgroup fork errors
-* [#5244](https://github.com/Icinga/icinga2/issues/5244) (Documentation, PR): Add a PR review section to CONTRIBUTING.md
-* [#5237](https://github.com/Icinga/icinga2/issues/5237) (Documentation, PR): Docs: Add a note for Windows debuglog to the troubleshooting chapter
-* [#5227](https://github.com/Icinga/icinga2/issues/5227) (Documentation, ITL, PR): feature/itl-vmware-esx-storage-path-standbyok
-* [#5216](https://github.com/Icinga/icinga2/issues/5216) (Documentation, PR): Remove "... is is ..." in CONTRIBUTING.md
-* [#5206](https://github.com/Icinga/icinga2/issues/5206) (Documentation): Typo in Getting Started Guide
-* [#5203](https://github.com/Icinga/icinga2/issues/5203) (Documentation, PR): Fix typo in Getting Started chapter
-* [#5184](https://github.com/Icinga/icinga2/issues/5184) (Documentation, PR): Doc/appendix: fix malformed markdown links
-* [#5181](https://github.com/Icinga/icinga2/issues/5181) (Documentation, PR): List SELinux packages required for building RPMs
-* [#5178](https://github.com/Icinga/icinga2/issues/5178) (Documentation, Windows): Documentation vague on "update-windows" check plugin
-* [#5175](https://github.com/Icinga/icinga2/issues/5175) (Documentation): Add a note about flapping problems to the docs
-* [#5174](https://github.com/Icinga/icinga2/issues/5174) (Documentation, PR): Add missing object type to Apply Rules doc example
-* [#5173](https://github.com/Icinga/icinga2/issues/5173) (Documentation): Object type missing from ping Service example in docs
-* [#5167](https://github.com/Icinga/icinga2/issues/5167) (Documentation): Add more assign where expression examples
-* [#5166](https://github.com/Icinga/icinga2/issues/5166) (API, Documentation): Set zone attribute to no\_user\_modify for API POST requests
-* [#5165](https://github.com/Icinga/icinga2/issues/5165) (Documentation, PR): Syntax error In Dependencies chapter
-* [#5164](https://github.com/Icinga/icinga2/issues/5164) (Documentation, ITL, PR): ITL: Add CheckCommand ssl\_cert, fix ssl attributes
-* [#5161](https://github.com/Icinga/icinga2/issues/5161) (Documentation, PR): ITL documentation - disk-windows usage note with % thresholds
-* [#5157](https://github.com/Icinga/icinga2/issues/5157) (Documentation): "Three Levels with master, Satellites, and Clients" chapter is not clear about client config
-* [#5156](https://github.com/Icinga/icinga2/issues/5156) (Documentation): Add CONTRIBUTING.md
-* [#5155](https://github.com/Icinga/icinga2/issues/5155) (Documentation): 3.5. Apply Rules topic in the docs needs work.
-* [#5151](https://github.com/Icinga/icinga2/issues/5151) (Documentation, PR): Replace http:// links with https:// links where a secure website exists
-* [#5150](https://github.com/Icinga/icinga2/issues/5150) (Documentation): Invalid links in documentation
-* [#5149](https://github.com/Icinga/icinga2/issues/5149) (Documentation, PR): Update documentation, change http:// links to https:// links where a website exists
-* [#5144](https://github.com/Icinga/icinga2/issues/5144) (Documentation): Extend troubleshooting docs w/ environment analysis and common tools
-* [#5143](https://github.com/Icinga/icinga2/issues/5143) (Documentation): Docs: Explain how to include your own config tree instead of conf.d
-* [#5142](https://github.com/Icinga/icinga2/issues/5142) (Documentation): Add an Elastic Stack Integrations chapter to feature documentation
-* [#5140](https://github.com/Icinga/icinga2/issues/5140) (Documentation): Documentation should explain that runtime modifications are not immediately updated for "object list"
-* [#5137](https://github.com/Icinga/icinga2/issues/5137) (Documentation): Doc updates: Getting Started w/ own config, Troubleshooting w/ debug console
-* [#5111](https://github.com/Icinga/icinga2/issues/5111) (Documentation): Fix duration attribute requirement for schedule-downtime API action
-* [#5104](https://github.com/Icinga/icinga2/issues/5104) (Documentation, PR): Correct link to nscp documentation
-* [#5097](https://github.com/Icinga/icinga2/issues/5097) (Documentation): The last example for typeof\(\) is missing the result
-* [#5090](https://github.com/Icinga/icinga2/issues/5090) (Cluster, Documentation): EventHandler to be executed at the endpoint
-* [#5077](https://github.com/Icinga/icinga2/issues/5077) (Documentation): Replace the 'command' feature w/ the REST API for Icinga Web 2
-* [#5016](https://github.com/Icinga/icinga2/issues/5016) (Documentation, ITL, PR): Add fuse.gvfs-fuse-daemon to disk\_exclude\_type
-* [#5010](https://github.com/Icinga/icinga2/issues/5010) (Documentation): \[Documentation\] Missing parameter for SNMPv3 auth
-* [#3560](https://github.com/Icinga/icinga2/issues/3560) (Documentation): Explain check\_memorys and check\_disks thresholds
-* [#1880](https://github.com/Icinga/icinga2/issues/1880) (Documentation): add a section for 'monitoring the icinga2 node'
+* [#5448](https://github.com/icinga/icinga2/issues/5448) (Documentation, PR): Update documentation for 2.7.0
+* [#5440](https://github.com/icinga/icinga2/issues/5440) (Documentation, PR): Add missing notification state filter to documentation
+* [#5425](https://github.com/icinga/icinga2/issues/5425) (Documentation, PR): Fix formatting in API docs
+* [#5410](https://github.com/icinga/icinga2/issues/5410) (Documentation): Update docs for better compatibility with mkdocs
+* [#5393](https://github.com/icinga/icinga2/issues/5393) (Documentation, PR): Fix typo in the documentation
+* [#5378](https://github.com/icinga/icinga2/issues/5378) (Documentation, PR): Fixed warnings when using mkdocs
+* [#5370](https://github.com/icinga/icinga2/issues/5370) (Documentation, PR): Rename ChangeLog to CHANGELOG.md
+* [#5366](https://github.com/icinga/icinga2/issues/5366) (Documentation, PR): Fixed wrong node in documentation chapter Client/Satellite Linux Setup
+* [#5365](https://github.com/icinga/icinga2/issues/5365) (Documentation, PR): Update package documentation for Debian Stretch
+* [#5358](https://github.com/icinga/icinga2/issues/5358) (Documentation, PR): Add documentation for securing mysql on Debian/Ubuntu.
+* [#5357](https://github.com/icinga/icinga2/issues/5357) (Documentation, Notifications, PR): Notification Scripts: Ensure that mail from address works on Debian/RHEL/SUSE \(mailutils vs mailx\)
+* [#5354](https://github.com/icinga/icinga2/issues/5354) (Documentation, PR): Docs: Fix built-in template description and URLs
+* [#5349](https://github.com/icinga/icinga2/issues/5349) (Documentation, PR): Docs: Fix broken format for notes/tips in CLI command chapter
+* [#5339](https://github.com/icinga/icinga2/issues/5339) (Documentation, ITL, PR): Add accept\_cname to dns CheckCommand
+* [#5336](https://github.com/icinga/icinga2/issues/5336) (Documentation, PR): Docs: Fix formatting issues and broken URLs
+* [#5333](https://github.com/icinga/icinga2/issues/5333) (Documentation, PR): Update documentation for enhanced notification scripts
+* [#5324](https://github.com/icinga/icinga2/issues/5324) (Documentation, PR): Fix phrasing in Getting Started chapter
+* [#5317](https://github.com/icinga/icinga2/issues/5317) (Documentation, PR): Fix typo in INSTALL.md
+* [#5315](https://github.com/icinga/icinga2/issues/5315) (Documentation, PR): Docs: Replace nagios-plugins by monitoring-plugins for Debian/Ubuntu
+* [#5314](https://github.com/icinga/icinga2/issues/5314) (Documentation, PR): Document Common name \(CN\) in client setup
+* [#5309](https://github.com/icinga/icinga2/issues/5309) (Documentation, PR): Docs: Replace the command pipe w/ the REST API as Icinga Web 2 requirement in 'Getting Started' chapter
+* [#5291](https://github.com/icinga/icinga2/issues/5291) (Documentation): Update docs for RHEL/CentOS 5 EOL
+* [#5285](https://github.com/icinga/icinga2/issues/5285) (Documentation, PR): Fix sysstat installation in troubleshooting docs
+* [#5279](https://github.com/icinga/icinga2/issues/5279) (Documentation, PR): Docs: Add API query example for acknowledgements w/o expire time
+* [#5275](https://github.com/icinga/icinga2/issues/5275) (Documentation, PR): Add troubleshooting hints for cgroup fork errors
+* [#5244](https://github.com/icinga/icinga2/issues/5244) (Documentation, PR): Add a PR review section to CONTRIBUTING.md
+* [#5237](https://github.com/icinga/icinga2/issues/5237) (Documentation, PR): Docs: Add a note for Windows debuglog to the troubleshooting chapter
+* [#5227](https://github.com/icinga/icinga2/issues/5227) (Documentation, ITL, PR): feature/itl-vmware-esx-storage-path-standbyok
+* [#5216](https://github.com/icinga/icinga2/issues/5216) (Documentation, PR): Remove "... is is ..." in CONTRIBUTING.md
+* [#5206](https://github.com/icinga/icinga2/issues/5206) (Documentation): Typo in Getting Started Guide
+* [#5203](https://github.com/icinga/icinga2/issues/5203) (Documentation, PR): Fix typo in Getting Started chapter
+* [#5184](https://github.com/icinga/icinga2/issues/5184) (Documentation, PR): Doc/appendix: fix malformed markdown links
+* [#5181](https://github.com/icinga/icinga2/issues/5181) (Documentation, PR): List SELinux packages required for building RPMs
+* [#5178](https://github.com/icinga/icinga2/issues/5178) (Documentation, Windows): Documentation vague on "update-windows" check plugin
+* [#5175](https://github.com/icinga/icinga2/issues/5175) (Documentation): Add a note about flapping problems to the docs
+* [#5174](https://github.com/icinga/icinga2/issues/5174) (Documentation, PR): Add missing object type to Apply Rules doc example
+* [#5173](https://github.com/icinga/icinga2/issues/5173) (Documentation): Object type missing from ping Service example in docs
+* [#5167](https://github.com/icinga/icinga2/issues/5167) (Documentation): Add more assign where expression examples
+* [#5166](https://github.com/icinga/icinga2/issues/5166) (API, Documentation): Set zone attribute to no\_user\_modify for API POST requests
+* [#5165](https://github.com/icinga/icinga2/issues/5165) (Documentation, PR): Syntax error In Dependencies chapter
+* [#5164](https://github.com/icinga/icinga2/issues/5164) (Documentation, ITL, PR): ITL: Add CheckCommand ssl\_cert, fix ssl attributes
+* [#5161](https://github.com/icinga/icinga2/issues/5161) (Documentation, PR): ITL documentation - disk-windows usage note with % thresholds
+* [#5157](https://github.com/icinga/icinga2/issues/5157) (Documentation): "Three Levels with master, Satellites, and Clients" chapter is not clear about client config
+* [#5156](https://github.com/icinga/icinga2/issues/5156) (Documentation): Add CONTRIBUTING.md
+* [#5155](https://github.com/icinga/icinga2/issues/5155) (Documentation): 3.5. Apply Rules topic in the docs needs work.
+* [#5151](https://github.com/icinga/icinga2/issues/5151) (Documentation, PR): Replace http:// links with https:// links where a secure website exists
+* [#5150](https://github.com/icinga/icinga2/issues/5150) (Documentation): Invalid links in documentation
+* [#5149](https://github.com/icinga/icinga2/issues/5149) (Documentation, PR): Update documentation, change http:// links to https:// links where a website exists
+* [#5144](https://github.com/icinga/icinga2/issues/5144) (Documentation): Extend troubleshooting docs w/ environment analysis and common tools
+* [#5143](https://github.com/icinga/icinga2/issues/5143) (Documentation): Docs: Explain how to include your own config tree instead of conf.d
+* [#5142](https://github.com/icinga/icinga2/issues/5142) (Documentation): Add an Elastic Stack Integrations chapter to feature documentation
+* [#5140](https://github.com/icinga/icinga2/issues/5140) (Documentation): Documentation should explain that runtime modifications are not immediately updated for "object list"
+* [#5137](https://github.com/icinga/icinga2/issues/5137) (Documentation): Doc updates: Getting Started w/ own config, Troubleshooting w/ debug console
+* [#5111](https://github.com/icinga/icinga2/issues/5111) (Documentation): Fix duration attribute requirement for schedule-downtime API action
+* [#5104](https://github.com/icinga/icinga2/issues/5104) (Documentation, PR): Correct link to nscp documentation
+* [#5097](https://github.com/icinga/icinga2/issues/5097) (Documentation): The last example for typeof\(\) is missing the result
+* [#5090](https://github.com/icinga/icinga2/issues/5090) (Cluster, Documentation): EventHandler to be executed at the endpoint
+* [#5077](https://github.com/icinga/icinga2/issues/5077) (Documentation): Replace the 'command' feature w/ the REST API for Icinga Web 2
+* [#5016](https://github.com/icinga/icinga2/issues/5016) (Documentation, ITL, PR): Add fuse.gvfs-fuse-daemon to disk\_exclude\_type
+* [#5010](https://github.com/icinga/icinga2/issues/5010) (Documentation): \[Documentation\] Missing parameter for SNMPv3 auth
+* [#3560](https://github.com/icinga/icinga2/issues/3560) (Documentation): Explain check\_memorys and check\_disks thresholds
+* [#1880](https://github.com/icinga/icinga2/issues/1880) (Documentation): add a section for 'monitoring the icinga2 node'
### Support
-* [#5359](https://github.com/Icinga/icinga2/issues/5359) (CLI, PR): Fixed missing closing bracket in CLI command pki new-cert.
-* [#5332](https://github.com/Icinga/icinga2/issues/5332) (Configuration, Notifications, PR): Notification Scripts: notification\_type is always required
-* [#5326](https://github.com/Icinga/icinga2/issues/5326) (Documentation, Installation, PR): Install the images directory containing the needed PNGs for the markd
-* [#5310](https://github.com/Icinga/icinga2/issues/5310) (Packages, PR): RPM: Disable SELinux policy hardlink
-* [#5306](https://github.com/Icinga/icinga2/issues/5306) (Documentation, Packages, PR): Remove CentOS 5 from 'Getting started' docs
-* [#5304](https://github.com/Icinga/icinga2/issues/5304) (Documentation, Packages, PR): Update INSTALL.md for RPM builds
-* [#5303](https://github.com/Icinga/icinga2/issues/5303) (Packages, PR): RPM: Fix builds on Amazon Linux
-* [#5299](https://github.com/Icinga/icinga2/issues/5299) (Notifications): Ensure that "mail from" works on RHEL/CentOS
-* [#5286](https://github.com/Icinga/icinga2/issues/5286) (Configuration, PR): Fix verbose mode in notifications scripts
-* [#5265](https://github.com/Icinga/icinga2/issues/5265) (PR): Move PerfdataValue\(\) class into base library
-* [#5252](https://github.com/Icinga/icinga2/issues/5252) (Tests, PR): travis: Update to trusty as CI environment
-* [#5251](https://github.com/Icinga/icinga2/issues/5251) (Tests): Update Travis CI environment to trusty
-* [#5248](https://github.com/Icinga/icinga2/issues/5248) (Tests, PR): Travis: Run config validation at the end
-* [#5238](https://github.com/Icinga/icinga2/issues/5238) (DB IDO, PR): Remove deprecated "DbCat1 | DbCat2" notation for DB IDO categories
-* [#5229](https://github.com/Icinga/icinga2/issues/5229) (Installation, PR): CMake: require a GCC version according to INSTALL.md
-* [#5226](https://github.com/Icinga/icinga2/issues/5226) (Packages, PR): RPM spec: don't enable features after an upgrade
-* [#5225](https://github.com/Icinga/icinga2/issues/5225) (DB IDO, PR): Don't call mysql\_error\(\) after a failure of mysql\_init\(\)
-* [#5218](https://github.com/Icinga/icinga2/issues/5218) (Packages): icinga2.spec: Allow selecting g++ compiler on older SUSE release builds
-* [#5189](https://github.com/Icinga/icinga2/issues/5189) (Documentation, Packages, PR): RPM packaging updates
-* [#5188](https://github.com/Icinga/icinga2/issues/5188) (Documentation, Packages): Boost \>= 1.48 required
-* [#5177](https://github.com/Icinga/icinga2/issues/5177) (Packages): Issues Packing icinga 2.6.3 tar.gz to RPM
-* [#5153](https://github.com/Icinga/icinga2/issues/5153) (Packages, PR): Changed dependency of selinux subpackage
-* [#5127](https://github.com/Icinga/icinga2/issues/5127) (Installation, PR): Improve systemd service file
-* [#5102](https://github.com/Icinga/icinga2/issues/5102) (Compat, Configuration, Packages): Deprecate the icinga2-classicui-config package
-* [#5101](https://github.com/Icinga/icinga2/issues/5101) (Packages, Windows): Fix incorrect metadata for the Chocolatey package
-* [#5100](https://github.com/Icinga/icinga2/issues/5100) (Packages, Windows): Update Chocolatey package to match current guidelines
-* [#5094](https://github.com/Icinga/icinga2/issues/5094) (Cluster, Configuration): Log message "Object cannot be deleted because it was not created using the API"
-* [#5087](https://github.com/Icinga/icinga2/issues/5087) (Configuration): Function metadata should show available arguments
-* [#5042](https://github.com/Icinga/icinga2/issues/5042) (DB IDO, PR): Add link to upgrade documentation to log message
-* [#4977](https://github.com/Icinga/icinga2/issues/4977) (Cluster, Installation): icinga2/api/log directory is not created
-* [#4921](https://github.com/Icinga/icinga2/issues/4921) (Installation, Packages): No network dependency for /etc/init.d/icinga2
-* [#4781](https://github.com/Icinga/icinga2/issues/4781) (Packages): Improve SELinux Policy
-* [#4776](https://github.com/Icinga/icinga2/issues/4776) (Installation): NetBSD install path fixes
-* [#4621](https://github.com/Icinga/icinga2/issues/4621) (Configuration, Notifications, Packages): notifications always enabled after update
+* [#5359](https://github.com/icinga/icinga2/issues/5359) (CLI, PR): Fixed missing closing bracket in CLI command pki new-cert.
+* [#5332](https://github.com/icinga/icinga2/issues/5332) (Configuration, Notifications, PR): Notification Scripts: notification\_type is always required
+* [#5326](https://github.com/icinga/icinga2/issues/5326) (Documentation, Installation, PR): Install the images directory containing the needed PNGs for the markd
+* [#5310](https://github.com/icinga/icinga2/issues/5310) (Packages, PR): RPM: Disable SELinux policy hardlink
+* [#5306](https://github.com/icinga/icinga2/issues/5306) (Documentation, Packages, PR): Remove CentOS 5 from 'Getting started' docs
+* [#5304](https://github.com/icinga/icinga2/issues/5304) (Documentation, Packages, PR): Update INSTALL.md for RPM builds
+* [#5303](https://github.com/icinga/icinga2/issues/5303) (Packages, PR): RPM: Fix builds on Amazon Linux
+* [#5299](https://github.com/icinga/icinga2/issues/5299) (Notifications): Ensure that "mail from" works on RHEL/CentOS
+* [#5286](https://github.com/icinga/icinga2/issues/5286) (Configuration, PR): Fix verbose mode in notifications scripts
+* [#5265](https://github.com/icinga/icinga2/issues/5265) (PR): Move PerfdataValue\(\) class into base library
+* [#5252](https://github.com/icinga/icinga2/issues/5252) (Tests, PR): travis: Update to trusty as CI environment
+* [#5251](https://github.com/icinga/icinga2/issues/5251) (Tests): Update Travis CI environment to trusty
+* [#5248](https://github.com/icinga/icinga2/issues/5248) (Tests, PR): Travis: Run config validation at the end
+* [#5238](https://github.com/icinga/icinga2/issues/5238) (DB IDO, PR): Remove deprecated "DbCat1 | DbCat2" notation for DB IDO categories
+* [#5229](https://github.com/icinga/icinga2/issues/5229) (Installation, PR): CMake: require a GCC version according to INSTALL.md
+* [#5226](https://github.com/icinga/icinga2/issues/5226) (Packages, PR): RPM spec: don't enable features after an upgrade
+* [#5225](https://github.com/icinga/icinga2/issues/5225) (DB IDO, PR): Don't call mysql\_error\(\) after a failure of mysql\_init\(\)
+* [#5218](https://github.com/icinga/icinga2/issues/5218) (Packages): icinga2.spec: Allow selecting g++ compiler on older SUSE release builds
+* [#5189](https://github.com/icinga/icinga2/issues/5189) (Documentation, Packages, PR): RPM packaging updates
+* [#5188](https://github.com/icinga/icinga2/issues/5188) (Documentation, Packages): Boost \>= 1.48 required
+* [#5177](https://github.com/icinga/icinga2/issues/5177) (Packages): Issues Packing icinga 2.6.3 tar.gz to RPM
+* [#5153](https://github.com/icinga/icinga2/issues/5153) (Packages, PR): Changed dependency of selinux subpackage
+* [#5127](https://github.com/icinga/icinga2/issues/5127) (Installation, PR): Improve systemd service file
+* [#5102](https://github.com/icinga/icinga2/issues/5102) (Compat, Configuration, Packages): Deprecate the icinga2-classicui-config package
+* [#5101](https://github.com/icinga/icinga2/issues/5101) (Packages, Windows): Fix incorrect metadata for the Chocolatey package
+* [#5100](https://github.com/icinga/icinga2/issues/5100) (Packages, Windows): Update Chocolatey package to match current guidelines
+* [#5094](https://github.com/icinga/icinga2/issues/5094) (Cluster, Configuration): Log message "Object cannot be deleted because it was not created using the API"
+* [#5087](https://github.com/icinga/icinga2/issues/5087) (Configuration): Function metadata should show available arguments
+* [#5042](https://github.com/icinga/icinga2/issues/5042) (DB IDO, PR): Add link to upgrade documentation to log message
+* [#4977](https://github.com/icinga/icinga2/issues/4977) (Cluster, Installation): icinga2/api/log directory is not created
+* [#4921](https://github.com/icinga/icinga2/issues/4921) (Installation, Packages): No network dependency for /etc/init.d/icinga2
+* [#4781](https://github.com/icinga/icinga2/issues/4781) (Packages): Improve SELinux Policy
+* [#4776](https://github.com/icinga/icinga2/issues/4776) (Installation): NetBSD install path fixes
+* [#4621](https://github.com/icinga/icinga2/issues/4621) (Configuration, Notifications, Packages): notifications always enabled after update
## 2.6.3 (2017-03-29)
### Bug
-* [#5080](https://github.com/Icinga/icinga2/issues/5080) (DB IDO): Missing index use can cause icinga\_downtimehistory queries to hang indefinitely
-* [#4989](https://github.com/Icinga/icinga2/issues/4989) (Check Execution): Icinga daemon runs with nice 5 after reload
-* [#4930](https://github.com/Icinga/icinga2/issues/4930) (Cluster): Change "Discarding 'config update object'" log messages to notice log level
-* [#4603](https://github.com/Icinga/icinga2/issues/4603) (DB IDO): With too many comments, Icinga reload process won't finish reconnecting to Database
+* [#5080](https://github.com/icinga/icinga2/issues/5080) (DB IDO): Missing index use can cause icinga\_downtimehistory queries to hang indefinitely
+* [#4989](https://github.com/icinga/icinga2/issues/4989) (Check Execution): Icinga daemon runs with nice 5 after reload
+* [#4930](https://github.com/icinga/icinga2/issues/4930) (Cluster): Change "Discarding 'config update object'" log messages to notice log level
+* [#4603](https://github.com/icinga/icinga2/issues/4603) (DB IDO): With too many comments, Icinga reload process won't finish reconnecting to Database
### Documentation
-* [#5057](https://github.com/Icinga/icinga2/issues/5057) (Documentation): Update Security section in the Distributed Monitoring chapter
-* [#5055](https://github.com/Icinga/icinga2/issues/5055) (Documentation, ITL): mysql\_socket attribute missing in the documentation for the mysql CheckCommand
-* [#5035](https://github.com/Icinga/icinga2/issues/5035) (Documentation): Docs: Typo in Distributed Monitoring chapter
-* [#5030](https://github.com/Icinga/icinga2/issues/5030) (Documentation): Advanced topics: Mention the API and explain stick acks, fixed/flexible downtimes
-* [#5029](https://github.com/Icinga/icinga2/issues/5029) (Documentation): Advanced topics: Wrong acknowledgement notification filter
-* [#4996](https://github.com/Icinga/icinga2/issues/4996) (Documentation): documentation: mixed up host names in 6-distributed-monitoring.md
-* [#4980](https://github.com/Icinga/icinga2/issues/4980) (Documentation): Add OpenBSD and AlpineLinux package repositories to the documentation
-* [#4955](https://github.com/Icinga/icinga2/issues/4955) (Documentation, ITL): Review CheckCommand documentation including external URLs
-* [#4954](https://github.com/Icinga/icinga2/issues/4954) (Documentation): Add an example for /v1/actions/process-check-result which uses filter/type
-* [#3133](https://github.com/Icinga/icinga2/issues/3133) (Documentation): Add practical examples for apply expressions
+* [#5057](https://github.com/icinga/icinga2/issues/5057) (Documentation): Update Security section in the Distributed Monitoring chapter
+* [#5055](https://github.com/icinga/icinga2/issues/5055) (Documentation, ITL): mysql\_socket attribute missing in the documentation for the mysql CheckCommand
+* [#5035](https://github.com/icinga/icinga2/issues/5035) (Documentation): Docs: Typo in Distributed Monitoring chapter
+* [#5030](https://github.com/icinga/icinga2/issues/5030) (Documentation): Advanced topics: Mention the API and explain stick acks, fixed/flexible downtimes
+* [#5029](https://github.com/icinga/icinga2/issues/5029) (Documentation): Advanced topics: Wrong acknowledgement notification filter
+* [#4996](https://github.com/icinga/icinga2/issues/4996) (Documentation): documentation: mixed up host names in 6-distributed-monitoring.md
+* [#4980](https://github.com/icinga/icinga2/issues/4980) (Documentation): Add OpenBSD and AlpineLinux package repositories to the documentation
+* [#4955](https://github.com/icinga/icinga2/issues/4955) (Documentation, ITL): Review CheckCommand documentation including external URLs
+* [#4954](https://github.com/icinga/icinga2/issues/4954) (Documentation): Add an example for /v1/actions/process-check-result which uses filter/type
+* [#3133](https://github.com/icinga/icinga2/issues/3133) (Documentation): Add practical examples for apply expressions
## 2.6.2 (2017-02-13)
### Bug
-* [#4952](https://github.com/Icinga/icinga2/issues/4952) (API, CLI): Icinga crashes while trying to remove configuration files for objects which no longer exist
+* [#4952](https://github.com/icinga/icinga2/issues/4952) (API, CLI): Icinga crashes while trying to remove configuration files for objects which no longer exist
## 2.6.1 (2017-01-31)
@@ -565,32 +617,32 @@ The documentation changes reflect our recent move to GitHub.
### Enhancement
-* [#4923](https://github.com/Icinga/icinga2/issues/4923): Migration to Github
-* [#4813](https://github.com/Icinga/icinga2/issues/4813): Include argument name for log message about incorrect set\_if values
+* [#4923](https://github.com/icinga/icinga2/issues/4923): Migration to Github
+* [#4813](https://github.com/icinga/icinga2/issues/4813): Include argument name for log message about incorrect set\_if values
### Bug
-* [#4950](https://github.com/Icinga/icinga2/issues/4950): IDO schema update is not compatible to MySQL 5.7
-* [#4882](https://github.com/Icinga/icinga2/issues/4882): Crash - Error: parse error: premature EOF
-* [#4877](https://github.com/Icinga/icinga2/issues/4877) (DB IDO): IDO MySQL schema not working on MySQL 5.7
-* [#4874](https://github.com/Icinga/icinga2/issues/4874) (DB IDO): IDO: Timestamps in PostgreSQL may still have a time zone offset
-* [#4867](https://github.com/Icinga/icinga2/issues/4867): SIGPIPE shutdown on config reload
+* [#4950](https://github.com/icinga/icinga2/issues/4950): IDO schema update is not compatible to MySQL 5.7
+* [#4882](https://github.com/icinga/icinga2/issues/4882): Crash - Error: parse error: premature EOF
+* [#4877](https://github.com/icinga/icinga2/issues/4877) (DB IDO): IDO MySQL schema not working on MySQL 5.7
+* [#4874](https://github.com/icinga/icinga2/issues/4874) (DB IDO): IDO: Timestamps in PostgreSQL may still have a time zone offset
+* [#4867](https://github.com/icinga/icinga2/issues/4867): SIGPIPE shutdown on config reload
### Documentation
-* [#4944](https://github.com/Icinga/icinga2/issues/4944) (Documentation, PR): doc/6-distributed-monitoring.md: Fix typo
-* [#4934](https://github.com/Icinga/icinga2/issues/4934) (Documentation): Update contribution section for GitHub
-* [#4917](https://github.com/Icinga/icinga2/issues/4917) (Documentation): Incorrect license file mentioned in README.md
-* [#4916](https://github.com/Icinga/icinga2/issues/4916) (Documentation): Add travis-ci build status logo to README.md
-* [#4908](https://github.com/Icinga/icinga2/issues/4908) (Documentation): Move domain to icinga.com
-* [#4885](https://github.com/Icinga/icinga2/issues/4885) (Documentation): SLES 12 SP2 libboost\_thread package requires libboost\_chrono
-* [#4869](https://github.com/Icinga/icinga2/issues/4869) (Documentation): Update RELEASE.md
-* [#4868](https://github.com/Icinga/icinga2/issues/4868) (Documentation): Add more build details to INSTALL.md
-* [#4803](https://github.com/Icinga/icinga2/issues/4803) (Documentation): Update Repositories in Docs
+* [#4944](https://github.com/icinga/icinga2/issues/4944) (Documentation, PR): doc/6-distributed-monitoring.md: Fix typo
+* [#4934](https://github.com/icinga/icinga2/issues/4934) (Documentation): Update contribution section for GitHub
+* [#4917](https://github.com/icinga/icinga2/issues/4917) (Documentation): Incorrect license file mentioned in README.md
+* [#4916](https://github.com/icinga/icinga2/issues/4916) (Documentation): Add travis-ci build status logo to README.md
+* [#4908](https://github.com/icinga/icinga2/issues/4908) (Documentation): Move domain to icinga.com
+* [#4885](https://github.com/icinga/icinga2/issues/4885) (Documentation): SLES 12 SP2 libboost\_thread package requires libboost\_chrono
+* [#4869](https://github.com/icinga/icinga2/issues/4869) (Documentation): Update RELEASE.md
+* [#4868](https://github.com/icinga/icinga2/issues/4868) (Documentation): Add more build details to INSTALL.md
+* [#4803](https://github.com/icinga/icinga2/issues/4803) (Documentation): Update Repositories in Docs
### Support
-* [#4870](https://github.com/Icinga/icinga2/issues/4870) (Packages): SLES11 SP4 dependency on Postgresql \>= 8.4
+* [#4870](https://github.com/icinga/icinga2/issues/4870) (Packages): SLES11 SP4 dependency on Postgresql \>= 8.4
## 2.6.0 (2016-12-13)
@@ -620,149 +672,149 @@ The documentation changes reflect our recent move to GitHub.
### Enhancement
-* [#4798](https://github.com/Icinga/icinga2/issues/4798) (Cluster): Deprecate cluster/client mode "bottom up" w/ repository.d and node update-config
-* [#4770](https://github.com/Icinga/icinga2/issues/4770) (API): Allow to evaluate macros through the API
-* [#4713](https://github.com/Icinga/icinga2/issues/4713) (Cluster): Check whether nodes are synchronizing the API log before putting them into UNKNOWN
-* [#4651](https://github.com/Icinga/icinga2/issues/4651) (Plugins): Review windows plugins performance output
-* [#4631](https://github.com/Icinga/icinga2/issues/4631) (Configuration): Suppress compiler warnings for auto-generated code
-* [#4622](https://github.com/Icinga/icinga2/issues/4622) (Cluster): Improve log message for ignored config updates
-* [#4590](https://github.com/Icinga/icinga2/issues/4590): Make sure that libmethods is automatically loaded even when not using the ITL
-* [#4587](https://github.com/Icinga/icinga2/issues/4587) (Configuration): Implement support for default templates
-* [#4580](https://github.com/Icinga/icinga2/issues/4580) (API): Provide location information for objects and templates in the API
-* [#4576](https://github.com/Icinga/icinga2/issues/4576): Use lambda functions for INITIALIZE\_ONCE
-* [#4575](https://github.com/Icinga/icinga2/issues/4575): Use 'auto' for iterator declarations
-* [#4571](https://github.com/Icinga/icinga2/issues/4571): Implement an rvalue constructor for the String and Value classes
-* [#4570](https://github.com/Icinga/icinga2/issues/4570) (Configuration): Implement a command-line argument for "icinga2 console" to allow specifying a script file
-* [#4563](https://github.com/Icinga/icinga2/issues/4563) (Configuration): Remove unused method: ApplyRule::DiscardRules
-* [#4559](https://github.com/Icinga/icinga2/issues/4559): Replace BOOST\_FOREACH with range-based for loops
-* [#4557](https://github.com/Icinga/icinga2/issues/4557): Add -fvisibility=hidden to the default compiler flags
-* [#4537](https://github.com/Icinga/icinga2/issues/4537): Implement an environment variable to keep Icinga from closing FDs on startup
-* [#4536](https://github.com/Icinga/icinga2/issues/4536): Avoid unnecessary string copies
-* [#4535](https://github.com/Icinga/icinga2/issues/4535): Remove deprecated functions
-* [#3684](https://github.com/Icinga/icinga2/issues/3684) (Configuration): Command line option for config syntax validation
-* [#2968](https://github.com/Icinga/icinga2/issues/2968): Better message for apply errors
+* [#4798](https://github.com/icinga/icinga2/issues/4798) (Cluster): Deprecate cluster/client mode "bottom up" w/ repository.d and node update-config
+* [#4770](https://github.com/icinga/icinga2/issues/4770) (API): Allow to evaluate macros through the API
+* [#4713](https://github.com/icinga/icinga2/issues/4713) (Cluster): Check whether nodes are synchronizing the API log before putting them into UNKNOWN
+* [#4651](https://github.com/icinga/icinga2/issues/4651) (Plugins): Review windows plugins performance output
+* [#4631](https://github.com/icinga/icinga2/issues/4631) (Configuration): Suppress compiler warnings for auto-generated code
+* [#4622](https://github.com/icinga/icinga2/issues/4622) (Cluster): Improve log message for ignored config updates
+* [#4590](https://github.com/icinga/icinga2/issues/4590): Make sure that libmethods is automatically loaded even when not using the ITL
+* [#4587](https://github.com/icinga/icinga2/issues/4587) (Configuration): Implement support for default templates
+* [#4580](https://github.com/icinga/icinga2/issues/4580) (API): Provide location information for objects and templates in the API
+* [#4576](https://github.com/icinga/icinga2/issues/4576): Use lambda functions for INITIALIZE\_ONCE
+* [#4575](https://github.com/icinga/icinga2/issues/4575): Use 'auto' for iterator declarations
+* [#4571](https://github.com/icinga/icinga2/issues/4571): Implement an rvalue constructor for the String and Value classes
+* [#4570](https://github.com/icinga/icinga2/issues/4570) (Configuration): Implement a command-line argument for "icinga2 console" to allow specifying a script file
+* [#4563](https://github.com/icinga/icinga2/issues/4563) (Configuration): Remove unused method: ApplyRule::DiscardRules
+* [#4559](https://github.com/icinga/icinga2/issues/4559): Replace BOOST\_FOREACH with range-based for loops
+* [#4557](https://github.com/icinga/icinga2/issues/4557): Add -fvisibility=hidden to the default compiler flags
+* [#4537](https://github.com/icinga/icinga2/issues/4537): Implement an environment variable to keep Icinga from closing FDs on startup
+* [#4536](https://github.com/icinga/icinga2/issues/4536): Avoid unnecessary string copies
+* [#4535](https://github.com/icinga/icinga2/issues/4535): Remove deprecated functions
+* [#3684](https://github.com/icinga/icinga2/issues/3684) (Configuration): Command line option for config syntax validation
+* [#2968](https://github.com/icinga/icinga2/issues/2968): Better message for apply errors
### Bug
-* [#4831](https://github.com/Icinga/icinga2/issues/4831) (CLI): Wrong help string for node setup cli command argument --master\_host
-* [#4828](https://github.com/Icinga/icinga2/issues/4828) (API): Crash in CreateObjectHandler \(regression from \#11684
-* [#4802](https://github.com/Icinga/icinga2/issues/4802): Icinga tries to delete Downtime objects that were statically configured
-* [#4801](https://github.com/Icinga/icinga2/issues/4801): Sending a HUP signal to the child process for execution actually kills it
-* [#4791](https://github.com/Icinga/icinga2/issues/4791) (DB IDO): PostgreSQL: Don't use timestamp with timezone for UNIX timestamp columns
-* [#4789](https://github.com/Icinga/icinga2/issues/4789) (Notifications): Recovery notifications sent for Not-Problem notification type if notified before
-* [#4775](https://github.com/Icinga/icinga2/issues/4775) (Cluster): Crash w/ SendNotifications cluster handler and check result with empty perfdata
-* [#4771](https://github.com/Icinga/icinga2/issues/4771): Config validation crashes when using command\_endpoint without also having an ApiListener object
-* [#4752](https://github.com/Icinga/icinga2/issues/4752) (Graphite): Performance data writer for Graphite : Values without fraction limited to 2147483647 \(7FFFFFFF\)
-* [#4740](https://github.com/Icinga/icinga2/issues/4740): SIGALRM handling may be affected by recent commit
-* [#4726](https://github.com/Icinga/icinga2/issues/4726) (Notifications): Flapping notifications sent for soft state changes
-* [#4717](https://github.com/Icinga/icinga2/issues/4717) (API): Icinga crashes while deleting a config file which doesn't exist anymore
-* [#4678](https://github.com/Icinga/icinga2/issues/4678) (Configuration): Configuration validation fails when setting tls\_protocolmin to TLSv1.2
-* [#4674](https://github.com/Icinga/icinga2/issues/4674) (CLI): Parse error: "premature EOF" when running "icinga2 node update-config"
-* [#4665](https://github.com/Icinga/icinga2/issues/4665): Crash in ClusterEvents::SendNotificationsAPIHandler
-* [#4646](https://github.com/Icinga/icinga2/issues/4646) (Notifications): Forced custom notification is setting "force\_next\_notification": true permanently
-* [#4644](https://github.com/Icinga/icinga2/issues/4644) (API): Crash in HttpRequest::Parse while processing HTTP request
-* [#4630](https://github.com/Icinga/icinga2/issues/4630) (Configuration): Validation does not highlight the correct attribute
-* [#4629](https://github.com/Icinga/icinga2/issues/4629) (CLI): broken: icinga2 --version
-* [#4620](https://github.com/Icinga/icinga2/issues/4620) (API): Invalid API filter error messages
-* [#4619](https://github.com/Icinga/icinga2/issues/4619) (CLI): Cli: boost::bad\_get on icinga::String::String\(icinga::Value&&\)
-* [#4616](https://github.com/Icinga/icinga2/issues/4616): Build fails with Visual Studio 2015
-* [#4606](https://github.com/Icinga/icinga2/issues/4606): Remove unused last\_in\_downtime field
-* [#4602](https://github.com/Icinga/icinga2/issues/4602) (CLI): Last option highlighted as the wrong one, even when it is not the culprit
-* [#4599](https://github.com/Icinga/icinga2/issues/4599): Unexpected state changes with max\_check\_attempts = 2
-* [#4583](https://github.com/Icinga/icinga2/issues/4583) (Configuration): Debug hints for dictionary expressions are nested incorrectly
-* [#4574](https://github.com/Icinga/icinga2/issues/4574) (Notifications): Don't send Flapping\* notifications when downtime is active
-* [#4573](https://github.com/Icinga/icinga2/issues/4573) (DB IDO): Getting error during schema update
-* [#4572](https://github.com/Icinga/icinga2/issues/4572) (Configuration): Config validation shouldnt allow 'endpoints = \[ "" \]'
-* [#4566](https://github.com/Icinga/icinga2/issues/4566) (Notifications): Fixed downtimes scheduled for a future date trigger DOWNTIMESTART notifications
-* [#4564](https://github.com/Icinga/icinga2/issues/4564): Add missing initializer for WorkQueue::m\_NextTaskID
-* [#4555](https://github.com/Icinga/icinga2/issues/4555): Fix compiler warnings
-* [#4541](https://github.com/Icinga/icinga2/issues/4541) (DB IDO): Don't link against libmysqlclient\_r
-* [#4538](https://github.com/Icinga/icinga2/issues/4538): Don't update TimePeriod ranges for inactive objects
-* [#4423](https://github.com/Icinga/icinga2/issues/4423) (Performance Data): InfluxdbWriter does not write state other than 0
-* [#4369](https://github.com/Icinga/icinga2/issues/4369) (Plugins): check\_network performance data in invalid format - ingraph
-* [#4169](https://github.com/Icinga/icinga2/issues/4169) (Cluster): Cluster resync problem with API created objects
-* [#4098](https://github.com/Icinga/icinga2/issues/4098) (API): Objects created in a global zone are not synced to child endpoints
-* [#4010](https://github.com/Icinga/icinga2/issues/4010) (API): API requests from execute-script action are too verbose
-* [#3802](https://github.com/Icinga/icinga2/issues/3802) (Compat): SCHEDULE\_AND\_PROPAGATE\_HOST\_DOWNTIME command missing
-* [#3801](https://github.com/Icinga/icinga2/issues/3801) (Compat): SCHEDULE\_AND\_PROPAGATE\_TRIGGERED\_HOST\_DOWNTIME command missing
-* [#3575](https://github.com/Icinga/icinga2/issues/3575) (DB IDO): MySQL 5.7.9, Incorrect datetime value Error
-* [#3565](https://github.com/Icinga/icinga2/issues/3565) (Plugins): Windows Agent: performance data of check\_perfmon
-* [#3564](https://github.com/Icinga/icinga2/issues/3564) (Plugins): Windows Agent: Performance data values for check\_perfmon.exe are invalid sometimes
-* [#3220](https://github.com/Icinga/icinga2/issues/3220) (Plugins): Implement support for resolving DNS hostnames in check\_ping.exe
-* [#2847](https://github.com/Icinga/icinga2/issues/2847): File descriptors are leaked to child processes which makes SELinux unhappy
+* [#4831](https://github.com/icinga/icinga2/issues/4831) (CLI): Wrong help string for node setup cli command argument --master\_host
+* [#4828](https://github.com/icinga/icinga2/issues/4828) (API): Crash in CreateObjectHandler \(regression from \#11684
+* [#4802](https://github.com/icinga/icinga2/issues/4802): Icinga tries to delete Downtime objects that were statically configured
+* [#4801](https://github.com/icinga/icinga2/issues/4801): Sending a HUP signal to the child process for execution actually kills it
+* [#4791](https://github.com/icinga/icinga2/issues/4791) (DB IDO): PostgreSQL: Don't use timestamp with timezone for UNIX timestamp columns
+* [#4789](https://github.com/icinga/icinga2/issues/4789) (Notifications): Recovery notifications sent for Not-Problem notification type if notified before
+* [#4775](https://github.com/icinga/icinga2/issues/4775) (Cluster): Crash w/ SendNotifications cluster handler and check result with empty perfdata
+* [#4771](https://github.com/icinga/icinga2/issues/4771): Config validation crashes when using command\_endpoint without also having an ApiListener object
+* [#4752](https://github.com/icinga/icinga2/issues/4752) (Graphite): Performance data writer for Graphite : Values without fraction limited to 2147483647 \(7FFFFFFF\)
+* [#4740](https://github.com/icinga/icinga2/issues/4740): SIGALRM handling may be affected by recent commit
+* [#4726](https://github.com/icinga/icinga2/issues/4726) (Notifications): Flapping notifications sent for soft state changes
+* [#4717](https://github.com/icinga/icinga2/issues/4717) (API): Icinga crashes while deleting a config file which doesn't exist anymore
+* [#4678](https://github.com/icinga/icinga2/issues/4678) (Configuration): Configuration validation fails when setting tls\_protocolmin to TLSv1.2
+* [#4674](https://github.com/icinga/icinga2/issues/4674) (CLI): Parse error: "premature EOF" when running "icinga2 node update-config"
+* [#4665](https://github.com/icinga/icinga2/issues/4665): Crash in ClusterEvents::SendNotificationsAPIHandler
+* [#4646](https://github.com/icinga/icinga2/issues/4646) (Notifications): Forced custom notification is setting "force\_next\_notification": true permanently
+* [#4644](https://github.com/icinga/icinga2/issues/4644) (API): Crash in HttpRequest::Parse while processing HTTP request
+* [#4630](https://github.com/icinga/icinga2/issues/4630) (Configuration): Validation does not highlight the correct attribute
+* [#4629](https://github.com/icinga/icinga2/issues/4629) (CLI): broken: icinga2 --version
+* [#4620](https://github.com/icinga/icinga2/issues/4620) (API): Invalid API filter error messages
+* [#4619](https://github.com/icinga/icinga2/issues/4619) (CLI): Cli: boost::bad\_get on icinga::String::String\(icinga::Value&&\)
+* [#4616](https://github.com/icinga/icinga2/issues/4616): Build fails with Visual Studio 2015
+* [#4606](https://github.com/icinga/icinga2/issues/4606): Remove unused last\_in\_downtime field
+* [#4602](https://github.com/icinga/icinga2/issues/4602) (CLI): Last option highlighted as the wrong one, even when it is not the culprit
+* [#4599](https://github.com/icinga/icinga2/issues/4599): Unexpected state changes with max\_check\_attempts = 2
+* [#4583](https://github.com/icinga/icinga2/issues/4583) (Configuration): Debug hints for dictionary expressions are nested incorrectly
+* [#4574](https://github.com/icinga/icinga2/issues/4574) (Notifications): Don't send Flapping\* notifications when downtime is active
+* [#4573](https://github.com/icinga/icinga2/issues/4573) (DB IDO): Getting error during schema update
+* [#4572](https://github.com/icinga/icinga2/issues/4572) (Configuration): Config validation shouldnt allow 'endpoints = \[ "" \]'
+* [#4566](https://github.com/icinga/icinga2/issues/4566) (Notifications): Fixed downtimes scheduled for a future date trigger DOWNTIMESTART notifications
+* [#4564](https://github.com/icinga/icinga2/issues/4564): Add missing initializer for WorkQueue::m\_NextTaskID
+* [#4555](https://github.com/icinga/icinga2/issues/4555): Fix compiler warnings
+* [#4541](https://github.com/icinga/icinga2/issues/4541) (DB IDO): Don't link against libmysqlclient\_r
+* [#4538](https://github.com/icinga/icinga2/issues/4538): Don't update TimePeriod ranges for inactive objects
+* [#4423](https://github.com/icinga/icinga2/issues/4423) (Metrics): InfluxdbWriter does not write state other than 0
+* [#4369](https://github.com/icinga/icinga2/issues/4369) (Plugins): check\_network performance data in invalid format - ingraph
+* [#4169](https://github.com/icinga/icinga2/issues/4169) (Cluster): Cluster resync problem with API created objects
+* [#4098](https://github.com/icinga/icinga2/issues/4098) (API): Objects created in a global zone are not synced to child endpoints
+* [#4010](https://github.com/icinga/icinga2/issues/4010) (API): API requests from execute-script action are too verbose
+* [#3802](https://github.com/icinga/icinga2/issues/3802) (Compat): SCHEDULE\_AND\_PROPAGATE\_HOST\_DOWNTIME command missing
+* [#3801](https://github.com/icinga/icinga2/issues/3801) (Compat): SCHEDULE\_AND\_PROPAGATE\_TRIGGERED\_HOST\_DOWNTIME command missing
+* [#3575](https://github.com/icinga/icinga2/issues/3575) (DB IDO): MySQL 5.7.9, Incorrect datetime value Error
+* [#3565](https://github.com/icinga/icinga2/issues/3565) (Plugins): Windows Agent: performance data of check\_perfmon
+* [#3564](https://github.com/icinga/icinga2/issues/3564) (Plugins): Windows Agent: Performance data values for check\_perfmon.exe are invalid sometimes
+* [#3220](https://github.com/icinga/icinga2/issues/3220) (Plugins): Implement support for resolving DNS hostnames in check\_ping.exe
+* [#2847](https://github.com/icinga/icinga2/issues/2847): File descriptors are leaked to child processes which makes SELinux unhappy
### ITL
-* [#4842](https://github.com/Icinga/icinga2/issues/4842) (ITL): Add tempdir attribute to postgres CheckCommand
-* [#4837](https://github.com/Icinga/icinga2/issues/4837) (ITL): Add sudo option to mailq CheckCommand
-* [#4836](https://github.com/Icinga/icinga2/issues/4836) (ITL): Add verbose parameter to http CheckCommand
-* [#4835](https://github.com/Icinga/icinga2/issues/4835) (ITL): Add timeout option to mysql\_health CheckCommand
-* [#4714](https://github.com/Icinga/icinga2/issues/4714) (ITL): Default values for check\_swap are incorrect
-* [#4710](https://github.com/Icinga/icinga2/issues/4710) (ITL): snmp\_miblist variable to feed the -m option of check\_snmp is missing in the snmpv3 CheckCommand object
-* [#4684](https://github.com/Icinga/icinga2/issues/4684) (ITL): Add a radius CheckCommand for the radius check provide by nagios-plugins
-* [#4681](https://github.com/Icinga/icinga2/issues/4681) (ITL): Add CheckCommand definition for check\_logstash
-* [#4677](https://github.com/Icinga/icinga2/issues/4677) (ITL): Problem passing arguments to nscp-local CheckCommand objects
-* [#4672](https://github.com/Icinga/icinga2/issues/4672) (ITL): Add timeout option to oracle\_health CheckCommand
-* [#4618](https://github.com/Icinga/icinga2/issues/4618) (ITL): Hangman easter egg is broken
-* [#4608](https://github.com/Icinga/icinga2/issues/4608) (ITL): Add CheckCommand definition for check\_iostats
-* [#4597](https://github.com/Icinga/icinga2/issues/4597) (ITL): Default disk plugin check should not check inodes
-* [#4595](https://github.com/Icinga/icinga2/issues/4595) (ITL): Manubulon: Add missing procurve memory flag
-* [#4585](https://github.com/Icinga/icinga2/issues/4585) (ITL): Fix code style violations in the ITL
-* [#4582](https://github.com/Icinga/icinga2/issues/4582) (ITL): Incorrect help text for check\_swap
-* [#4543](https://github.com/Icinga/icinga2/issues/4543) (ITL): ITL - check\_vmware\_esx - specify a datacenter/vsphere server for esx/host checks
-* [#4324](https://github.com/Icinga/icinga2/issues/4324) (ITL): Add CheckCommand definition for check\_glusterfs
+* [#4842](https://github.com/icinga/icinga2/issues/4842) (ITL): Add tempdir attribute to postgres CheckCommand
+* [#4837](https://github.com/icinga/icinga2/issues/4837) (ITL): Add sudo option to mailq CheckCommand
+* [#4836](https://github.com/icinga/icinga2/issues/4836) (ITL): Add verbose parameter to http CheckCommand
+* [#4835](https://github.com/icinga/icinga2/issues/4835) (ITL): Add timeout option to mysql\_health CheckCommand
+* [#4714](https://github.com/icinga/icinga2/issues/4714) (ITL): Default values for check\_swap are incorrect
+* [#4710](https://github.com/icinga/icinga2/issues/4710) (ITL): snmp\_miblist variable to feed the -m option of check\_snmp is missing in the snmpv3 CheckCommand object
+* [#4684](https://github.com/icinga/icinga2/issues/4684) (ITL): Add a radius CheckCommand for the radius check provide by nagios-plugins
+* [#4681](https://github.com/icinga/icinga2/issues/4681) (ITL): Add CheckCommand definition for check\_logstash
+* [#4677](https://github.com/icinga/icinga2/issues/4677) (ITL): Problem passing arguments to nscp-local CheckCommand objects
+* [#4672](https://github.com/icinga/icinga2/issues/4672) (ITL): Add timeout option to oracle\_health CheckCommand
+* [#4618](https://github.com/icinga/icinga2/issues/4618) (ITL): Hangman easter egg is broken
+* [#4608](https://github.com/icinga/icinga2/issues/4608) (ITL): Add CheckCommand definition for check\_iostats
+* [#4597](https://github.com/icinga/icinga2/issues/4597) (ITL): Default disk plugin check should not check inodes
+* [#4595](https://github.com/icinga/icinga2/issues/4595) (ITL): Manubulon: Add missing procurve memory flag
+* [#4585](https://github.com/icinga/icinga2/issues/4585) (ITL): Fix code style violations in the ITL
+* [#4582](https://github.com/icinga/icinga2/issues/4582) (ITL): Incorrect help text for check\_swap
+* [#4543](https://github.com/icinga/icinga2/issues/4543) (ITL): ITL - check\_vmware\_esx - specify a datacenter/vsphere server for esx/host checks
+* [#4324](https://github.com/icinga/icinga2/issues/4324) (ITL): Add CheckCommand definition for check\_glusterfs
### Documentation
-* [#4862](https://github.com/Icinga/icinga2/issues/4862) (Documentation): "2.1.4. Installation Paths" should contain systemd paths
-* [#4861](https://github.com/Icinga/icinga2/issues/4861) (Documentation): Update "2.1.3. Enabled Features during Installation" - outdated "feature list"
-* [#4859](https://github.com/Icinga/icinga2/issues/4859) (Documentation): Update package instructions for Fedora
-* [#4851](https://github.com/Icinga/icinga2/issues/4851) (Documentation): Update README.md and correct project URLs
-* [#4846](https://github.com/Icinga/icinga2/issues/4846) (Documentation): Add a note for boolean values in the disk CheckCommand section
-* [#4845](https://github.com/Icinga/icinga2/issues/4845) (Documentation): Troubleshooting: Add examples for fetching the executed command line
-* [#4840](https://github.com/Icinga/icinga2/issues/4840) (Documentation): Update Windows screenshots in the client documentation
-* [#4838](https://github.com/Icinga/icinga2/issues/4838) (Documentation): Add example for concurrent\_checks in CheckerComponent object type
-* [#4829](https://github.com/Icinga/icinga2/issues/4829) (Documentation): Missing API headers for X-HTTP-Method-Override
-* [#4827](https://github.com/Icinga/icinga2/issues/4827) (Documentation): Fix example in PNP template docs
-* [#4821](https://github.com/Icinga/icinga2/issues/4821) (Documentation): Add a note about removing "conf.d" on the client for "top down command endpoint" setups
-* [#4809](https://github.com/Icinga/icinga2/issues/4809) (Documentation): Update API and Library Reference chapters
-* [#4804](https://github.com/Icinga/icinga2/issues/4804) (Documentation): Add a note about default template import to the CheckCommand object
-* [#4800](https://github.com/Icinga/icinga2/issues/4800) (Documentation): Docs: Typo in "CLI commands" chapter
-* [#4793](https://github.com/Icinga/icinga2/issues/4793) (Documentation): Docs: ITL plugins contrib order
-* [#4787](https://github.com/Icinga/icinga2/issues/4787) (Documentation): Doc: Swap packages.icinga.org w/ DebMon
-* [#4780](https://github.com/Icinga/icinga2/issues/4780) (Documentation): Add a note about pinning checks w/ command\_endpoint
-* [#4736](https://github.com/Icinga/icinga2/issues/4736) (Documentation): Docs: wrong heading level for commands.conf and groups.conf
-* [#4708](https://github.com/Icinga/icinga2/issues/4708) (Documentation): Add more Timeperiod examples in the documentation
-* [#4706](https://github.com/Icinga/icinga2/issues/4706) (Documentation): Add an example of multi-parents configuration for the Migration chapter
-* [#4705](https://github.com/Icinga/icinga2/issues/4705) (Documentation): Typo in the documentation
-* [#4699](https://github.com/Icinga/icinga2/issues/4699) (Documentation): Fix some spelling mistakes
-* [#4667](https://github.com/Icinga/icinga2/issues/4667) (Documentation): Add documentation for logrotation for the mainlog feature
-* [#4653](https://github.com/Icinga/icinga2/issues/4653) (Documentation): Corrections for distributed monitoring chapter
-* [#4641](https://github.com/Icinga/icinga2/issues/4641) (Documentation): Docs: Migrating Notification example tells about filters instead of types
-* [#4639](https://github.com/Icinga/icinga2/issues/4639) (Documentation): GDB example in the documentation isn't working
-* [#4636](https://github.com/Icinga/icinga2/issues/4636) (Documentation): Add development docs for writing a core dump file
-* [#4601](https://github.com/Icinga/icinga2/issues/4601) (Documentation): Typo in distributed monitoring docs
-* [#4596](https://github.com/Icinga/icinga2/issues/4596) (Documentation): Update service monitoring and distributed docs
-* [#4589](https://github.com/Icinga/icinga2/issues/4589) (Documentation): Fix help output for update-links.py
-* [#4584](https://github.com/Icinga/icinga2/issues/4584) (Documentation): Add missing reference to libmethods for the default ITL command templates
-* [#4492](https://github.com/Icinga/icinga2/issues/4492) (Documentation): Add information about function 'range'
+* [#4862](https://github.com/icinga/icinga2/issues/4862) (Documentation): "2.1.4. Installation Paths" should contain systemd paths
+* [#4861](https://github.com/icinga/icinga2/issues/4861) (Documentation): Update "2.1.3. Enabled Features during Installation" - outdated "feature list"
+* [#4859](https://github.com/icinga/icinga2/issues/4859) (Documentation): Update package instructions for Fedora
+* [#4851](https://github.com/icinga/icinga2/issues/4851) (Documentation): Update README.md and correct project URLs
+* [#4846](https://github.com/icinga/icinga2/issues/4846) (Documentation): Add a note for boolean values in the disk CheckCommand section
+* [#4845](https://github.com/icinga/icinga2/issues/4845) (Documentation): Troubleshooting: Add examples for fetching the executed command line
+* [#4840](https://github.com/icinga/icinga2/issues/4840) (Documentation): Update Windows screenshots in the client documentation
+* [#4838](https://github.com/icinga/icinga2/issues/4838) (Documentation): Add example for concurrent\_checks in CheckerComponent object type
+* [#4829](https://github.com/icinga/icinga2/issues/4829) (Documentation): Missing API headers for X-HTTP-Method-Override
+* [#4827](https://github.com/icinga/icinga2/issues/4827) (Documentation): Fix example in PNP template docs
+* [#4821](https://github.com/icinga/icinga2/issues/4821) (Documentation): Add a note about removing "conf.d" on the client for "top down command endpoint" setups
+* [#4809](https://github.com/icinga/icinga2/issues/4809) (Documentation): Update API and Library Reference chapters
+* [#4804](https://github.com/icinga/icinga2/issues/4804) (Documentation): Add a note about default template import to the CheckCommand object
+* [#4800](https://github.com/icinga/icinga2/issues/4800) (Documentation): Docs: Typo in "CLI commands" chapter
+* [#4793](https://github.com/icinga/icinga2/issues/4793) (Documentation): Docs: ITL plugins contrib order
+* [#4787](https://github.com/icinga/icinga2/issues/4787) (Documentation): Doc: Swap packages.icinga.org w/ DebMon
+* [#4780](https://github.com/icinga/icinga2/issues/4780) (Documentation): Add a note about pinning checks w/ command\_endpoint
+* [#4736](https://github.com/icinga/icinga2/issues/4736) (Documentation): Docs: wrong heading level for commands.conf and groups.conf
+* [#4708](https://github.com/icinga/icinga2/issues/4708) (Documentation): Add more Timeperiod examples in the documentation
+* [#4706](https://github.com/icinga/icinga2/issues/4706) (Documentation): Add an example of multi-parents configuration for the Migration chapter
+* [#4705](https://github.com/icinga/icinga2/issues/4705) (Documentation): Typo in the documentation
+* [#4699](https://github.com/icinga/icinga2/issues/4699) (Documentation): Fix some spelling mistakes
+* [#4667](https://github.com/icinga/icinga2/issues/4667) (Documentation): Add documentation for logrotation for the mainlog feature
+* [#4653](https://github.com/icinga/icinga2/issues/4653) (Documentation): Corrections for distributed monitoring chapter
+* [#4641](https://github.com/icinga/icinga2/issues/4641) (Documentation): Docs: Migrating Notification example tells about filters instead of types
+* [#4639](https://github.com/icinga/icinga2/issues/4639) (Documentation): GDB example in the documentation isn't working
+* [#4636](https://github.com/icinga/icinga2/issues/4636) (Documentation): Add development docs for writing a core dump file
+* [#4601](https://github.com/icinga/icinga2/issues/4601) (Documentation): Typo in distributed monitoring docs
+* [#4596](https://github.com/icinga/icinga2/issues/4596) (Documentation): Update service monitoring and distributed docs
+* [#4589](https://github.com/icinga/icinga2/issues/4589) (Documentation): Fix help output for update-links.py
+* [#4584](https://github.com/icinga/icinga2/issues/4584) (Documentation): Add missing reference to libmethods for the default ITL command templates
+* [#4492](https://github.com/icinga/icinga2/issues/4492) (Documentation): Add information about function 'range'
### Support
-* [#4796](https://github.com/Icinga/icinga2/issues/4796) (Installation): Sort Changelog by category
-* [#4792](https://github.com/Icinga/icinga2/issues/4792) (Tests): Add unit test for notification state/type filter checks
-* [#4724](https://github.com/Icinga/icinga2/issues/4724) (Packages): Update .mailmap for icinga.com
-* [#4671](https://github.com/Icinga/icinga2/issues/4671) (Packages): Windows Installer should include NSClient++ 0.5.0
-* [#4612](https://github.com/Icinga/icinga2/issues/4612) (Tests): Unit tests randomly crash after the tests have completed
-* [#4607](https://github.com/Icinga/icinga2/issues/4607) (Packages): Improve support for building the chocolatey package
-* [#4588](https://github.com/Icinga/icinga2/issues/4588) (Installation): Use raw string literals in mkembedconfig
-* [#4578](https://github.com/Icinga/icinga2/issues/4578) (Installation): Improve detection for the -flto compiler flag
-* [#4569](https://github.com/Icinga/icinga2/issues/4569) (Installation): Set versions for all internal libraries
-* [#4558](https://github.com/Icinga/icinga2/issues/4558) (Installation): Update cmake config to require a compiler that supports C++11
-* [#4556](https://github.com/Icinga/icinga2/issues/4556) (Installation): logrotate file is not properly generated when the logrotate binary resides in /usr/bin
-* [#4551](https://github.com/Icinga/icinga2/issues/4551) (Tests): Implement unit tests for state changes
-* [#2943](https://github.com/Icinga/icinga2/issues/2943) (Installation): Make the user account configurable for the Windows service
-* [#2792](https://github.com/Icinga/icinga2/issues/2792) (Tests): Livestatus tests don't work on OS X
+* [#4796](https://github.com/icinga/icinga2/issues/4796) (Installation): Sort Changelog by category
+* [#4792](https://github.com/icinga/icinga2/issues/4792) (Tests): Add unit test for notification state/type filter checks
+* [#4724](https://github.com/icinga/icinga2/issues/4724) (Packages): Update .mailmap for icinga.com
+* [#4671](https://github.com/icinga/icinga2/issues/4671) (Packages): Windows Installer should include NSClient++ 0.5.0
+* [#4612](https://github.com/icinga/icinga2/issues/4612) (Tests): Unit tests randomly crash after the tests have completed
+* [#4607](https://github.com/icinga/icinga2/issues/4607) (Packages): Improve support for building the chocolatey package
+* [#4588](https://github.com/icinga/icinga2/issues/4588) (Installation): Use raw string literals in mkembedconfig
+* [#4578](https://github.com/icinga/icinga2/issues/4578) (Installation): Improve detection for the -flto compiler flag
+* [#4569](https://github.com/icinga/icinga2/issues/4569) (Installation): Set versions for all internal libraries
+* [#4558](https://github.com/icinga/icinga2/issues/4558) (Installation): Update cmake config to require a compiler that supports C++11
+* [#4556](https://github.com/icinga/icinga2/issues/4556) (Installation): logrotate file is not properly generated when the logrotate binary resides in /usr/bin
+* [#4551](https://github.com/icinga/icinga2/issues/4551) (Tests): Implement unit tests for state changes
+* [#2943](https://github.com/icinga/icinga2/issues/2943) (Installation): Make the user account configurable for the Windows service
+* [#2792](https://github.com/icinga/icinga2/issues/2792) (Tests): Livestatus tests don't work on OS X
## 2.5.4 (2016-08-30)
@@ -772,7 +824,7 @@ The documentation changes reflect our recent move to GitHub.
### Bug
-* [#4277](https://github.com/Icinga/icinga2/issues/4277): many check commands executed at same time when master reload
+* [#4277](https://github.com/icinga/icinga2/issues/4277): many check commands executed at same time when master reload
## 2.5.3 (2016-08-25)
@@ -782,7 +834,7 @@ This release addresses an issue with PostgreSQL support for the IDO database mod
### Bug
-* [#4554](https://github.com/Icinga/icinga2/issues/4554) (DB IDO): ido pgsql migration from 2.4.0 to 2.5.0 : wrong size for config\_hash
+* [#4554](https://github.com/icinga/icinga2/issues/4554) (DB IDO): ido pgsql migration from 2.4.0 to 2.5.0 : wrong size for config\_hash
## 2.5.2 (2016-08-24)
@@ -792,12 +844,12 @@ This release addresses an issue with PostgreSQL support for the IDO database mod
### Bug
-* [#4550](https://github.com/Icinga/icinga2/issues/4550): Icinga 2 sends SOFT recovery notifications
-* [#4549](https://github.com/Icinga/icinga2/issues/4549) (DB IDO): Newly added group member tables in the IDO database are not updated
+* [#4550](https://github.com/icinga/icinga2/issues/4550): Icinga 2 sends SOFT recovery notifications
+* [#4549](https://github.com/icinga/icinga2/issues/4549) (DB IDO): Newly added group member tables in the IDO database are not updated
### Documentation
-* [#4548](https://github.com/Icinga/icinga2/issues/4548) (Documentation): Wrong formatting in client docs
+* [#4548](https://github.com/icinga/icinga2/issues/4548) (Documentation): Wrong formatting in client docs
## 2.5.1 (2016-08-23)
@@ -807,7 +859,7 @@ This release addresses an issue with PostgreSQL support for the IDO database mod
### Bug
-* [#4544](https://github.com/Icinga/icinga2/issues/4544) (Notifications): Icinga 2 sends recovery notifications for SOFT NOT-OK states
+* [#4544](https://github.com/icinga/icinga2/issues/4544) (Notifications): Icinga 2 sends recovery notifications for SOFT NOT-OK states
## 2.5.0 (2016-08-23)
@@ -843,242 +895,242 @@ This release addresses an issue with PostgreSQL support for the IDO database mod
### Enhancement
-* [#4516](https://github.com/Icinga/icinga2/issues/4516): Remove some unused \#includes
-* [#4498](https://github.com/Icinga/icinga2/issues/4498): Remove unnecessary Dictionary::Contains calls
-* [#4493](https://github.com/Icinga/icinga2/issues/4493) (Cluster): Improve performance for Endpoint config validation
-* [#4491](https://github.com/Icinga/icinga2/issues/4491): Improve performance for type lookups
-* [#4487](https://github.com/Icinga/icinga2/issues/4487) (DB IDO): Incremental updates for the IDO database
-* [#4486](https://github.com/Icinga/icinga2/issues/4486) (DB IDO): Remove unused code from the IDO classes
-* [#4485](https://github.com/Icinga/icinga2/issues/4485) (API): Add API action for generating a PKI ticket
-* [#4479](https://github.com/Icinga/icinga2/issues/4479) (Configuration): Implement comparison operators for the Array class
-* [#4467](https://github.com/Icinga/icinga2/issues/4467): Implement the System\#sleep function
-* [#4465](https://github.com/Icinga/icinga2/issues/4465) (Configuration): Implement support for namespaces
-* [#4464](https://github.com/Icinga/icinga2/issues/4464) (CLI): Implement support for inspecting variables with LLDB/GDB
-* [#4457](https://github.com/Icinga/icinga2/issues/4457): Implement support for marking functions as deprecated
-* [#4454](https://github.com/Icinga/icinga2/issues/4454): Include compiler name/version and build host name in --version
-* [#4451](https://github.com/Icinga/icinga2/issues/4451) (Configuration): Move internal script functions into the 'Internal' namespace
-* [#4449](https://github.com/Icinga/icinga2/issues/4449): Improve logging for the WorkQueue class
-* [#4445](https://github.com/Icinga/icinga2/issues/4445): Rename/Remove experimental script functions
-* [#4443](https://github.com/Icinga/icinga2/issues/4443): Implement process\_check\_result script method for the Checkable class
-* [#4442](https://github.com/Icinga/icinga2/issues/4442) (API): Support for determining the Icinga 2 version via the API
-* [#4431](https://github.com/Icinga/icinga2/issues/4431) (Notifications): Add the notification type into the log message
-* [#4424](https://github.com/Icinga/icinga2/issues/4424) (Cluster): Enhance TLS handshake error messages with connection information
-* [#4415](https://github.com/Icinga/icinga2/issues/4415) (API): Remove obsolete debug log message
-* [#4410](https://github.com/Icinga/icinga2/issues/4410) (Configuration): Add map/reduce and filter functionality for the Array class
-* [#4403](https://github.com/Icinga/icinga2/issues/4403) (CLI): Add history for icinga2 console
-* [#4398](https://github.com/Icinga/icinga2/issues/4398) (Cluster): Log a warning if there are more than 2 zone endpoint members
-* [#4393](https://github.com/Icinga/icinga2/issues/4393) (Cluster): Include IP address and port in the "New connection" log message
-* [#4388](https://github.com/Icinga/icinga2/issues/4388) (Configuration): Implement the \_\_ptr script function
-* [#4386](https://github.com/Icinga/icinga2/issues/4386) (Cluster): Improve error messages for failed certificate validation
-* [#4381](https://github.com/Icinga/icinga2/issues/4381) (Cluster): Improve log message for connecting nodes without configured Endpoint object
-* [#4352](https://github.com/Icinga/icinga2/issues/4352) (Cluster): Enhance client disconnect message for "No data received on new API connection."
-* [#4348](https://github.com/Icinga/icinga2/issues/4348) (DB IDO): Do not populate logentries table by default
-* [#4325](https://github.com/Icinga/icinga2/issues/4325) (API): API: Add missing downtime\_depth attribute
-* [#4314](https://github.com/Icinga/icinga2/issues/4314) (DB IDO): Change Ido\*Connection 'categories' attribute to an array
-* [#4295](https://github.com/Icinga/icinga2/issues/4295) (DB IDO): Enhance IDO check with schema version info
-* [#4294](https://github.com/Icinga/icinga2/issues/4294) (DB IDO): Update DB IDO schema version to 1.14.1
-* [#4290](https://github.com/Icinga/icinga2/issues/4290) (API): Implement support for getting a list of global variables from the API
-* [#4281](https://github.com/Icinga/icinga2/issues/4281) (API): Support for enumerating available templates via the API
-* [#4268](https://github.com/Icinga/icinga2/issues/4268) (Performance Data): InfluxDB Metadata
-* [#4206](https://github.com/Icinga/icinga2/issues/4206) (Cluster): Add lag threshold for cluster-zone check
-* [#4178](https://github.com/Icinga/icinga2/issues/4178) (API): Improve logging for HTTP API requests
-* [#4154](https://github.com/Icinga/icinga2/issues/4154) (Configuration): Remove the \(unused\) 'inherits' keyword
-* [#4129](https://github.com/Icinga/icinga2/issues/4129) (Configuration): Improve performance for field accesses
-* [#4061](https://github.com/Icinga/icinga2/issues/4061) (Configuration): Allow strings in state/type filters
-* [#4048](https://github.com/Icinga/icinga2/issues/4048): Cleanup downtimes created by ScheduleDowntime
-* [#4046](https://github.com/Icinga/icinga2/issues/4046) (Configuration): Config parser should not log names of included files by default
-* [#3999](https://github.com/Icinga/icinga2/issues/3999) (API): ApiListener: Make minimum TLS version configurable
-* [#3997](https://github.com/Icinga/icinga2/issues/3997) (API): ApiListener: Force server's preferred cipher
-* [#3911](https://github.com/Icinga/icinga2/issues/3911) (Graphite): Add acknowledgement type to Graphite, InfluxDB, OpenTSDB metadata
-* [#3888](https://github.com/Icinga/icinga2/issues/3888) (API): Implement SSL cipher configuration support for the API feature
-* [#3763](https://github.com/Icinga/icinga2/issues/3763): Add name attribute for WorkQueue class
-* [#3562](https://github.com/Icinga/icinga2/issues/3562) (Performance Data): Add InfluxDbWriter feature
-* [#3400](https://github.com/Icinga/icinga2/issues/3400): Remove the deprecated IcingaStatusWriter feature
-* [#3237](https://github.com/Icinga/icinga2/issues/3237) (Performance Data): Gelf module: expose 'perfdata' fields for 'CHECK\_RESULT' events
-* [#3224](https://github.com/Icinga/icinga2/issues/3224) (Configuration): Implement support for formatting date/time
-* [#3178](https://github.com/Icinga/icinga2/issues/3178) (DB IDO): Add SSL support for the IdoMysqlConnection feature
-* [#2970](https://github.com/Icinga/icinga2/issues/2970) (Performance Data): Add timestamp support for GelfWriter
-* [#2040](https://github.com/Icinga/icinga2/issues/2040): Exclude option for TimePeriod definitions
+* [#4516](https://github.com/icinga/icinga2/issues/4516): Remove some unused \#includes
+* [#4498](https://github.com/icinga/icinga2/issues/4498): Remove unnecessary Dictionary::Contains calls
+* [#4493](https://github.com/icinga/icinga2/issues/4493) (Cluster): Improve performance for Endpoint config validation
+* [#4491](https://github.com/icinga/icinga2/issues/4491): Improve performance for type lookups
+* [#4487](https://github.com/icinga/icinga2/issues/4487) (DB IDO): Incremental updates for the IDO database
+* [#4486](https://github.com/icinga/icinga2/issues/4486) (DB IDO): Remove unused code from the IDO classes
+* [#4485](https://github.com/icinga/icinga2/issues/4485) (API): Add API action for generating a PKI ticket
+* [#4479](https://github.com/icinga/icinga2/issues/4479) (Configuration): Implement comparison operators for the Array class
+* [#4467](https://github.com/icinga/icinga2/issues/4467): Implement the System\#sleep function
+* [#4465](https://github.com/icinga/icinga2/issues/4465) (Configuration): Implement support for namespaces
+* [#4464](https://github.com/icinga/icinga2/issues/4464) (CLI): Implement support for inspecting variables with LLDB/GDB
+* [#4457](https://github.com/icinga/icinga2/issues/4457): Implement support for marking functions as deprecated
+* [#4454](https://github.com/icinga/icinga2/issues/4454): Include compiler name/version and build host name in --version
+* [#4451](https://github.com/icinga/icinga2/issues/4451) (Configuration): Move internal script functions into the 'Internal' namespace
+* [#4449](https://github.com/icinga/icinga2/issues/4449): Improve logging for the WorkQueue class
+* [#4445](https://github.com/icinga/icinga2/issues/4445): Rename/Remove experimental script functions
+* [#4443](https://github.com/icinga/icinga2/issues/4443): Implement process\_check\_result script method for the Checkable class
+* [#4442](https://github.com/icinga/icinga2/issues/4442) (API): Support for determining the Icinga 2 version via the API
+* [#4431](https://github.com/icinga/icinga2/issues/4431) (Notifications): Add the notification type into the log message
+* [#4424](https://github.com/icinga/icinga2/issues/4424) (Cluster): Enhance TLS handshake error messages with connection information
+* [#4415](https://github.com/icinga/icinga2/issues/4415) (API): Remove obsolete debug log message
+* [#4410](https://github.com/icinga/icinga2/issues/4410) (Configuration): Add map/reduce and filter functionality for the Array class
+* [#4403](https://github.com/icinga/icinga2/issues/4403) (CLI): Add history for icinga2 console
+* [#4398](https://github.com/icinga/icinga2/issues/4398) (Cluster): Log a warning if there are more than 2 zone endpoint members
+* [#4393](https://github.com/icinga/icinga2/issues/4393) (Cluster): Include IP address and port in the "New connection" log message
+* [#4388](https://github.com/icinga/icinga2/issues/4388) (Configuration): Implement the \_\_ptr script function
+* [#4386](https://github.com/icinga/icinga2/issues/4386) (Cluster): Improve error messages for failed certificate validation
+* [#4381](https://github.com/icinga/icinga2/issues/4381) (Cluster): Improve log message for connecting nodes without configured Endpoint object
+* [#4352](https://github.com/icinga/icinga2/issues/4352) (Cluster): Enhance client disconnect message for "No data received on new API connection."
+* [#4348](https://github.com/icinga/icinga2/issues/4348) (DB IDO): Do not populate logentries table by default
+* [#4325](https://github.com/icinga/icinga2/issues/4325) (API): API: Add missing downtime\_depth attribute
+* [#4314](https://github.com/icinga/icinga2/issues/4314) (DB IDO): Change Ido\*Connection 'categories' attribute to an array
+* [#4295](https://github.com/icinga/icinga2/issues/4295) (DB IDO): Enhance IDO check with schema version info
+* [#4294](https://github.com/icinga/icinga2/issues/4294) (DB IDO): Update DB IDO schema version to 1.14.1
+* [#4290](https://github.com/icinga/icinga2/issues/4290) (API): Implement support for getting a list of global variables from the API
+* [#4281](https://github.com/icinga/icinga2/issues/4281) (API): Support for enumerating available templates via the API
+* [#4268](https://github.com/icinga/icinga2/issues/4268) (Metrics): InfluxDB Metadata
+* [#4206](https://github.com/icinga/icinga2/issues/4206) (Cluster): Add lag threshold for cluster-zone check
+* [#4178](https://github.com/icinga/icinga2/issues/4178) (API): Improve logging for HTTP API requests
+* [#4154](https://github.com/icinga/icinga2/issues/4154) (Configuration): Remove the \(unused\) 'inherits' keyword
+* [#4129](https://github.com/icinga/icinga2/issues/4129) (Configuration): Improve performance for field accesses
+* [#4061](https://github.com/icinga/icinga2/issues/4061) (Configuration): Allow strings in state/type filters
+* [#4048](https://github.com/icinga/icinga2/issues/4048): Cleanup downtimes created by ScheduleDowntime
+* [#4046](https://github.com/icinga/icinga2/issues/4046) (Configuration): Config parser should not log names of included files by default
+* [#3999](https://github.com/icinga/icinga2/issues/3999) (API): ApiListener: Make minimum TLS version configurable
+* [#3997](https://github.com/icinga/icinga2/issues/3997) (API): ApiListener: Force server's preferred cipher
+* [#3911](https://github.com/icinga/icinga2/issues/3911) (Graphite): Add acknowledgement type to Graphite, InfluxDB, OpenTSDB metadata
+* [#3888](https://github.com/icinga/icinga2/issues/3888) (API): Implement SSL cipher configuration support for the API feature
+* [#3763](https://github.com/icinga/icinga2/issues/3763): Add name attribute for WorkQueue class
+* [#3562](https://github.com/icinga/icinga2/issues/3562) (Metrics): Add InfluxDbWriter feature
+* [#3400](https://github.com/icinga/icinga2/issues/3400): Remove the deprecated IcingaStatusWriter feature
+* [#3237](https://github.com/icinga/icinga2/issues/3237) (Metrics): Gelf module: expose 'perfdata' fields for 'CHECK\_RESULT' events
+* [#3224](https://github.com/icinga/icinga2/issues/3224) (Configuration): Implement support for formatting date/time
+* [#3178](https://github.com/icinga/icinga2/issues/3178) (DB IDO): Add SSL support for the IdoMysqlConnection feature
+* [#2970](https://github.com/icinga/icinga2/issues/2970) (Metrics): Add timestamp support for GelfWriter
+* [#2040](https://github.com/icinga/icinga2/issues/2040): Exclude option for TimePeriod definitions
### Bug
-* [#4534](https://github.com/Icinga/icinga2/issues/4534) (CLI): Icinga2 segault on startup
-* [#4524](https://github.com/Icinga/icinga2/issues/4524) (API): API Remote crash via Google Chrome
-* [#4520](https://github.com/Icinga/icinga2/issues/4520) (Configuration): Memory leak when using closures
-* [#4512](https://github.com/Icinga/icinga2/issues/4512) (Cluster): Incorrect certificate validation error message
-* [#4511](https://github.com/Icinga/icinga2/issues/4511): ClrCheck is null on \*nix
-* [#4505](https://github.com/Icinga/icinga2/issues/4505) (CLI): Cannot set ownership for user 'icinga' group 'icinga' on file '/var/lib/icinga2/ca/serial.txt'.
-* [#4504](https://github.com/Icinga/icinga2/issues/4504) (API): API: events for DowntimeTriggered does not provide needed information
-* [#4502](https://github.com/Icinga/icinga2/issues/4502) (DB IDO): IDO query fails due to key contraint violation for the icinga\_customvariablestatus table
-* [#4501](https://github.com/Icinga/icinga2/issues/4501) (Cluster): DB IDO started before daemonizing \(no systemd\)
-* [#4500](https://github.com/Icinga/icinga2/issues/4500) (DB IDO): Query for customvariablestatus incorrectly updates the host's/service's insert ID
-* [#4499](https://github.com/Icinga/icinga2/issues/4499) (DB IDO): Insert fails for the icinga\_scheduleddowntime table due to duplicate key
-* [#4497](https://github.com/Icinga/icinga2/issues/4497): Fix incorrect detection of the 'Concurrency' variable
-* [#4496](https://github.com/Icinga/icinga2/issues/4496) (API): API: action schedule-downtime requires a duration also when fixed is true
-* [#4495](https://github.com/Icinga/icinga2/issues/4495): Use hash-based serial numbers for new certificates
-* [#4490](https://github.com/Icinga/icinga2/issues/4490) (Cluster): ClusterEvents::NotificationSentAllUsersAPIHandler\(\) does not set notified\_users
-* [#4488](https://github.com/Icinga/icinga2/issues/4488): Replace GetType\(\)-\>GetName\(\) calls with GetReflectionType\(\)-\>GetName\(\)
-* [#4484](https://github.com/Icinga/icinga2/issues/4484) (Cluster): Only allow sending command\_endpoint checks to directly connected child zones
-* [#4483](https://github.com/Icinga/icinga2/issues/4483) (DB IDO): ido CheckCommand returns returns "Could not connect to database server" when HA enabled
-* [#4481](https://github.com/Icinga/icinga2/issues/4481) (DB IDO): Fix the "ido" check command for use with command\_endpoint
-* [#4478](https://github.com/Icinga/icinga2/issues/4478): CompatUtility::GetCheckableNotificationStateFilter is returning an incorrect value
-* [#4476](https://github.com/Icinga/icinga2/issues/4476) (DB IDO): Importing mysql schema fails
-* [#4475](https://github.com/Icinga/icinga2/issues/4475) (CLI): pki sign-csr does not log where it is writing the certificate file
-* [#4472](https://github.com/Icinga/icinga2/issues/4472) (DB IDO): IDO marks objects as inactive on shutdown
-* [#4471](https://github.com/Icinga/icinga2/issues/4471) (DB IDO): IDO does duplicate config updates
-* [#4466](https://github.com/Icinga/icinga2/issues/4466) (Configuration): 'use' keyword cannot be used with templates
-* [#4462](https://github.com/Icinga/icinga2/issues/4462) (Notifications): Add log message if notifications are forced \(i.e. filters are not checked\)
-* [#4461](https://github.com/Icinga/icinga2/issues/4461) (Notifications): Notification resent, even if interval = 0
-* [#4460](https://github.com/Icinga/icinga2/issues/4460) (DB IDO): Fixed downtime start does not update actual\_start\_time
-* [#4458](https://github.com/Icinga/icinga2/issues/4458): Flexible downtimes should be removed after trigger\_time+duration
-* [#4455](https://github.com/Icinga/icinga2/issues/4455): Disallow casting "" to an Object
-* [#4447](https://github.com/Icinga/icinga2/issues/4447): Handle I/O errors while writing the Icinga state file more gracefully
-* [#4446](https://github.com/Icinga/icinga2/issues/4446) (Notifications): Incorrect downtime notification events
-* [#4444](https://github.com/Icinga/icinga2/issues/4444): Fix building Icinga with -fvisibility=hidden
-* [#4439](https://github.com/Icinga/icinga2/issues/4439) (Configuration): Icinga doesn't delete temporary icinga2.debug file when config validation fails
-* [#4434](https://github.com/Icinga/icinga2/issues/4434) (Notifications): Notification sent too fast when one master fails
-* [#4430](https://github.com/Icinga/icinga2/issues/4430) (Cluster): Remove obsolete README files in tools/syntax
-* [#4427](https://github.com/Icinga/icinga2/issues/4427) (Notifications): Missing notification for recovery during downtime
-* [#4425](https://github.com/Icinga/icinga2/issues/4425) (DB IDO): Change the way outdated comments/downtimes are deleted on restart
-* [#4420](https://github.com/Icinga/icinga2/issues/4420) (Notifications): Multiple notifications when master fails
-* [#4418](https://github.com/Icinga/icinga2/issues/4418) (DB IDO): icinga2 IDO reload performance significant slower with latest snapshot release
-* [#4417](https://github.com/Icinga/icinga2/issues/4417) (Notifications): Notification interval mistimed
-* [#4413](https://github.com/Icinga/icinga2/issues/4413) (DB IDO): icinga2 empties custom variables, host-, servcie- and contactgroup members at the end of IDO database reconnection
-* [#4412](https://github.com/Icinga/icinga2/issues/4412) (Notifications): Reminder notifications ignore HA mode
-* [#4405](https://github.com/Icinga/icinga2/issues/4405) (DB IDO): Deprecation warning should include object type and name
-* [#4401](https://github.com/Icinga/icinga2/issues/4401) (Performance Data): Incorrect escaping / formatting of perfdata to InfluxDB
-* [#4399](https://github.com/Icinga/icinga2/issues/4399): Icinga stats min\_execution\_time and max\_execution\_time are invalid
-* [#4394](https://github.com/Icinga/icinga2/issues/4394): icinga check reports "-1" for minimum latency and execution time and only uptime has a number but 0
-* [#4391](https://github.com/Icinga/icinga2/issues/4391) (DB IDO): Do not clear {host,service,contact}group\_members tables on restart
-* [#4384](https://github.com/Icinga/icinga2/issues/4384) (API): Fix URL encoding for '&'
-* [#4380](https://github.com/Icinga/icinga2/issues/4380) (Cluster): Increase cluster reconnect interval
-* [#4378](https://github.com/Icinga/icinga2/issues/4378) (Notifications): Optimize two ObjectLocks into one in Notification::BeginExecuteNotification method
-* [#4376](https://github.com/Icinga/icinga2/issues/4376) (Cluster): CheckerComponent sometimes fails to schedule checks in time
-* [#4375](https://github.com/Icinga/icinga2/issues/4375) (Cluster): Duplicate messages for command\_endpoint w/ master and satellite
-* [#4372](https://github.com/Icinga/icinga2/issues/4372) (API): state\_filters\_real shouldn't be visible in the API
-* [#4371](https://github.com/Icinga/icinga2/issues/4371) (Notifications): notification.notification\_number runtime attribute returning 0 \(instead of 1\) in first notification e-mail
-* [#4370](https://github.com/Icinga/icinga2/issues/4370): Test the change with HARD OK transitions
-* [#4363](https://github.com/Icinga/icinga2/issues/4363) (DB IDO): IDO module starts threads before daemonize
-* [#4356](https://github.com/Icinga/icinga2/issues/4356) (DB IDO): DB IDO query queue does not clean up with v2.4.10-520-g124c80b
-* [#4349](https://github.com/Icinga/icinga2/issues/4349) (DB IDO): Add missing index on state history for DB IDO cleanup
-* [#4345](https://github.com/Icinga/icinga2/issues/4345): Ensure to clear the SSL error queue before calling SSL\_{read,write,do\_handshake}
-* [#4343](https://github.com/Icinga/icinga2/issues/4343) (Configuration): include\_recursive should gracefully handle inaccessible files
-* [#4341](https://github.com/Icinga/icinga2/issues/4341) (API): Icinga incorrectly disconnects all endpoints if one has a wrong certificate
-* [#4340](https://github.com/Icinga/icinga2/issues/4340) (DB IDO): deadlock in ido reconnect
-* [#4329](https://github.com/Icinga/icinga2/issues/4329) (Performance Data): Key Escapes in InfluxDB Writer Don't Work
-* [#4313](https://github.com/Icinga/icinga2/issues/4313) (Configuration): Icinga crashes when using include\_recursive in an object definition
-* [#4309](https://github.com/Icinga/icinga2/issues/4309) (Configuration): ConfigWriter::EmitScope incorrectly quotes dictionary keys
-* [#4300](https://github.com/Icinga/icinga2/issues/4300) (DB IDO): Comment/Downtime delete queries are slow
-* [#4293](https://github.com/Icinga/icinga2/issues/4293) (DB IDO): Overflow in current\_notification\_number column in DB IDO MySQL
-* [#4287](https://github.com/Icinga/icinga2/issues/4287) (DB IDO): Program status table is not updated in IDO after starting icinga
-* [#4283](https://github.com/Icinga/icinga2/issues/4283) (Cluster): Icinga 2 satellite crashes
-* [#4278](https://github.com/Icinga/icinga2/issues/4278) (DB IDO): SOFT state changes with the same state are not logged
-* [#4275](https://github.com/Icinga/icinga2/issues/4275) (API): Trying to delete an object protected by a permissions filter, ends up deleting all objects that match the filter instead
-* [#4274](https://github.com/Icinga/icinga2/issues/4274) (Notifications): Duplicate notifications
-* [#4264](https://github.com/Icinga/icinga2/issues/4264) (Performance Data): InfluxWriter doesnt sanitize the data before sending
-* [#4259](https://github.com/Icinga/icinga2/issues/4259): Flapping Notifications dependent on state change
-* [#4258](https://github.com/Icinga/icinga2/issues/4258): last SOFT state should be hard \(max\_check\_attempts\)
-* [#4257](https://github.com/Icinga/icinga2/issues/4257) (Configuration): Incorrect custom variable name in the hosts.conf example config
-* [#4255](https://github.com/Icinga/icinga2/issues/4255) (Configuration): Config validation should not delete comments/downtimes w/o reference
-* [#4244](https://github.com/Icinga/icinga2/issues/4244): SOFT OK-state after returning from a soft state
-* [#4239](https://github.com/Icinga/icinga2/issues/4239) (Notifications): Downtime notifications do not pass author and comment
-* [#4232](https://github.com/Icinga/icinga2/issues/4232): Problems with check scheduling for HARD state changes \(standalone/command\_endpoint\)
-* [#4231](https://github.com/Icinga/icinga2/issues/4231) (DB IDO): Volatile check results for OK-\>OK transitions are logged into DB IDO statehistory
-* [#4187](https://github.com/Icinga/icinga2/issues/4187): Icinga 2 client gets killed during network scans
-* [#4171](https://github.com/Icinga/icinga2/issues/4171) (DB IDO): Outdated downtime/comments not removed from IDO database \(restart\)
-* [#4134](https://github.com/Icinga/icinga2/issues/4134) (Configuration): Don't allow flow control keywords outside of other flow control constructs
-* [#4121](https://github.com/Icinga/icinga2/issues/4121) (Notifications): notification interval = 0 not honoured in HA clusters
-* [#4106](https://github.com/Icinga/icinga2/issues/4106) (Notifications): last\_problem\_notification should be synced in HA cluster
-* [#4077](https://github.com/Icinga/icinga2/issues/4077): Numbers are not properly formatted in runtime macro strings
-* [#4002](https://github.com/Icinga/icinga2/issues/4002): Don't violate POSIX by ensuring that the argument to usleep\(3\) is less than 1000000
-* [#3954](https://github.com/Icinga/icinga2/issues/3954) (Cluster): High load when pinning command endpoint on HA cluster
-* [#3949](https://github.com/Icinga/icinga2/issues/3949) (DB IDO): IDO: entry\_time of all comments is set to the date and time when Icinga 2 was restarted
-* [#3902](https://github.com/Icinga/icinga2/issues/3902): Hang in TlsStream::Handshake
-* [#3820](https://github.com/Icinga/icinga2/issues/3820) (Configuration): High CPU usage with self-referenced parent zone config
-* [#3805](https://github.com/Icinga/icinga2/issues/3805) (Performance Data): GELF multi-line output
-* [#3627](https://github.com/Icinga/icinga2/issues/3627) (API): /v1 returns HTML even if JSON is requested
-* [#3486](https://github.com/Icinga/icinga2/issues/3486) (Notifications): Notification times w/ empty begin/end specifications prevent sending notifications
-* [#3370](https://github.com/Icinga/icinga2/issues/3370): Race condition in CreatePipeOverlapped
-* [#3365](https://github.com/Icinga/icinga2/issues/3365) (DB IDO): IDO: there is no usable object index on icinga\_{scheduleddowntime,comments}
-* [#3364](https://github.com/Icinga/icinga2/issues/3364) (DB IDO): IDO: check\_source should not be a TEXT field
-* [#3361](https://github.com/Icinga/icinga2/issues/3361) (DB IDO): Missing indexes for icinga\_endpoints\* and icinga\_zones\* tables in DB IDO schema
-* [#3355](https://github.com/Icinga/icinga2/issues/3355) (DB IDO): IDO: icinga\_host/service\_groups alias columns are TEXT columns
-* [#3229](https://github.com/Icinga/icinga2/issues/3229): Function::Invoke should optionally register ScriptFrame
-* [#2996](https://github.com/Icinga/icinga2/issues/2996) (Cluster): Custom notification external commands do not work in a master-master setup
-* [#2039](https://github.com/Icinga/icinga2/issues/2039): Disable immediate hard state after first checkresult
+* [#4534](https://github.com/icinga/icinga2/issues/4534) (CLI): Icinga2 segault on startup
+* [#4524](https://github.com/icinga/icinga2/issues/4524) (API): API Remote crash via Google Chrome
+* [#4520](https://github.com/icinga/icinga2/issues/4520) (Configuration): Memory leak when using closures
+* [#4512](https://github.com/icinga/icinga2/issues/4512) (Cluster): Incorrect certificate validation error message
+* [#4511](https://github.com/icinga/icinga2/issues/4511): ClrCheck is null on \*nix
+* [#4505](https://github.com/icinga/icinga2/issues/4505) (CLI): Cannot set ownership for user 'icinga' group 'icinga' on file '/var/lib/icinga2/ca/serial.txt'.
+* [#4504](https://github.com/icinga/icinga2/issues/4504) (API): API: events for DowntimeTriggered does not provide needed information
+* [#4502](https://github.com/icinga/icinga2/issues/4502) (DB IDO): IDO query fails due to key contraint violation for the icinga\_customvariablestatus table
+* [#4501](https://github.com/icinga/icinga2/issues/4501) (Cluster): DB IDO started before daemonizing \(no systemd\)
+* [#4500](https://github.com/icinga/icinga2/issues/4500) (DB IDO): Query for customvariablestatus incorrectly updates the host's/service's insert ID
+* [#4499](https://github.com/icinga/icinga2/issues/4499) (DB IDO): Insert fails for the icinga\_scheduleddowntime table due to duplicate key
+* [#4497](https://github.com/icinga/icinga2/issues/4497): Fix incorrect detection of the 'Concurrency' variable
+* [#4496](https://github.com/icinga/icinga2/issues/4496) (API): API: action schedule-downtime requires a duration also when fixed is true
+* [#4495](https://github.com/icinga/icinga2/issues/4495): Use hash-based serial numbers for new certificates
+* [#4490](https://github.com/icinga/icinga2/issues/4490) (Cluster): ClusterEvents::NotificationSentAllUsersAPIHandler\(\) does not set notified\_users
+* [#4488](https://github.com/icinga/icinga2/issues/4488): Replace GetType\(\)-\>GetName\(\) calls with GetReflectionType\(\)-\>GetName\(\)
+* [#4484](https://github.com/icinga/icinga2/issues/4484) (Cluster): Only allow sending command\_endpoint checks to directly connected child zones
+* [#4483](https://github.com/icinga/icinga2/issues/4483) (DB IDO): ido CheckCommand returns returns "Could not connect to database server" when HA enabled
+* [#4481](https://github.com/icinga/icinga2/issues/4481) (DB IDO): Fix the "ido" check command for use with command\_endpoint
+* [#4478](https://github.com/icinga/icinga2/issues/4478): CompatUtility::GetCheckableNotificationStateFilter is returning an incorrect value
+* [#4476](https://github.com/icinga/icinga2/issues/4476) (DB IDO): Importing mysql schema fails
+* [#4475](https://github.com/icinga/icinga2/issues/4475) (CLI): pki sign-csr does not log where it is writing the certificate file
+* [#4472](https://github.com/icinga/icinga2/issues/4472) (DB IDO): IDO marks objects as inactive on shutdown
+* [#4471](https://github.com/icinga/icinga2/issues/4471) (DB IDO): IDO does duplicate config updates
+* [#4466](https://github.com/icinga/icinga2/issues/4466) (Configuration): 'use' keyword cannot be used with templates
+* [#4462](https://github.com/icinga/icinga2/issues/4462) (Notifications): Add log message if notifications are forced \(i.e. filters are not checked\)
+* [#4461](https://github.com/icinga/icinga2/issues/4461) (Notifications): Notification resent, even if interval = 0
+* [#4460](https://github.com/icinga/icinga2/issues/4460) (DB IDO): Fixed downtime start does not update actual\_start\_time
+* [#4458](https://github.com/icinga/icinga2/issues/4458): Flexible downtimes should be removed after trigger\_time+duration
+* [#4455](https://github.com/icinga/icinga2/issues/4455): Disallow casting "" to an Object
+* [#4447](https://github.com/icinga/icinga2/issues/4447): Handle I/O errors while writing the Icinga state file more gracefully
+* [#4446](https://github.com/icinga/icinga2/issues/4446) (Notifications): Incorrect downtime notification events
+* [#4444](https://github.com/icinga/icinga2/issues/4444): Fix building Icinga with -fvisibility=hidden
+* [#4439](https://github.com/icinga/icinga2/issues/4439) (Configuration): Icinga doesn't delete temporary icinga2.debug file when config validation fails
+* [#4434](https://github.com/icinga/icinga2/issues/4434) (Notifications): Notification sent too fast when one master fails
+* [#4430](https://github.com/icinga/icinga2/issues/4430) (Cluster): Remove obsolete README files in tools/syntax
+* [#4427](https://github.com/icinga/icinga2/issues/4427) (Notifications): Missing notification for recovery during downtime
+* [#4425](https://github.com/icinga/icinga2/issues/4425) (DB IDO): Change the way outdated comments/downtimes are deleted on restart
+* [#4420](https://github.com/icinga/icinga2/issues/4420) (Notifications): Multiple notifications when master fails
+* [#4418](https://github.com/icinga/icinga2/issues/4418) (DB IDO): icinga2 IDO reload performance significant slower with latest snapshot release
+* [#4417](https://github.com/icinga/icinga2/issues/4417) (Notifications): Notification interval mistimed
+* [#4413](https://github.com/icinga/icinga2/issues/4413) (DB IDO): icinga2 empties custom variables, host-, servcie- and contactgroup members at the end of IDO database reconnection
+* [#4412](https://github.com/icinga/icinga2/issues/4412) (Notifications): Reminder notifications ignore HA mode
+* [#4405](https://github.com/icinga/icinga2/issues/4405) (DB IDO): Deprecation warning should include object type and name
+* [#4401](https://github.com/icinga/icinga2/issues/4401) (Metrics): Incorrect escaping / formatting of perfdata to InfluxDB
+* [#4399](https://github.com/icinga/icinga2/issues/4399): Icinga stats min\_execution\_time and max\_execution\_time are invalid
+* [#4394](https://github.com/icinga/icinga2/issues/4394): icinga check reports "-1" for minimum latency and execution time and only uptime has a number but 0
+* [#4391](https://github.com/icinga/icinga2/issues/4391) (DB IDO): Do not clear {host,service,contact}group\_members tables on restart
+* [#4384](https://github.com/icinga/icinga2/issues/4384) (API): Fix URL encoding for '&'
+* [#4380](https://github.com/icinga/icinga2/issues/4380) (Cluster): Increase cluster reconnect interval
+* [#4378](https://github.com/icinga/icinga2/issues/4378) (Notifications): Optimize two ObjectLocks into one in Notification::BeginExecuteNotification method
+* [#4376](https://github.com/icinga/icinga2/issues/4376) (Cluster): CheckerComponent sometimes fails to schedule checks in time
+* [#4375](https://github.com/icinga/icinga2/issues/4375) (Cluster): Duplicate messages for command\_endpoint w/ master and satellite
+* [#4372](https://github.com/icinga/icinga2/issues/4372) (API): state\_filters\_real shouldn't be visible in the API
+* [#4371](https://github.com/icinga/icinga2/issues/4371) (Notifications): notification.notification\_number runtime attribute returning 0 \(instead of 1\) in first notification e-mail
+* [#4370](https://github.com/icinga/icinga2/issues/4370): Test the change with HARD OK transitions
+* [#4363](https://github.com/icinga/icinga2/issues/4363) (DB IDO): IDO module starts threads before daemonize
+* [#4356](https://github.com/icinga/icinga2/issues/4356) (DB IDO): DB IDO query queue does not clean up with v2.4.10-520-g124c80b
+* [#4349](https://github.com/icinga/icinga2/issues/4349) (DB IDO): Add missing index on state history for DB IDO cleanup
+* [#4345](https://github.com/icinga/icinga2/issues/4345): Ensure to clear the SSL error queue before calling SSL\_{read,write,do\_handshake}
+* [#4343](https://github.com/icinga/icinga2/issues/4343) (Configuration): include\_recursive should gracefully handle inaccessible files
+* [#4341](https://github.com/icinga/icinga2/issues/4341) (API): Icinga incorrectly disconnects all endpoints if one has a wrong certificate
+* [#4340](https://github.com/icinga/icinga2/issues/4340) (DB IDO): deadlock in ido reconnect
+* [#4329](https://github.com/icinga/icinga2/issues/4329) (Metrics): Key Escapes in InfluxDB Writer Don't Work
+* [#4313](https://github.com/icinga/icinga2/issues/4313) (Configuration): Icinga crashes when using include\_recursive in an object definition
+* [#4309](https://github.com/icinga/icinga2/issues/4309) (Configuration): ConfigWriter::EmitScope incorrectly quotes dictionary keys
+* [#4300](https://github.com/icinga/icinga2/issues/4300) (DB IDO): Comment/Downtime delete queries are slow
+* [#4293](https://github.com/icinga/icinga2/issues/4293) (DB IDO): Overflow in current\_notification\_number column in DB IDO MySQL
+* [#4287](https://github.com/icinga/icinga2/issues/4287) (DB IDO): Program status table is not updated in IDO after starting icinga
+* [#4283](https://github.com/icinga/icinga2/issues/4283) (Cluster): Icinga 2 satellite crashes
+* [#4278](https://github.com/icinga/icinga2/issues/4278) (DB IDO): SOFT state changes with the same state are not logged
+* [#4275](https://github.com/icinga/icinga2/issues/4275) (API): Trying to delete an object protected by a permissions filter, ends up deleting all objects that match the filter instead
+* [#4274](https://github.com/icinga/icinga2/issues/4274) (Notifications): Duplicate notifications
+* [#4264](https://github.com/icinga/icinga2/issues/4264) (Metrics): InfluxWriter doesnt sanitize the data before sending
+* [#4259](https://github.com/icinga/icinga2/issues/4259): Flapping Notifications dependent on state change
+* [#4258](https://github.com/icinga/icinga2/issues/4258): last SOFT state should be hard \(max\_check\_attempts\)
+* [#4257](https://github.com/icinga/icinga2/issues/4257) (Configuration): Incorrect custom variable name in the hosts.conf example config
+* [#4255](https://github.com/icinga/icinga2/issues/4255) (Configuration): Config validation should not delete comments/downtimes w/o reference
+* [#4244](https://github.com/icinga/icinga2/issues/4244): SOFT OK-state after returning from a soft state
+* [#4239](https://github.com/icinga/icinga2/issues/4239) (Notifications): Downtime notifications do not pass author and comment
+* [#4232](https://github.com/icinga/icinga2/issues/4232): Problems with check scheduling for HARD state changes \(standalone/command\_endpoint\)
+* [#4231](https://github.com/icinga/icinga2/issues/4231) (DB IDO): Volatile check results for OK-\>OK transitions are logged into DB IDO statehistory
+* [#4187](https://github.com/icinga/icinga2/issues/4187): Icinga 2 client gets killed during network scans
+* [#4171](https://github.com/icinga/icinga2/issues/4171) (DB IDO): Outdated downtime/comments not removed from IDO database \(restart\)
+* [#4134](https://github.com/icinga/icinga2/issues/4134) (Configuration): Don't allow flow control keywords outside of other flow control constructs
+* [#4121](https://github.com/icinga/icinga2/issues/4121) (Notifications): notification interval = 0 not honoured in HA clusters
+* [#4106](https://github.com/icinga/icinga2/issues/4106) (Notifications): last\_problem\_notification should be synced in HA cluster
+* [#4077](https://github.com/icinga/icinga2/issues/4077): Numbers are not properly formatted in runtime macro strings
+* [#4002](https://github.com/icinga/icinga2/issues/4002): Don't violate POSIX by ensuring that the argument to usleep\(3\) is less than 1000000
+* [#3954](https://github.com/icinga/icinga2/issues/3954) (Cluster): High load when pinning command endpoint on HA cluster
+* [#3949](https://github.com/icinga/icinga2/issues/3949) (DB IDO): IDO: entry\_time of all comments is set to the date and time when Icinga 2 was restarted
+* [#3902](https://github.com/icinga/icinga2/issues/3902): Hang in TlsStream::Handshake
+* [#3820](https://github.com/icinga/icinga2/issues/3820) (Configuration): High CPU usage with self-referenced parent zone config
+* [#3805](https://github.com/icinga/icinga2/issues/3805) (Metrics): GELF multi-line output
+* [#3627](https://github.com/icinga/icinga2/issues/3627) (API): /v1 returns HTML even if JSON is requested
+* [#3486](https://github.com/icinga/icinga2/issues/3486) (Notifications): Notification times w/ empty begin/end specifications prevent sending notifications
+* [#3370](https://github.com/icinga/icinga2/issues/3370): Race condition in CreatePipeOverlapped
+* [#3365](https://github.com/icinga/icinga2/issues/3365) (DB IDO): IDO: there is no usable object index on icinga\_{scheduleddowntime,comments}
+* [#3364](https://github.com/icinga/icinga2/issues/3364) (DB IDO): IDO: check\_source should not be a TEXT field
+* [#3361](https://github.com/icinga/icinga2/issues/3361) (DB IDO): Missing indexes for icinga\_endpoints\* and icinga\_zones\* tables in DB IDO schema
+* [#3355](https://github.com/icinga/icinga2/issues/3355) (DB IDO): IDO: icinga\_host/service\_groups alias columns are TEXT columns
+* [#3229](https://github.com/icinga/icinga2/issues/3229): Function::Invoke should optionally register ScriptFrame
+* [#2996](https://github.com/icinga/icinga2/issues/2996) (Cluster): Custom notification external commands do not work in a master-master setup
+* [#2039](https://github.com/icinga/icinga2/issues/2039): Disable immediate hard state after first checkresult
### ITL
-* [#4518](https://github.com/Icinga/icinga2/issues/4518) (ITL): ITL uses unsupported arguments for check\_swap on Debian wheezy/Ubuntu trusty
-* [#4506](https://github.com/Icinga/icinga2/issues/4506) (ITL): Add interfacetable CheckCommand options --trafficwithpkt and --snmp-maxmsgsize
-* [#4477](https://github.com/Icinga/icinga2/issues/4477) (ITL): Add perfsyntax parameter to nscp-local-counter CheckCommand
-* [#4456](https://github.com/Icinga/icinga2/issues/4456) (ITL): Add custom variables for all check\_swap arguments
-* [#4437](https://github.com/Icinga/icinga2/issues/4437) (ITL): Add command definition for check\_mysql\_query
-* [#4421](https://github.com/Icinga/icinga2/issues/4421) (ITL): -q option for check\_ntp\_time is wrong
-* [#4416](https://github.com/Icinga/icinga2/issues/4416) (ITL): Add check command definition for check\_graphite
-* [#4397](https://github.com/Icinga/icinga2/issues/4397) (ITL): A lot of missing parameters for \(latest\) mysql\_health
-* [#4379](https://github.com/Icinga/icinga2/issues/4379) (ITL): Add support for "-A" command line switch to CheckCommand "snmp-process"
-* [#4359](https://github.com/Icinga/icinga2/issues/4359) (ITL): ITL: check\_iftraffic64.pl default values, wrong postfix value in CheckCommand
-* [#4332](https://github.com/Icinga/icinga2/issues/4332) (ITL): Add check command definition for db2\_health
-* [#4305](https://github.com/Icinga/icinga2/issues/4305) (ITL): Add check command definitions for kdc and rbl
-* [#4297](https://github.com/Icinga/icinga2/issues/4297) (ITL): add check command for plugin check\_apache\_status
-* [#4276](https://github.com/Icinga/icinga2/issues/4276) (ITL): Adding option to access ifName for manubulon snmp-interface check command
-* [#4254](https://github.com/Icinga/icinga2/issues/4254) (ITL): Add "fuse.gvfsd-fuse" to the list of excluded file systems for check\_disk
-* [#4250](https://github.com/Icinga/icinga2/issues/4250) (ITL): Add CIM port parameter for esxi\_hardware CheckCommand
-* [#4023](https://github.com/Icinga/icinga2/issues/4023) (ITL): Add "retries" option to check\_snmp command
-* [#3711](https://github.com/Icinga/icinga2/issues/3711) (ITL): icinga2.conf: Include plugins-contrib, manubulon, windows-plugins, nscp by default
-* [#3683](https://github.com/Icinga/icinga2/issues/3683) (ITL): Add IPv4/IPv6 support to the rest of the monitoring-plugins
-* [#3012](https://github.com/Icinga/icinga2/issues/3012) (ITL): Extend CheckCommand definitions for nscp-local
+* [#4518](https://github.com/icinga/icinga2/issues/4518) (ITL): ITL uses unsupported arguments for check\_swap on Debian wheezy/Ubuntu trusty
+* [#4506](https://github.com/icinga/icinga2/issues/4506) (ITL): Add interfacetable CheckCommand options --trafficwithpkt and --snmp-maxmsgsize
+* [#4477](https://github.com/icinga/icinga2/issues/4477) (ITL): Add perfsyntax parameter to nscp-local-counter CheckCommand
+* [#4456](https://github.com/icinga/icinga2/issues/4456) (ITL): Add custom variables for all check\_swap arguments
+* [#4437](https://github.com/icinga/icinga2/issues/4437) (ITL): Add command definition for check\_mysql\_query
+* [#4421](https://github.com/icinga/icinga2/issues/4421) (ITL): -q option for check\_ntp\_time is wrong
+* [#4416](https://github.com/icinga/icinga2/issues/4416) (ITL): Add check command definition for check\_graphite
+* [#4397](https://github.com/icinga/icinga2/issues/4397) (ITL): A lot of missing parameters for \(latest\) mysql\_health
+* [#4379](https://github.com/icinga/icinga2/issues/4379) (ITL): Add support for "-A" command line switch to CheckCommand "snmp-process"
+* [#4359](https://github.com/icinga/icinga2/issues/4359) (ITL): ITL: check\_iftraffic64.pl default values, wrong postfix value in CheckCommand
+* [#4332](https://github.com/icinga/icinga2/issues/4332) (ITL): Add check command definition for db2\_health
+* [#4305](https://github.com/icinga/icinga2/issues/4305) (ITL): Add check command definitions for kdc and rbl
+* [#4297](https://github.com/icinga/icinga2/issues/4297) (ITL): add check command for plugin check\_apache\_status
+* [#4276](https://github.com/icinga/icinga2/issues/4276) (ITL): Adding option to access ifName for manubulon snmp-interface check command
+* [#4254](https://github.com/icinga/icinga2/issues/4254) (ITL): Add "fuse.gvfsd-fuse" to the list of excluded file systems for check\_disk
+* [#4250](https://github.com/icinga/icinga2/issues/4250) (ITL): Add CIM port parameter for esxi\_hardware CheckCommand
+* [#4023](https://github.com/icinga/icinga2/issues/4023) (ITL): Add "retries" option to check\_snmp command
+* [#3711](https://github.com/icinga/icinga2/issues/3711) (ITL): icinga2.conf: Include plugins-contrib, manubulon, windows-plugins, nscp by default
+* [#3683](https://github.com/icinga/icinga2/issues/3683) (ITL): Add IPv4/IPv6 support to the rest of the monitoring-plugins
+* [#3012](https://github.com/icinga/icinga2/issues/3012) (ITL): Extend CheckCommand definitions for nscp-local
### Documentation
-* [#4521](https://github.com/Icinga/icinga2/issues/4521) (Documentation): Typo in Notification object documentation
-* [#4517](https://github.com/Icinga/icinga2/issues/4517) (Documentation): Documentation is missing for the API permissions that are new in 2.5.0
-* [#4513](https://github.com/Icinga/icinga2/issues/4513) (Documentation): Development docs: Add own section for gdb backtrace from a running process
-* [#4510](https://github.com/Icinga/icinga2/issues/4510) (Documentation): Docs: API example uses wrong attribute name
-* [#4489](https://github.com/Icinga/icinga2/issues/4489) (Documentation): Missing documentation for "legacy-timeperiod" template
-* [#4470](https://github.com/Icinga/icinga2/issues/4470) (Documentation): The description for the http\_certificate attribute doesn't have the right default value
-* [#4468](https://github.com/Icinga/icinga2/issues/4468) (Documentation): Add URL and short description for Monitoring Plugins inside the ITL documentation
-* [#4453](https://github.com/Icinga/icinga2/issues/4453) (Documentation): Rewrite Client and Cluster chapter and; add service monitoring chapter
-* [#4419](https://github.com/Icinga/icinga2/issues/4419) (Documentation): Incorrect API permission name for /v1/status in the documentation
-* [#4396](https://github.com/Icinga/icinga2/issues/4396) (Documentation): Missing explanation for three level clusters with CSR auto-signing
-* [#4395](https://github.com/Icinga/icinga2/issues/4395) (Documentation): Incorrect documentation about apply rules in zones.d directories
-* [#4387](https://github.com/Icinga/icinga2/issues/4387) (Documentation): Improve author information about check\_yum
-* [#4361](https://github.com/Icinga/icinga2/issues/4361) (Documentation): pkg-config is not listed as a build requirement in INSTALL.md
-* [#4337](https://github.com/Icinga/icinga2/issues/4337) (Documentation): Add a note to the docs that API POST updates to custom attributes/groups won't trigger re-evaluation
-* [#4333](https://github.com/Icinga/icinga2/issues/4333) (Documentation): Documentation: Setting up Plugins section is broken
-* [#4328](https://github.com/Icinga/icinga2/issues/4328) (Documentation): Typo in Manubulon CheckCommand documentation
-* [#4318](https://github.com/Icinga/icinga2/issues/4318) (Documentation): Migration docs still show unsupported CHANGE\_\*MODATTR external commands
-* [#4306](https://github.com/Icinga/icinga2/issues/4306) (Documentation): Add a note about creating Zone/Endpoint objects with the API
-* [#4299](https://github.com/Icinga/icinga2/issues/4299) (Documentation): Incorrect URL for API examples in the documentation
-* [#4265](https://github.com/Icinga/icinga2/issues/4265) (Documentation): Improve "Endpoint" documentation
-* [#4263](https://github.com/Icinga/icinga2/issues/4263) (Documentation): Fix systemd client command formatting
-* [#4238](https://github.com/Icinga/icinga2/issues/4238) (Documentation): Missing quotes for API action URL
-* [#4236](https://github.com/Icinga/icinga2/issues/4236) (Documentation): Use HTTPS for debmon.org links in the documentation
-* [#4217](https://github.com/Icinga/icinga2/issues/4217) (Documentation): node setup: Add a note for --endpoint syntax for client-master connection
-* [#4124](https://github.com/Icinga/icinga2/issues/4124) (Documentation): Documentation review
-* [#3612](https://github.com/Icinga/icinga2/issues/3612) (Documentation): Update SELinux documentation
+* [#4521](https://github.com/icinga/icinga2/issues/4521) (Documentation): Typo in Notification object documentation
+* [#4517](https://github.com/icinga/icinga2/issues/4517) (Documentation): Documentation is missing for the API permissions that are new in 2.5.0
+* [#4513](https://github.com/icinga/icinga2/issues/4513) (Documentation): Development docs: Add own section for gdb backtrace from a running process
+* [#4510](https://github.com/icinga/icinga2/issues/4510) (Documentation): Docs: API example uses wrong attribute name
+* [#4489](https://github.com/icinga/icinga2/issues/4489) (Documentation): Missing documentation for "legacy-timeperiod" template
+* [#4470](https://github.com/icinga/icinga2/issues/4470) (Documentation): The description for the http\_certificate attribute doesn't have the right default value
+* [#4468](https://github.com/icinga/icinga2/issues/4468) (Documentation): Add URL and short description for Monitoring Plugins inside the ITL documentation
+* [#4453](https://github.com/icinga/icinga2/issues/4453) (Documentation): Rewrite Client and Cluster chapter and; add service monitoring chapter
+* [#4419](https://github.com/icinga/icinga2/issues/4419) (Documentation): Incorrect API permission name for /v1/status in the documentation
+* [#4396](https://github.com/icinga/icinga2/issues/4396) (Documentation): Missing explanation for three level clusters with CSR auto-signing
+* [#4395](https://github.com/icinga/icinga2/issues/4395) (Documentation): Incorrect documentation about apply rules in zones.d directories
+* [#4387](https://github.com/icinga/icinga2/issues/4387) (Documentation): Improve author information about check\_yum
+* [#4361](https://github.com/icinga/icinga2/issues/4361) (Documentation): pkg-config is not listed as a build requirement in INSTALL.md
+* [#4337](https://github.com/icinga/icinga2/issues/4337) (Documentation): Add a note to the docs that API POST updates to custom attributes/groups won't trigger re-evaluation
+* [#4333](https://github.com/icinga/icinga2/issues/4333) (Documentation): Documentation: Setting up Plugins section is broken
+* [#4328](https://github.com/icinga/icinga2/issues/4328) (Documentation): Typo in Manubulon CheckCommand documentation
+* [#4318](https://github.com/icinga/icinga2/issues/4318) (Documentation): Migration docs still show unsupported CHANGE\_\*MODATTR external commands
+* [#4306](https://github.com/icinga/icinga2/issues/4306) (Documentation): Add a note about creating Zone/Endpoint objects with the API
+* [#4299](https://github.com/icinga/icinga2/issues/4299) (Documentation): Incorrect URL for API examples in the documentation
+* [#4265](https://github.com/icinga/icinga2/issues/4265) (Documentation): Improve "Endpoint" documentation
+* [#4263](https://github.com/icinga/icinga2/issues/4263) (Documentation): Fix systemd client command formatting
+* [#4238](https://github.com/icinga/icinga2/issues/4238) (Documentation): Missing quotes for API action URL
+* [#4236](https://github.com/icinga/icinga2/issues/4236) (Documentation): Use HTTPS for debmon.org links in the documentation
+* [#4217](https://github.com/icinga/icinga2/issues/4217) (Documentation): node setup: Add a note for --endpoint syntax for client-master connection
+* [#4124](https://github.com/icinga/icinga2/issues/4124) (Documentation): Documentation review
+* [#3612](https://github.com/icinga/icinga2/issues/3612) (Documentation): Update SELinux documentation
### Support
-* [#4526](https://github.com/Icinga/icinga2/issues/4526) (Packages): Revert dependency on firewalld on RHEL
-* [#4494](https://github.com/Icinga/icinga2/issues/4494) (Installation): Remove unused functions from icinga-installer
-* [#4452](https://github.com/Icinga/icinga2/issues/4452) (Packages): Error compiling on windows due to changes in apilistener around minimum tls version
-* [#4432](https://github.com/Icinga/icinga2/issues/4432) (Packages): Windows build broken since ref 11292
-* [#4404](https://github.com/Icinga/icinga2/issues/4404) (Installation): Increase default systemd timeout
-* [#4344](https://github.com/Icinga/icinga2/issues/4344) (Packages): Build fails with Visual Studio 2013
-* [#4327](https://github.com/Icinga/icinga2/issues/4327) (Packages): Icinga fails to build with OpenSSL 1.1.0
-* [#4251](https://github.com/Icinga/icinga2/issues/4251) (Tests): Add debugging mode for Utility::GetTime
-* [#4234](https://github.com/Icinga/icinga2/issues/4234) (Tests): Boost tests are missing a dependency on libmethods
-* [#4230](https://github.com/Icinga/icinga2/issues/4230) (Installation): Windows: Error with repository handler \(missing /var/lib/icinga2/api/repository path\)
-* [#4211](https://github.com/Icinga/icinga2/issues/4211) (Packages): Incorrect filter in pick.py
-* [#4190](https://github.com/Icinga/icinga2/issues/4190) (Packages): Windows Installer: Remove dependency on KB2999226 package
-* [#4148](https://github.com/Icinga/icinga2/issues/4148) (Packages): RPM update starts disabled icinga2 service
-* [#4147](https://github.com/Icinga/icinga2/issues/4147) (Packages): Reload permission error with SELinux
-* [#4135](https://github.com/Icinga/icinga2/issues/4135) (Installation): Add script for automatically cherry-picking commits for minor versions
-* [#3829](https://github.com/Icinga/icinga2/issues/3829) (Packages): Provide packages for icinga-studio on Fedora
-* [#3708](https://github.com/Icinga/icinga2/issues/3708) (Packages): Firewalld Service definition for Icinga
-* [#2606](https://github.com/Icinga/icinga2/issues/2606) (Packages): Package for syntax highlighting
+* [#4526](https://github.com/icinga/icinga2/issues/4526) (Packages): Revert dependency on firewalld on RHEL
+* [#4494](https://github.com/icinga/icinga2/issues/4494) (Installation): Remove unused functions from icinga-installer
+* [#4452](https://github.com/icinga/icinga2/issues/4452) (Packages): Error compiling on windows due to changes in apilistener around minimum tls version
+* [#4432](https://github.com/icinga/icinga2/issues/4432) (Packages): Windows build broken since ref 11292
+* [#4404](https://github.com/icinga/icinga2/issues/4404) (Installation): Increase default systemd timeout
+* [#4344](https://github.com/icinga/icinga2/issues/4344) (Packages): Build fails with Visual Studio 2013
+* [#4327](https://github.com/icinga/icinga2/issues/4327) (Packages): Icinga fails to build with OpenSSL 1.1.0
+* [#4251](https://github.com/icinga/icinga2/issues/4251) (Tests): Add debugging mode for Utility::GetTime
+* [#4234](https://github.com/icinga/icinga2/issues/4234) (Tests): Boost tests are missing a dependency on libmethods
+* [#4230](https://github.com/icinga/icinga2/issues/4230) (Installation): Windows: Error with repository handler \(missing /var/lib/icinga2/api/repository path\)
+* [#4211](https://github.com/icinga/icinga2/issues/4211) (Packages): Incorrect filter in pick.py
+* [#4190](https://github.com/icinga/icinga2/issues/4190) (Packages): Windows Installer: Remove dependency on KB2999226 package
+* [#4148](https://github.com/icinga/icinga2/issues/4148) (Packages): RPM update starts disabled icinga2 service
+* [#4147](https://github.com/icinga/icinga2/issues/4147) (Packages): Reload permission error with SELinux
+* [#4135](https://github.com/icinga/icinga2/issues/4135) (Installation): Add script for automatically cherry-picking commits for minor versions
+* [#3829](https://github.com/icinga/icinga2/issues/3829) (Packages): Provide packages for icinga-studio on Fedora
+* [#3708](https://github.com/icinga/icinga2/issues/3708) (Packages): Firewalld Service definition for Icinga
+* [#2606](https://github.com/icinga/icinga2/issues/2606) (Packages): Package for syntax highlighting
## 2.4.9 (2016-05-19)
@@ -1088,10 +1140,10 @@ This release fixes a number of issues introduced in 2.4.8.
### Bug
-* [#4225](https://github.com/Icinga/icinga2/issues/4225) (Compat): Command Pipe thread 100% CPU Usage
-* [#4224](https://github.com/Icinga/icinga2/issues/4224): Checks are not executed anymore on command
-* [#4222](https://github.com/Icinga/icinga2/issues/4222) (Configuration): Segfault when trying to start 2.4.8
-* [#4221](https://github.com/Icinga/icinga2/issues/4221) (Performance Data): Error: Function call 'rename' for file '/var/spool/icinga2/tmp/service-perfdata' failed with error code 2, 'No such file or directory'
+* [#4225](https://github.com/icinga/icinga2/issues/4225) (Compat): Command Pipe thread 100% CPU Usage
+* [#4224](https://github.com/icinga/icinga2/issues/4224): Checks are not executed anymore on command
+* [#4222](https://github.com/icinga/icinga2/issues/4222) (Configuration): Segfault when trying to start 2.4.8
+* [#4221](https://github.com/icinga/icinga2/issues/4221) (Metrics): Error: Function call 'rename' for file '/var/spool/icinga2/tmp/service-perfdata' failed with error code 2, 'No such file or directory'
## 2.4.10 (2016-05-19)
@@ -1101,7 +1153,7 @@ This release fixes a number of issues introduced in 2.4.8.
### Bug
-* [#4227](https://github.com/Icinga/icinga2/issues/4227): Checker component doesn't execute any checks for command\_endpoint
+* [#4227](https://github.com/icinga/icinga2/issues/4227): Checker component doesn't execute any checks for command\_endpoint
## 2.4.8 (2016-05-17)
@@ -1114,54 +1166,54 @@ This release fixes a number of issues introduced in 2.4.8.
### Enhancement
-* [#4203](https://github.com/Icinga/icinga2/issues/4203) (Cluster): Only activate HARunOnce objects once there's a cluster connection
-* [#4198](https://github.com/Icinga/icinga2/issues/4198): Move CalculateExecutionTime and CalculateLatency into the CheckResult class
-* [#4196](https://github.com/Icinga/icinga2/issues/4196) (Cluster): Remove unused cluster commands
-* [#4149](https://github.com/Icinga/icinga2/issues/4149) (CLI): Implement SNI support for the CLI commands
-* [#4103](https://github.com/Icinga/icinga2/issues/4103): Add support for subjectAltName in SSL certificates
-* [#3919](https://github.com/Icinga/icinga2/issues/3919) (Configuration): Internal check for config problems
-* [#3321](https://github.com/Icinga/icinga2/issues/3321): "icinga" check should have state WARNING when the last reload failed
-* [#2993](https://github.com/Icinga/icinga2/issues/2993) (Performance Data): PerfdataWriter: Better failure handling for file renames across file systems
-* [#2896](https://github.com/Icinga/icinga2/issues/2896) (Cluster): Alert config reload failures with the icinga check
-* [#2468](https://github.com/Icinga/icinga2/issues/2468): Maximum concurrent service checks
+* [#4203](https://github.com/icinga/icinga2/issues/4203) (Cluster): Only activate HARunOnce objects once there's a cluster connection
+* [#4198](https://github.com/icinga/icinga2/issues/4198): Move CalculateExecutionTime and CalculateLatency into the CheckResult class
+* [#4196](https://github.com/icinga/icinga2/issues/4196) (Cluster): Remove unused cluster commands
+* [#4149](https://github.com/icinga/icinga2/issues/4149) (CLI): Implement SNI support for the CLI commands
+* [#4103](https://github.com/icinga/icinga2/issues/4103): Add support for subjectAltName in SSL certificates
+* [#3919](https://github.com/icinga/icinga2/issues/3919) (Configuration): Internal check for config problems
+* [#3321](https://github.com/icinga/icinga2/issues/3321): "icinga" check should have state WARNING when the last reload failed
+* [#2993](https://github.com/icinga/icinga2/issues/2993) (Metrics): PerfdataWriter: Better failure handling for file renames across file systems
+* [#2896](https://github.com/icinga/icinga2/issues/2896) (Cluster): Alert config reload failures with the icinga check
+* [#2468](https://github.com/icinga/icinga2/issues/2468): Maximum concurrent service checks
### Bug
-* [#4219](https://github.com/Icinga/icinga2/issues/4219) (DB IDO): Postgresql warnings on startup
-* [#4212](https://github.com/Icinga/icinga2/issues/4212): assertion failed: GetResumeCalled\(\)
-* [#4210](https://github.com/Icinga/icinga2/issues/4210) (API): Incorrect variable names for joined fields in filters
-* [#4204](https://github.com/Icinga/icinga2/issues/4204) (DB IDO): Ensure that program status updates are immediately updated in DB IDO
-* [#4202](https://github.com/Icinga/icinga2/issues/4202) (API): API: Missing error handling for invalid JSON request body
-* [#4182](https://github.com/Icinga/icinga2/issues/4182): Crash in UnameHelper
-* [#4180](https://github.com/Icinga/icinga2/issues/4180): Expired downtimes are not removed
-* [#4170](https://github.com/Icinga/icinga2/issues/4170) (API): Icinga Crash with the workflow Create\_Host-\> Downtime for the Host -\> Delete Downtime -\> Remove Host
-* [#4145](https://github.com/Icinga/icinga2/issues/4145) (Configuration): Wrong log severity causes segfault
-* [#4120](https://github.com/Icinga/icinga2/issues/4120): notification sent out during flexible downtime
-* [#4038](https://github.com/Icinga/icinga2/issues/4038) (API): inconsistent API /v1/objects/\* response for PUT requests
-* [#4037](https://github.com/Icinga/icinga2/issues/4037) (Compat): Command pipe overloaded: Can't send external Icinga command to the local command file
-* [#4029](https://github.com/Icinga/icinga2/issues/4029) (API): Icinga2 API: deleting service with cascade=1 does not delete dependant notification
-* [#3938](https://github.com/Icinga/icinga2/issues/3938): Crash with empty ScheduledDowntime 'ranges' attribute
-* [#3932](https://github.com/Icinga/icinga2/issues/3932): "day -X" time specifications are parsed incorrectly
-* [#3912](https://github.com/Icinga/icinga2/issues/3912) (Compat): Empty author/text attribute for comment/downtimes external commands causing crash
-* [#3881](https://github.com/Icinga/icinga2/issues/3881) (Cluster): Icinga2 agent gets stuck after disconnect and won't relay messages
-* [#3707](https://github.com/Icinga/icinga2/issues/3707) (Configuration): Comments and downtimes of deleted checkable objects are not deleted
-* [#3526](https://github.com/Icinga/icinga2/issues/3526): Icinga crashes with a segfault on receiving a lot of check results for nonexisting hosts/services
-* [#3316](https://github.com/Icinga/icinga2/issues/3316) (Configuration): Service apply without name possible
+* [#4219](https://github.com/icinga/icinga2/issues/4219) (DB IDO): Postgresql warnings on startup
+* [#4212](https://github.com/icinga/icinga2/issues/4212): assertion failed: GetResumeCalled\(\)
+* [#4210](https://github.com/icinga/icinga2/issues/4210) (API): Incorrect variable names for joined fields in filters
+* [#4204](https://github.com/icinga/icinga2/issues/4204) (DB IDO): Ensure that program status updates are immediately updated in DB IDO
+* [#4202](https://github.com/icinga/icinga2/issues/4202) (API): API: Missing error handling for invalid JSON request body
+* [#4182](https://github.com/icinga/icinga2/issues/4182): Crash in UnameHelper
+* [#4180](https://github.com/icinga/icinga2/issues/4180): Expired downtimes are not removed
+* [#4170](https://github.com/icinga/icinga2/issues/4170) (API): Icinga Crash with the workflow Create\_Host-\> Downtime for the Host -\> Delete Downtime -\> Remove Host
+* [#4145](https://github.com/icinga/icinga2/issues/4145) (Configuration): Wrong log severity causes segfault
+* [#4120](https://github.com/icinga/icinga2/issues/4120): notification sent out during flexible downtime
+* [#4038](https://github.com/icinga/icinga2/issues/4038) (API): inconsistent API /v1/objects/\* response for PUT requests
+* [#4037](https://github.com/icinga/icinga2/issues/4037) (Compat): Command pipe overloaded: Can't send external Icinga command to the local command file
+* [#4029](https://github.com/icinga/icinga2/issues/4029) (API): Icinga2 API: deleting service with cascade=1 does not delete dependant notification
+* [#3938](https://github.com/icinga/icinga2/issues/3938): Crash with empty ScheduledDowntime 'ranges' attribute
+* [#3932](https://github.com/icinga/icinga2/issues/3932): "day -X" time specifications are parsed incorrectly
+* [#3912](https://github.com/icinga/icinga2/issues/3912) (Compat): Empty author/text attribute for comment/downtimes external commands causing crash
+* [#3881](https://github.com/icinga/icinga2/issues/3881) (Cluster): Icinga2 agent gets stuck after disconnect and won't relay messages
+* [#3707](https://github.com/icinga/icinga2/issues/3707) (Configuration): Comments and downtimes of deleted checkable objects are not deleted
+* [#3526](https://github.com/icinga/icinga2/issues/3526): Icinga crashes with a segfault on receiving a lot of check results for nonexisting hosts/services
+* [#3316](https://github.com/icinga/icinga2/issues/3316) (Configuration): Service apply without name possible
### ITL
-* [#4184](https://github.com/Icinga/icinga2/issues/4184) (ITL): 'disk' CheckCommand: Exclude 'cgroup' and 'tracefs' by default
-* [#3634](https://github.com/Icinga/icinga2/issues/3634) (ITL): Provide icingacli in the ITL
+* [#4184](https://github.com/icinga/icinga2/issues/4184) (ITL): 'disk' CheckCommand: Exclude 'cgroup' and 'tracefs' by default
+* [#3634](https://github.com/icinga/icinga2/issues/3634) (ITL): Provide icingacli in the ITL
### Documentation
-* [#4205](https://github.com/Icinga/icinga2/issues/4205) (Documentation): Add the category to the generated changelog
-* [#4193](https://github.com/Icinga/icinga2/issues/4193) (Documentation): Missing documentation for event commands w/ execution bridge
-* [#4144](https://github.com/Icinga/icinga2/issues/4144) (Documentation): Incorrect chapter headings for Object\#to\_string and Object\#type
+* [#4205](https://github.com/icinga/icinga2/issues/4205) (Documentation): Add the category to the generated changelog
+* [#4193](https://github.com/icinga/icinga2/issues/4193) (Documentation): Missing documentation for event commands w/ execution bridge
+* [#4144](https://github.com/icinga/icinga2/issues/4144) (Documentation): Incorrect chapter headings for Object\#to\_string and Object\#type
### Support
-* [#4146](https://github.com/Icinga/icinga2/issues/4146) (Packages): Update chocolatey packages and RELEASE.md
+* [#4146](https://github.com/icinga/icinga2/issues/4146) (Packages): Update chocolatey packages and RELEASE.md
## 2.4.7 (2016-04-21)
@@ -1171,7 +1223,7 @@ This release fixes a number of issues introduced in 2.4.8.
### Bug
-* [#4142](https://github.com/Icinga/icinga2/issues/4142) (DB IDO): Crash in IdoMysqlConnection::ExecuteMultipleQueries
+* [#4142](https://github.com/icinga/icinga2/issues/4142) (DB IDO): Crash in IdoMysqlConnection::ExecuteMultipleQueries
## 2.4.6 (2016-04-20)
@@ -1181,16 +1233,16 @@ This release fixes a number of issues introduced in 2.4.8.
### Bug
-* [#4140](https://github.com/Icinga/icinga2/issues/4140) (DB IDO): Failed assertion in IdoPgsqlConnection::FieldToEscapedString
+* [#4140](https://github.com/icinga/icinga2/issues/4140) (DB IDO): Failed assertion in IdoPgsqlConnection::FieldToEscapedString
### Documentation
-* [#4141](https://github.com/Icinga/icinga2/issues/4141) (Documentation): Update RELEASE.md
-* [#4136](https://github.com/Icinga/icinga2/issues/4136) (Documentation): Docs: Zone attribute 'endpoints' is an array
+* [#4141](https://github.com/icinga/icinga2/issues/4141) (Documentation): Update RELEASE.md
+* [#4136](https://github.com/icinga/icinga2/issues/4136) (Documentation): Docs: Zone attribute 'endpoints' is an array
### Support
-* [#4139](https://github.com/Icinga/icinga2/issues/4139) (Packages): Icinga 2 fails to build on Ubuntu Xenial
+* [#4139](https://github.com/icinga/icinga2/issues/4139) (Packages): Icinga 2 fails to build on Ubuntu Xenial
## 2.4.5 (2016-04-20)
@@ -1203,67 +1255,67 @@ This release fixes a number of issues introduced in 2.4.8.
### Enhancement
-* [#3023](https://github.com/Icinga/icinga2/issues/3023) (Configuration): Implement support for overriding check command timeout
+* [#3023](https://github.com/icinga/icinga2/issues/3023) (Configuration): Implement support for overriding check command timeout
### Bug
-* [#4131](https://github.com/Icinga/icinga2/issues/4131) (Configuration): Vim Syntax Highlighting does not work with assign where
-* [#4116](https://github.com/Icinga/icinga2/issues/4116) (API): icinga2 crashes when a command\_endpoint is set, but the api feature is not active
-* [#4114](https://github.com/Icinga/icinga2/issues/4114): Compiler warning in NotifyActive
-* [#4109](https://github.com/Icinga/icinga2/issues/4109) (API): Navigation attributes are missing in /v1/objects/\
-* [#4104](https://github.com/Icinga/icinga2/issues/4104) (Configuration): Segfault during config validation if host exists, service does not exist any longer and downtime expires
-* [#4095](https://github.com/Icinga/icinga2/issues/4095): DowntimesExpireTimerHandler crashes Icinga2 with \
-* [#4089](https://github.com/Icinga/icinga2/issues/4089): Make the socket event engine configurable
-* [#4078](https://github.com/Icinga/icinga2/issues/4078) (Configuration): Overwriting global type variables causes crash in ConfigItem::Commit\(\)
-* [#4076](https://github.com/Icinga/icinga2/issues/4076) (API): API User gets wrongly authenticated \(client\_cn and no password\)
-* [#4066](https://github.com/Icinga/icinga2/issues/4066): ConfigSync broken from 2.4.3. to 2.4.4 under Windows
-* [#4056](https://github.com/Icinga/icinga2/issues/4056) (CLI): Remove semi-colons in the auto-generated configs
-* [#4052](https://github.com/Icinga/icinga2/issues/4052) (API): Config validation for Notification objects should check whether the state filters are valid
-* [#4035](https://github.com/Icinga/icinga2/issues/4035) (DB IDO): IDO: historical contact notifications table column notification\_id is off-by-one
-* [#4031](https://github.com/Icinga/icinga2/issues/4031): Downtimes are not always activated/expired on restart
-* [#4016](https://github.com/Icinga/icinga2/issues/4016): Symlink subfolders not followed/considered for config files
-* [#4014](https://github.com/Icinga/icinga2/issues/4014): Use retry\_interval instead of check\_interval for first OK -\> NOT-OK state change
-* [#3973](https://github.com/Icinga/icinga2/issues/3973) (Cluster): Downtimes and Comments are not synced to child zones
-* [#3970](https://github.com/Icinga/icinga2/issues/3970) (API): Socket Exceptions \(Operation not permitted\) while reading from API
-* [#3907](https://github.com/Icinga/icinga2/issues/3907) (Configuration): Too many assign where filters cause stack overflow
-* [#3780](https://github.com/Icinga/icinga2/issues/3780) (DB IDO): DB IDO: downtime is not in effect after restart
+* [#4131](https://github.com/icinga/icinga2/issues/4131) (Configuration): Vim Syntax Highlighting does not work with assign where
+* [#4116](https://github.com/icinga/icinga2/issues/4116) (API): icinga2 crashes when a command\_endpoint is set, but the api feature is not active
+* [#4114](https://github.com/icinga/icinga2/issues/4114): Compiler warning in NotifyActive
+* [#4109](https://github.com/icinga/icinga2/issues/4109) (API): Navigation attributes are missing in /v1/objects/\
+* [#4104](https://github.com/icinga/icinga2/issues/4104) (Configuration): Segfault during config validation if host exists, service does not exist any longer and downtime expires
+* [#4095](https://github.com/icinga/icinga2/issues/4095): DowntimesExpireTimerHandler crashes Icinga2 with \