Jim Bugwadia
5c16ee738a
redo variable validation ( #2647 )
...
* redo variable validation
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* handle quotes for JMESPath - escaping
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix tests and linter issues
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
* fix fmt
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-11-03 11:16:55 -07:00
Jose Armesto
831a9826d1
Restructure project to follow standards ( #2632 )
...
Signed-off-by: Jose Armesto <github@armesto.net>
2021-10-29 18:13:20 +02:00
Marcus Noble
1966c82c6d
Fix various go lint issues ( #2639 )
...
* Fix various go lint issues
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
* Fix if mistake
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
* Simplified returns
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-10-29 17:06:03 +02:00
Kumar Mallikarjuna
b1c40e172d
Escape variables ( #2563 )
...
* Escape variables
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna1@gmail.com>
* Escape variables test - nested
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna1@gmail.com>
* Fixed missing changes
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna1@gmail.com>
2021-10-20 17:10:24 -07:00
Bricktop
3f15ec5a1e
Remove dead code and unused variables ( #2537 )
...
* Remove dead code and unused variables
Signed-off-by: Marcel Mueller <marcel.mueller1@rwth-aachen.de>
* Remove unnecessary definitions
Signed-off-by: Marcel Mueller <marcel.mueller1@rwth-aachen.de>
2021-10-13 22:45:23 +02:00
Kumar Mallikarjuna
6a81bb7cc3
Escape references ( #2433 )
...
* Escape references
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna1@gmail.com>
* Additional tests
Signed-off-by: Kumar Mallikarjuna <kumarmallikarjuna1@gmail.com>
2021-09-27 11:44:56 -07:00
Max Goncharenko
903963c26d
add special variable substitution logic for preconditions ( #1930 )
...
* add special variable substitution logic for preconditions
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* handle NotFoundVariable error in proper way
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
* remove excess log; fix grammar
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
* removed isPrecondition flag; added test case for empty deny string; fixed related issue
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
* fix test case
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
* fix go lint
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
* fix tests
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
2021-07-28 09:54:50 -07:00
Max Goncharenko
6d0ad5598e
Jmespath notfound error ( #1907 )
...
* return err, if variable path could not be resolved
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* fixed {{@}} behavior
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* fix json merge logic
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* add e2e tests for Flux use case
Signed-off-by: Maxim Goncharenko <goncharenko.maxim@apriorit.com>
2021-07-01 22:56:50 -07:00
Max Goncharenko
158b58f819
Fix {{@}}
behavior ( #1908 )
...
* fixed {{@}} behavior
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* removed white space from test
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-05-13 12:27:45 -07:00
Max Goncharenko
6a0305674a
JMESPath custom functions ( #1772 )
...
* JMESPath: Support regex expressions
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* JMESPath: Add string functions
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* Removed {{$}} variable handling logic
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* Name all functions in snake case; Update error message; Fix {{@}} behavior
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-04-16 16:17:00 -07:00
shuting
081244a102
Fix array variables substitution ( #1800 )
...
* fix array variables substitution
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* Add ability to marshal complex vars to string
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* Added tests for variable substitution
Signed-off-by: Max Goncharenko <kacejot@fex.net>
Co-authored-by: Max Goncharenko <kacejot@fex.net>
2021-04-14 13:09:00 -07:00
Jim Bugwadia
72cdbafbae
fix tests
...
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-03-25 18:11:32 -07:00
Jim Bugwadia
6dff9e0ab9
merge and resolve conflicts
...
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-03-25 16:43:12 -07:00
Max Goncharenko
3373a79f26
Bug Fix : #1585 issue; validate on DELETE the oldResource ( #1710 )
...
* fix #1585 issue; validate on DELETE the oldResource
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* apply PR edits for #1585 issue fix; add test with nested var
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-03-19 14:43:26 -07:00
Max Goncharenko
24c4f06ecd
Fix #1506 ; Resolve path reference in entire rule instead of just pattern/overlay
...
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-03-16 13:45:40 +02:00
shuting
267be0815f
Bug fixes - policy validation, auto-generated rules, apiCall support in mutate and generate ( #1629 )
...
* Fix invalid policy reports generated for blocked resource
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix 1464 - copy context and preconditions to auto-gen rules
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix 1628 - add policy validations
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix 1593 - support apiCall in mutate and generate
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix test
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-22 12:08:26 -08:00
Jim Bugwadia
f93e3020e1
support nested JMESPATH var substitution ( #1471 )
2021-01-14 10:46:51 -08:00
Jim Bugwadia
3dfe3169dc
add logger
2020-11-25 10:11:08 -08:00
Shuting Zhao
cdc5190c56
update nirmata/kyverno to kyverno/kyverno
2020-10-07 11:12:31 -07:00
shravan
09310d19e1
744 fixing policy validation
2020-05-06 22:27:06 +05:30
shravan
717e8e7245
744 fixed error messages
2020-05-05 23:52:52 +05:30
shivkumar dudhani
d327309d72
refactor logging
2020-03-17 16:25:34 -07:00
shivkumar dudhani
1b1ab78f77
logs & access
2020-03-17 11:05:20 -07:00
shivkumar dudhani
03ee46e1d9
support nested variable resolution
2020-02-26 16:41:48 -08:00
shivkumar dudhani
5cee543755
refactor variable substitution
2020-02-14 11:59:28 -08:00
shivkumar dudhani
d855247a98
refactor generate to use variable substition at rule level
2020-02-13 13:57:48 -08:00