From e73be7f0e5f87cf37dba367e2aa3a7249ee06185 Mon Sep 17 00:00:00 2001 From: "Liu,Bijun" Date: Thu, 16 Jan 2020 09:57:43 +0800 Subject: [PATCH] modify Readme and Contributing guide to mentioned security part --- tests/CONTRIBUTING.md | 19 ++++++++++++++----- tests/README.md | 12 ++++++------ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/tests/CONTRIBUTING.md b/tests/CONTRIBUTING.md index 55784af..52d7efb 100644 --- a/tests/CONTRIBUTING.md +++ b/tests/CONTRIBUTING.md @@ -1,7 +1,7 @@ Contributing Guidelines ======================= -Principle of the test cases +Principle of the Unit test cases ---------------------------- Focusing on basic tests on docker environment, may covering below: @@ -19,11 +19,19 @@ either of the way: test case. * use BAT "setup" and "teardown" hooks. -How to add test cases +Principle of the Security test cases +---------------------------- +Lower container security risk level by limit container access resources, limit expose scope, limit permission... +* Verify that Linux Kernel Capabilities are restricted within containers +* Verify that the SSH server not be running within the containers +* Verify that containers are restricted from acquiring additional privileges +More security checks are recommended when deploying containers in product environment. + +How to add Unit and Security test cases ------------------------------------ -The test cases are for the micro services already added in the Actions CI. -So for any micro service name defined in the matrix.node of .github/workflows/ +The test cases are for the Containers already added in the Actions CI. +So for any Containers name defined in the matrix.node of .github/workflows/ tests.yml, the same name directory could be added in the directory "tests". And the same name BAT script in the new added directory will be executed for each PR/commits. For example, redis. @@ -39,7 +47,8 @@ each PR/commits. For example, redis. └── tests └── redis └── redis.bats +    └── redis-security.bats ``` -* Last, develop the redis BAT test cases in "redis.bats" following the above +* Last, develop the redis BAT test cases in "redis.bats" and "redis-security.bats" following the above principles. diff --git a/tests/README.md b/tests/README.md index 9c1c61a..53e5ddc 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,12 +1,12 @@ -# Clear Linux micro services unit test +# Clear Linux Containers Unit test and Security test -These are the collections of the Clear Linux micro services unit test. -The micro services are from [page](https://github.com/clearlinux/dockerfiles). - -All the unit tests are writing based on BATS [page](https://github.com/sstephenson/bats). +These are the collections of the Clear Linux Containers Unit test and Security test. +The Unit tests and Security tests are implementing by separate [BATS](https://github.com/sstephenson/bats) scripts. +Both Unit test and Security test will be run as a part of CI pre-test before the corresponding dockerfiles submit. +The dockerfiles are from [page](https://github.com/clearlinux/dockerfiles). The CI is hosting in [github actions](https://github.com/clearlinux/dockerfiles/blob/master/.github/workflows/test.yml). To run the tests, you can simple type "make tests", it will run all the test cases. -If you want to run specific micro service test, just type "make SERVICE-NAME". +If you want to run specific Container test, just type "make SERVICE-NAME". For example, "make redis" to run tests for redis.