Skip to content

Commit 0b3bf59

Browse files
Dev/refactor update (#336)
* resolve conflict * fix image decision result * fix image verification condition * fix logger to enable session trace * fix check_functions.go functions and test cases
1 parent 4f4ef42 commit 0b3bf59

34 files changed

+529
-587
lines changed

build/build_images.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ if [ -z "$ISHIELD_OBSERVER_IMAGE_NAME_AND_VERSION" ]; then
5757
exit 1
5858
fi
5959

60-
if [ -z "$ISHIELD_INSPECTOR_IMAGE_NAME_AND_VERSION" ]; then
61-
echo "ISHIELD_INSPECTOR_IMAGE_NAME_AND_VERSION is empty. Please set IShield build env settings."
62-
exit 1
63-
fi
60+
# if [ -z "$ISHIELD_INSPECTOR_IMAGE_NAME_AND_VERSION" ]; then
61+
# echo "ISHIELD_INSPECTOR_IMAGE_NAME_AND_VERSION is empty. Please set IShield build env settings."
62+
# exit 1
63+
# fi
6464

6565
if [ -z "$ISHIELD_OPERATOR_IMAGE_NAME_AND_VERSION" ]; then
6666
echo "ISHIELD_OPERATOR_IMAGE_NAME_AND_VERSION is empty. Please set IShield build env settings."

cmd/pkg/yamlsign/audit/audityaml.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@ func AuditYaml(ctx context.Context, apiVersion, kind, namespace, name string) (*
3131
_ = config.InitShieldConfig()
3232

3333
metaLogger := logger.NewLogger(config.ShieldConfig.LoggerConfig())
34-
reqLog := metaLogger.WithFields(
35-
log.Fields{
36-
"namespace": namespace,
37-
"name": name,
38-
"apiVersion": apiVersion,
39-
"kind": kind,
40-
},
41-
)
42-
resourceHandler := shield.NewResourceHandler(config.ShieldConfig, metaLogger, reqLog)
34+
resourceHandler := shield.NewResourceCheckHandler(config.ShieldConfig, metaLogger)
4335

4436
var obj *unstructured.Unstructured
4537
obj, err := kubeutil.GetResource(apiVersion, kind, namespace, name)

integrity-shield-operator/api/v1alpha1/integrityshield_types.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ import (
3939
)
4040

4141
const (
42-
DefaultIntegrityShieldCRDName = "integrityshields.apis.integrityshield.io"
43-
DefaultShieldConfigCRDName = "shieldconfigs.apis.integrityshield.io"
44-
DefaultSignerConfigCRDName = "signerconfigs.apis.integrityshield.io"
45-
DefaultResourceSignatureCRDName = "resourcesignatures.apis.integrityshield.io"
46-
DefaultResourceSigningProfileCRDName = "resourcesigningprofiles.apis.integrityshield.io"
47-
DefaultHelmReleaseMetadataCRDName = "helmreleasemetadatas.apis.integrityshield.io"
48-
DefaultProtectedResourceIntegrityCRDName = "protectedresourceintegrities.apis.integrityshield.io"
42+
DefaultIntegrityShieldCRDName = "integrityshields.apis.integrityshield.io"
43+
DefaultShieldConfigCRDName = "shieldconfigs.apis.integrityshield.io"
44+
DefaultSignerConfigCRDName = "signerconfigs.apis.integrityshield.io"
45+
DefaultResourceSignatureCRDName = "resourcesignatures.apis.integrityshield.io"
46+
DefaultResourceSigningProfileCRDName = "resourcesigningprofiles.apis.integrityshield.io"
47+
DefaultHelmReleaseMetadataCRDName = "helmreleasemetadatas.apis.integrityshield.io"
48+
// DefaultProtectedResourceIntegrityCRDName = "protectedresourceintegrities.apis.integrityshield.io"
4949
DefaultSignerConfigCRName = "signer-config"
5050
DefaultIShieldAdminClusterRoleName = "ishield-admin-clusterrole"
5151
DefaultIShieldAdminClusterRoleBindingName = "ishield-admin-clusterrolebinding"
@@ -282,9 +282,9 @@ func (self *IntegrityShield) GetResourceSigningProfileCRDName() string {
282282
return DefaultResourceSigningProfileCRDName
283283
}
284284

285-
func (self *IntegrityShield) GetProtectedResourceIntegrityCRDName() string {
286-
return DefaultProtectedResourceIntegrityCRDName
287-
}
285+
// func (self *IntegrityShield) GetProtectedResourceIntegrityCRDName() string {
286+
// return DefaultProtectedResourceIntegrityCRDName
287+
// }
288288

289289
func (self *IntegrityShield) GetHelmReleaseMetadataCRDName() string {
290290
return DefaultHelmReleaseMetadataCRDName

integrity-shield-operator/config/samples/apis_v1alpha1_integrityshield_sigstore.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ spec:
1818
useDefaultRootCert: true
1919
imageVerificationConfig:
2020
enabled: true
21-
verificationURL: "<COSIGN VERIFIER API URL>"
22-
options: {}
2321
signerConfig:
2422
policies:
2523
- namespaces:

integrity-shield-operator/controllers/integrityshield.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ func (r *IntegrityShieldReconciler) createOrUpdateResourceSigningProfileCRD(
163163
return r.createOrUpdateCRD(instance, expected)
164164
}
165165

166-
func (r *IntegrityShieldReconciler) createOrUpdateProtectedResourceIntegrityCRD(
167-
instance *apiv1alpha1.IntegrityShield) (ctrl.Result, error) {
168-
expected := res.BuildProtectedResourceIntegrityCRD(instance)
169-
return r.createOrUpdateCRD(instance, expected)
170-
}
166+
// func (r *IntegrityShieldReconciler) createOrUpdateProtectedResourceIntegrityCRD(
167+
// instance *apiv1alpha1.IntegrityShield) (ctrl.Result, error) {
168+
// expected := res.BuildProtectedResourceIntegrityCRD(instance)
169+
// return r.createOrUpdateCRD(instance, expected)
170+
// }
171171

172172
func (r *IntegrityShieldReconciler) deleteShieldConfigCRD(
173173
instance *apiv1alpha1.IntegrityShield) (ctrl.Result, error) {
@@ -198,11 +198,11 @@ func (r *IntegrityShieldReconciler) deleteResourceSigningProfileCRD(
198198
return r.deleteCRD(instance, expected)
199199
}
200200

201-
func (r *IntegrityShieldReconciler) deleteProtectedResourceIntegrityCRD(
202-
instance *apiv1alpha1.IntegrityShield) (ctrl.Result, error) {
203-
expected := res.BuildProtectedResourceIntegrityCRD(instance)
204-
return r.deleteCRD(instance, expected)
205-
}
201+
// func (r *IntegrityShieldReconciler) deleteProtectedResourceIntegrityCRD(
202+
// instance *apiv1alpha1.IntegrityShield) (ctrl.Result, error) {
203+
// expected := res.BuildProtectedResourceIntegrityCRD(instance)
204+
// return r.deleteCRD(instance, expected)
205+
// }
206206

207207
/**********************************************
208208

integrity-shield-operator/go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ replace (
2525
github.com/IBM/integrity-enforcer/cmd => ../cmd
2626
github.com/IBM/integrity-enforcer/integrity-shield-operator => ./
2727
github.com/IBM/integrity-enforcer/shield => ../shield
28-
k8s.io/api => k8s.io/api v0.20.2
29-
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.20.2
30-
k8s.io/apimachinery => k8s.io/apimachinery v0.20.2
31-
k8s.io/cli-runtime => k8s.io/cli-runtime v0.20.2
32-
k8s.io/client-go => k8s.io/client-go v0.20.2
33-
k8s.io/kubectl => k8s.io/kubectl v0.20.2
28+
k8s.io/api => k8s.io/api v0.19.0
29+
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.19.0
30+
k8s.io/apimachinery => k8s.io/apimachinery v0.19.0
31+
k8s.io/cli-runtime => k8s.io/cli-runtime v0.19.0
32+
k8s.io/client-go => k8s.io/client-go v0.19.0
33+
k8s.io/kubectl => k8s.io/kubectl v0.19.0
3434
sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.8.3
3535
)
3636

0 commit comments

Comments
 (0)