modify Readme and Contributing guide to mentioned security part

This commit is contained in:
Liu,Bijun
2020-01-16 09:57:43 +08:00
committed by qzheng527
parent 1fea660566
commit e73be7f0e5
2 changed files with 20 additions and 11 deletions
+14 -5
View File
@@ -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.
+6 -6
View File
@@ -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.