mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-06 09:35:20 +00:00
build: Add Azure tables to specs CMakeLists (#6507)
This commit is contained in:
parent
efe9a98290
commit
6710dbd5a6
@ -42,11 +42,9 @@ function(generateOsqueryTablesTableimplementations)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(DEFINED PLATFORM_LINUX OR DEFINED PLATFORM_WINDOWS)
|
||||
target_link_libraries(osquery_tables_tableimplementations INTERFACE
|
||||
osquery_tables_cloud_azure
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(osquery_tables_tableimplementations INTERFACE
|
||||
osquery_tables_cloud_azure
|
||||
)
|
||||
|
||||
target_link_libraries(osquery_tables_tableimplementations INTERFACE
|
||||
osquery_tables_applications
|
||||
|
@ -9,9 +9,7 @@ function(osqueryTablesCloudMain)
|
||||
generateOsqueryTablesCloudAws()
|
||||
endif()
|
||||
|
||||
if(DEFINED PLATFORM_LINUX OR DEFINED PLATFORM_WINDOWS)
|
||||
generateOsqueryTablesCloudAzure()
|
||||
endif()
|
||||
generateOsqueryTablesCloudAzure()
|
||||
endfunction()
|
||||
|
||||
function(generateOsqueryTablesCloudAws)
|
||||
|
@ -8,11 +8,12 @@
|
||||
* You may select, at your option, one of the above-listed licenses.
|
||||
*/
|
||||
|
||||
// Keep this included first (See #6507).
|
||||
#include <osquery/remote/http_client.h>
|
||||
|
||||
#include <osquery/core.h>
|
||||
#include <osquery/logger.h>
|
||||
|
||||
#include <osquery/filesystem/filesystem.h>
|
||||
#include <osquery/remote/http_client.h>
|
||||
#include <osquery/utils/azure/azure_util.h>
|
||||
#include <osquery/utils/info/platform_type.h>
|
||||
#include <osquery/utils/json/json.h>
|
||||
|
@ -30,6 +30,8 @@ endfunction()
|
||||
|
||||
function(generateNativeTables)
|
||||
set(platform_independent_spec_files
|
||||
azure_instance_metadata.table
|
||||
azure_instance_tags.table
|
||||
carbon_black_info.table
|
||||
carves.table
|
||||
chrome_extensions.table
|
||||
|
46
tests/integration/tables/azure_instance_metadata.cpp
Normal file
46
tests/integration/tables/azure_instance_metadata.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed in accordance with the terms specified in
|
||||
* the LICENSE file found in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <osquery/tests/integration/tables/helper.h>
|
||||
|
||||
namespace osquery {
|
||||
namespace table_tests {
|
||||
|
||||
class azureInstanceMetadata : public testing::Test {
|
||||
protected:
|
||||
void SetUp() override {
|
||||
setUpEnvironment();
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(azureInstanceMetadata, test_sanity) {
|
||||
auto const data = execute_query("select * from azure_instance_metadata");
|
||||
if (!data.empty()) {
|
||||
ValidationMap row_map = {
|
||||
{"location", NormalType},
|
||||
{"name", NormalType},
|
||||
{"architecture", NormalType},
|
||||
{"offer", NormalType},
|
||||
{"publisher", NormalType},
|
||||
{"sku", NormalType} {"version", NormalType},
|
||||
{"os_type", NormalType},
|
||||
{"platform_update_domain", NormalType},
|
||||
{"platform_fault_domain", NormalType},
|
||||
{"vm_id", NormalType},
|
||||
{"vm_size", NormalType},
|
||||
{"subscription_id", NormalType},
|
||||
{"resource_group_name", NormalType},
|
||||
{"placement_group_id", NormalType},
|
||||
{"vm_scale_set_name", NormalType},
|
||||
{"zone", NormalType},
|
||||
};
|
||||
validate_rows(data, row_map);
|
||||
}
|
||||
|
||||
} // namespace table_tests
|
||||
} // namespace table_tests
|
34
tests/integration/tables/azure_instance_tags.cpp
Normal file
34
tests/integration/tables/azure_instance_tags.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed in accordance with the terms specified in
|
||||
* the LICENSE file found in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <osquery/tests/integration/tables/helper.h>
|
||||
|
||||
namespace osquery {
|
||||
namespace table_tests {
|
||||
|
||||
class azureInstanceTags : public testing::Test {
|
||||
protected:
|
||||
void SetUp() override {
|
||||
setUpEnvironment();
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(azureInstanceTags, test_sanity) {
|
||||
auto const data = execute_query("select * from azure_instance_tags");
|
||||
if (!data.empty()) {
|
||||
ValidationMap row_map = {
|
||||
{"vm_id", NormalType},
|
||||
{"key", NormalType},
|
||||
{"value", NormalType},
|
||||
};
|
||||
validate_rows(data, row_map);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace table_tests
|
||||
} // namespace osquery
|
Loading…
Reference in New Issue
Block a user