Skip to content

Commit cedd4ab

Browse files
author
Ahmed El-Sayed
authored
Merge pull request #107 from weaveworks/dev
release version v1.2.0
2 parents d45b3bd + f5c4745 commit cedd4ab

File tree

13 files changed

+857
-61
lines changed

13 files changed

+857
-61
lines changed

api/v2beta1/policy_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ type PolicySpec struct {
101101
// +optional
102102
// Standards is a list of policy standards that this policy falls under
103103
Standards []PolicyStandard `json:"standards"`
104+
//+optional
105+
//+kubebuilder:default:=kubernetes
106+
//+kubebuilder:validation:Enum=kubernetes;terraform
107+
// Provider policy provider, can be kubernetes, terraform
108+
Provider string `json:"provider"`
104109
}
105110

106111
type PolicySetFilters struct {

config/crd/bases/pac.weave.works_policies.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,13 @@ spec:
214214
- type
215215
type: object
216216
type: array
217+
provider:
218+
default: kubernetes
219+
description: Provider policy provider, can be kubernetes, terraform
220+
enum:
221+
- kubernetes
222+
- terraform
223+
type: string
217224
severity:
218225
description: Severity is a measure of the impact of that policy, can
219226
be low, medium or high

configuration/config.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ type AuditConfig struct {
6161
Interval uint
6262
}
6363

64+
type TerraformConfig struct {
65+
Enabled bool
66+
Sinks SinksConfig
67+
PolicySet string
68+
}
69+
6470
type Config struct {
6571
KubeConfigFile string
6672
AccountID string
@@ -73,6 +79,7 @@ type Config struct {
7379

7480
Admission AdmissionConfig
7581
Audit AuditConfig
82+
Terraform TerraformConfig
7683
}
7784

7885
func GetAgentConfiguration(filePath string) Config {

go.mod

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ require (
1111
github.com/MagalixTechnologies/channel v1.1.0
1212
github.com/MagalixTechnologies/core/logger v1.0.4
1313
github.com/MagalixTechnologies/core/packet v1.0.1
14-
github.com/MagalixTechnologies/policy-core v1.1.1
14+
github.com/MagalixTechnologies/policy-core v1.1.4-0.20220905094853-05b9bb3e692f
1515
github.com/MagalixTechnologies/uuid-go v0.0.0-20210127133914-f8f07f7ab96e
1616
github.com/elastic/go-elasticsearch/v7 v7.17.1
1717
github.com/fluxcd/pkg/runtime v0.13.1
18-
github.com/go-logr/logr v1.2.2
18+
github.com/go-logr/logr v1.2.3
1919
github.com/golang/mock v1.6.0
2020
github.com/golang/snappy v0.0.4
2121
github.com/pkg/errors v0.9.1
2222
github.com/spf13/viper v1.10.0
23-
github.com/stretchr/testify v1.7.1
23+
github.com/stretchr/testify v1.8.0
2424
github.com/urfave/cli/v2 v2.3.0
2525
github.com/weaveworks/policy-agent/api v0.0.0
2626
go.uber.org/zap v1.19.1
27-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
27+
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
2828
k8s.io/api v0.23.5
2929
k8s.io/apimachinery v0.23.5
3030
k8s.io/client-go v0.23.4
@@ -34,41 +34,41 @@ require (
3434
require (
3535
github.com/MagalixTechnologies/opa-core v1.0.12 // indirect
3636
github.com/OneOfOne/xxhash v1.2.8 // indirect
37+
github.com/agnivade/levenshtein v1.0.1 // indirect
3738
github.com/beorn7/perks v1.0.1 // indirect
3839
github.com/cespare/xxhash/v2 v2.1.2 // indirect
39-
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
40+
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
4041
github.com/davecgh/go-spew v1.1.1 // indirect
4142
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
42-
github.com/fsnotify/fsnotify v1.5.1 // indirect
43+
github.com/fsnotify/fsnotify v1.5.4 // indirect
4344
github.com/ghodss/yaml v1.0.0 // indirect
4445
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 // indirect
4546
github.com/go-logr/zapr v1.2.0 // indirect
4647
github.com/gobwas/glob v0.2.3 // indirect
4748
github.com/gogo/protobuf v1.3.2 // indirect
4849
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
4950
github.com/golang/protobuf v1.5.2 // indirect
50-
github.com/google/go-cmp v0.5.6 // indirect
51+
github.com/google/go-cmp v0.5.8 // indirect
5152
github.com/google/gofuzz v1.2.0 // indirect
5253
github.com/google/uuid v1.2.0 // indirect
5354
github.com/googleapis/gnostic v0.5.5 // indirect
5455
github.com/gorilla/websocket v1.5.0 // indirect
55-
github.com/hashicorp/errwrap v1.0.0 // indirect
56+
github.com/hashicorp/errwrap v1.1.0 // indirect
5657
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
5758
github.com/hashicorp/go-multierror v1.1.1 // indirect
5859
github.com/hashicorp/go-retryablehttp v0.6.8 // indirect
5960
github.com/hashicorp/hcl v1.0.0 // indirect
6061
github.com/imdario/mergo v0.3.12 // indirect
6162
github.com/json-iterator/go v1.1.12 // indirect
62-
github.com/kr/pretty v0.2.1 // indirect
6363
github.com/magiconair/properties v1.8.5 // indirect
6464
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
6565
github.com/mitchellh/mapstructure v1.4.3 // indirect
6666
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6767
github.com/modern-go/reflect2 v1.0.2 // indirect
68-
github.com/open-policy-agent/opa v0.37.1 // indirect
68+
github.com/open-policy-agent/opa v0.42.2 // indirect
6969
github.com/pelletier/go-toml v1.9.4 // indirect
7070
github.com/pmezard/go-difflib v1.0.0 // indirect
71-
github.com/prometheus/client_golang v1.12.1 // indirect
71+
github.com/prometheus/client_golang v1.12.2 // indirect
7272
github.com/prometheus/client_model v0.2.0 // indirect
7373
github.com/prometheus/common v0.32.1 // indirect
7474
github.com/prometheus/procfs v0.7.3 // indirect
@@ -80,24 +80,25 @@ require (
8080
github.com/spf13/jwalterweatherman v1.1.0 // indirect
8181
github.com/spf13/pflag v1.0.5 // indirect
8282
github.com/subosito/gotenv v1.2.0 // indirect
83+
github.com/vektah/gqlparser/v2 v2.4.5 // indirect
8384
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
8485
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
85-
github.com/yashtewari/glob-intersection v0.0.0-20180916065949-5c77d914dd0b // indirect
86+
github.com/yashtewari/glob-intersection v0.1.0 // indirect
8687
go.uber.org/atomic v1.7.0 // indirect
8788
go.uber.org/multierr v1.6.0 // indirect
88-
golang.org/x/net v0.0.0-20211215060638-4ddde0e984e9 // indirect
89+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
8990
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
90-
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
91-
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
91+
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
92+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
9293
golang.org/x/text v0.3.7 // indirect
9394
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
9495
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
9596
google.golang.org/appengine v1.6.7 // indirect
96-
google.golang.org/protobuf v1.27.1 // indirect
97+
google.golang.org/protobuf v1.28.0 // indirect
9798
gopkg.in/inf.v0 v0.9.1 // indirect
9899
gopkg.in/ini.v1 v1.66.2 // indirect
99100
gopkg.in/yaml.v2 v2.4.0 // indirect
100-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
101+
gopkg.in/yaml.v3 v3.0.1 // indirect
101102
k8s.io/apiextensions-apiserver v0.23.4 // indirect
102103
k8s.io/component-base v0.23.4 // indirect
103104
k8s.io/klog/v2 v2.30.0 // indirect

0 commit comments

Comments
 (0)