Skip to content

Commit 84da99d

Browse files
authored
Network policy (#160)
* Basic NetworkPolicy scan * NetworkPolicy report formatting tweaks * Just scan NetworkPolicy text files, report better
1 parent 70cc92f commit 84da99d

3 files changed

Lines changed: 409 additions & 5 deletions

File tree

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,28 @@ export CONTAINER_ENGINE=podman
5959

6060
Now, you can audit all operator bundles of an image catalog with:
6161

62-
```sh
63-
audit-tool index bundles --index-image=registry.redhat.io/redhat/redhat-operator-index:v4.7
62+
```sh
63+
audit-tool index bundles --index-image=registry.redhat.io/redhat/redhat-operator-index:v4.7
64+
```
65+
66+
### Scanning for NetworkPolicy Resources
67+
68+
To identify any `NetworkPolicy` resources included in bundle manifests across catalogs, use the `np` sub-command:
69+
70+
```sh
71+
$ audit-tool index np --indexes=registry.redhat.io/redhat/redhat-operator-index:v4.16,registry.redhat.io/redhat/redhat-operator-index:v4.17
72+
```
73+
74+
You can also filter to a specific package:
75+
76+
```sh
77+
$ audit-tool index np --indexes=registry.redhat.io/redhat/redhat-operator-index:v4.17 --package=bakery-operator
78+
```
79+
80+
Specify `podman` if needed:
81+
82+
```sh
83+
$ audit-tool index np --indexes=registry.redhat.io/redhat/redhat-operator-index:v4.17 --container-engine=podman
6484
```
6585

6686
Then, this report will result in a JSON file with all data exctract from the index and the bundles. Note that audit
@@ -260,4 +280,4 @@ add the artefacts in the release page.
260280
[operator-sdk]: https://github.com/operator-framework/operator-sdk
261281
[audit-ep]: https://github.com/operator-framework/enhancements/blob/master/enhancements/audit-command.md
262282
[validator]: https://github.com/operator-framework/api/blob/v0.17.1/pkg/validation/validation.go#L66-L85
263-
[scorecard]: https://sdk.operatorframework.io/docs/testing-operators/scorecard/
283+
[scorecard]: https://sdk.operatorframework.io/docs/testing-operators/scorecard/

cmd/index/main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
package index
1616

1717
import (
18+
"github.com/operator-framework/audit/cmd/index/bundles"
1819
"github.com/operator-framework/audit/cmd/index/eus"
20+
"github.com/operator-framework/audit/cmd/index/np"
1921
"github.com/spf13/cobra"
20-
21-
"github.com/operator-framework/audit/cmd/index/bundles"
2222
)
2323

2424
func NewCmd() *cobra.Command {
@@ -34,6 +34,9 @@ func NewCmd() *cobra.Command {
3434
indexCmd.AddCommand(
3535
eus.NewCmd(),
3636
)
37+
indexCmd.AddCommand(
38+
np.NewCmd(),
39+
)
3740

3841
return indexCmd
3942

0 commit comments

Comments
 (0)