---
# System prepended metadata

title: OPA Conftest
tags: [CKS Day2]

---

# OPA Conftest
###### tags: `CKS Day2`

## Installation
```
wget https://github.com/open-policy-agent/conftest/releases/download/v0.23.0/conftest_0.23.0_Linux_x86_64.tar.gz tar xzf conftest_0.23.0_Linux_x86_64.tar.gz 

sudo mv conftest /usr/local/bin
```
## Test
```
https://github.com/open-policy-agent/conftest/tree/master/examples/kubernetes
```
```
https://github.com/gbrindisi/dockerfile-security
```
```
https://github.com/open-policy-agent/conftest/tree/master/examples/docker
```
```
https://github.com/HugoXiao1984/docker-security-checker
```

## Run
```
conftest test service.yaml deployment.yaml --combine
```
```
conftest test Dockerfile
```
```
conftest test --policy dockerfile-security.rego Dockerfile
```





