Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New
docker_container_envs
table (#7313)
- Loading branch information
1 parent
7e2ccc2
commit a18ffee
Showing
4 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
table_name("docker_container_envs") | ||
description("Docker container environment variables.") | ||
schema([ | ||
Column("id", TEXT, "Container ID", index=True), | ||
Column("key", TEXT, "Environment variable name"), | ||
Column("value", TEXT, "Environment variable value") | ||
]) | ||
implementation("applications/docker@genContainerEnvs") | ||
examples([ | ||
"select * from docker_container_envs", | ||
"select * from docker_container_envs where id = '1234567890abcdef'", | ||
"select * from docker_container_envs where id = '11b2399e1426d906e62a0c657650e363426d6c56dbe2f35cbaa9b452250e3355'" | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Copyright (c) 2014-present, The osquery authors | ||
* | ||
* This source code is licensed as defined by the LICENSE file found in the | ||
* root directory of this source tree. | ||
* | ||
* SPDX-License-Identifier: (Apache-2.0 OR GPL-2.0-only) | ||
*/ | ||
|
||
// Sanity check integration test for docker_container_envs | ||
// Spec file: specs/posix/docker_container_envs.table | ||
|
||
#include <osquery/tests/integration/tables/helper.h> | ||
|
||
namespace osquery { | ||
namespace table_tests { | ||
|
||
class dockerContainerEnvs : public testing::Test { | ||
protected: | ||
void SetUp() override { | ||
setUpEnvironment(); | ||
} | ||
}; | ||
|
||
TEST_F(dockerContainerEnvs, test_sanity) { | ||
// 1. Query data | ||
auto const data = execute_query("select * from docker_container_envs"); | ||
// 2. Check size before validation | ||
// ASSERT_GE(data.size(), 0ul); | ||
// ASSERT_EQ(data.size(), 1ul); | ||
// ASSERT_EQ(data.size(), 0ul); | ||
// 3. Build validation map | ||
// See helper.h for available flags | ||
// Or use custom DataCheck object | ||
// ValidationMap row_map = { | ||
// {"id", NormalType} | ||
// {"key", NormalType} | ||
// {"value", NormalType} | ||
//} | ||
// 4. Perform validation | ||
// validate_rows(data, row_map); | ||
} | ||
|
||
} // namespace table_tests | ||
} // namespace osquery |