Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PB-7615: Adding isSyncedBackup flag to identify the synced backups #258

Closed
wants to merge 2 commits into from

Conversation

shkumari-px
Copy link
Collaborator

What this PR does / why we need it: it adds a flag isSyncedBackup to check if the backup is a synced backup

Which issue(s) this PR fixes (optional)
Closes # https://purestorage.atlassian.net/browse/PB-7615

Special notes for your reviewer: na

Copy link

OSS Scan Results:

Title Severity Package Name CVEs Fix version Introduced
Denial of Service (DoS) high golang.org/x/net/http2 ['CVE-2023-44487'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling medium golang.org/x/net/http2 ['CVE-2023-39325'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling high golang.org/x/net/http2 ['CVE-2023-45288'] ['0.23.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/[email protected]', 'golang.org/x/net/[email protected]']
Denial of Service (DoS) high golang.org/x/net/http2 ['CVE-2023-44487'] ['0.17.0'] ['github.com/portworx/[email protected]', 'google.golang.org/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling medium golang.org/x/net/http2 ['CVE-2023-39325'] ['0.17.0'] ['github.com/portworx/[email protected]', 'google.golang.org/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling high golang.org/x/net/http2 ['CVE-2023-45288'] ['0.23.0'] ['github.com/portworx/[email protected]', 'google.golang.org/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'golang.org/x/net/[email protected]']
Denial of Service (DoS) high golang.org/x/net/http2 ['CVE-2023-44487'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling medium golang.org/x/net/http2 ['CVE-2023-39325'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling high golang.org/x/net/http2 ['CVE-2023-45288'] ['0.23.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/[email protected]', 'golang.org/x/net/[email protected]']
Denial of Service (DoS) high golang.org/x/net/http2 ['CVE-2023-44487'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling medium golang.org/x/net/http2 ['CVE-2023-39325'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling high golang.org/x/net/http2 ['CVE-2023-45288'] ['0.23.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Denial of Service (DoS) high golang.org/x/net/http2 ['CVE-2023-44487'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/cli-runtime/pkg/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling medium golang.org/x/net/http2 ['CVE-2023-39325'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/cli-runtime/pkg/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling high golang.org/x/net/http2 ['CVE-2023-45288'] ['0.23.0'] ['github.com/portworx/[email protected]', 'k8s.io/cli-runtime/pkg/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Denial of Service (DoS) high golang.org/x/net/http2 ['CVE-2023-44487'] ['0.17.0'] ['github.com/portworx/[email protected]', 'github.com/portworx/sched-ops/k8s/core@#2e0ef25efadd', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/transport/[email protected]', 'k8s.io/client-go/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling medium golang.org/x/net/http2 ['CVE-2023-39325'] ['0.17.0'] ['github.com/portworx/[email protected]', 'github.com/portworx/sched-ops/k8s/core@#2e0ef25efadd', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/transport/[email protected]', 'k8s.io/client-go/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling high golang.org/x/net/http2 ['CVE-2023-45288'] ['0.23.0'] ['github.com/portworx/[email protected]', 'github.com/portworx/sched-ops/k8s/core@#2e0ef25efadd', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/transport/[email protected]', 'k8s.io/client-go/[email protected]', 'golang.org/x/net/[email protected]']
Denial of Service (DoS) high golang.org/x/net/http2 ['CVE-2023-44487'] ['0.17.0'] ['github.com/portworx/[email protected]', 'github.com/portworx/sched-ops/k8s/core@#2e0ef25efadd', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/transport/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling medium golang.org/x/net/http2 ['CVE-2023-39325'] ['0.17.0'] ['github.com/portworx/[email protected]', 'github.com/portworx/sched-ops/k8s/core@#2e0ef25efadd', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/transport/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling high golang.org/x/net/http2 ['CVE-2023-45288'] ['0.23.0'] ['github.com/portworx/[email protected]', 'github.com/portworx/sched-ops/k8s/core@#2e0ef25efadd', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/transport/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/client-go/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Denial of Service (DoS) high golang.org/x/net/http2 ['CVE-2023-44487'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/tools/clientcmd/api/[email protected]', 'k8s.io/apimachinery/pkg/runtime/serializer/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/v1/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling medium golang.org/x/net/http2 ['CVE-2023-39325'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/tools/clientcmd/api/[email protected]', 'k8s.io/apimachinery/pkg/runtime/serializer/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/v1/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling high golang.org/x/net/http2 ['CVE-2023-45288'] ['0.23.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/tools/clientcmd/api/[email protected]', 'k8s.io/apimachinery/pkg/runtime/serializer/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/v1/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Denial of Service (DoS) high golang.org/x/net/http2 ['CVE-2023-44487'] ['0.17.0'] ['github.com/portworx/[email protected]', 'sigs.k8s.io/aws-iam-authenticator/pkg/[email protected]', 'k8s.io/client-go/pkg/apis/clientauthentication/[email protected]', 'k8s.io/client-go/pkg/apis/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling medium golang.org/x/net/http2 ['CVE-2023-39325'] ['0.17.0'] ['github.com/portworx/[email protected]', 'sigs.k8s.io/aws-iam-authenticator/pkg/[email protected]', 'k8s.io/client-go/pkg/apis/clientauthentication/[email protected]', 'k8s.io/client-go/pkg/apis/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling high golang.org/x/net/http2 ['CVE-2023-45288'] ['0.23.0'] ['github.com/portworx/[email protected]', 'sigs.k8s.io/aws-iam-authenticator/pkg/[email protected]', 'k8s.io/client-go/pkg/apis/clientauthentication/[email protected]', 'k8s.io/client-go/pkg/apis/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Denial of Service (DoS) high golang.org/x/net/http2 ['CVE-2023-44487'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/tools/clientcmd/api/[email protected]', 'k8s.io/apimachinery/pkg/runtime/serializer/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/v1/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling medium golang.org/x/net/http2 ['CVE-2023-39325'] ['0.17.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/tools/clientcmd/api/[email protected]', 'k8s.io/apimachinery/pkg/runtime/serializer/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/v1/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Allocation of Resources Without Limits or Throttling high golang.org/x/net/http2 ['CVE-2023-45288'] ['0.23.0'] ['github.com/portworx/[email protected]', 'k8s.io/client-go/tools/[email protected]', 'k8s.io/client-go/tools/clientcmd/api/[email protected]', 'k8s.io/apimachinery/pkg/runtime/serializer/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/v1/[email protected]', 'k8s.io/apimachinery/pkg/apis/meta/[email protected]', 'k8s.io/apimachinery/pkg/[email protected]', 'k8s.io/apimachinery/pkg/util/[email protected]', 'golang.org/x/net/[email protected]']
Denial of Service (DoS) high google.golang.org/grpc ['CVE-2023-44487'] ['1.56.3', '1.57.1', '1.58.3'] ['github.com/portworx/[email protected]', 'google.golang.org/[email protected]']
Stack-based Buffer Overflow medium google.golang.org/protobuf/encoding/protojson [] ['1.32.0'] ['github.com/portworx/[email protected]', 'github.com/grpc-ecosystem/grpc-gateway/[email protected]', 'github.com/golang/protobuf/[email protected]', 'google.golang.org/protobuf/encoding/[email protected]']
Infinite loop medium google.golang.org/protobuf/encoding/protojson ['CVE-2024-24786'] ['1.33.0'] ['github.com/portworx/[email protected]', 'github.com/grpc-ecosystem/grpc-gateway/[email protected]', 'github.com/golang/protobuf/[email protected]', 'google.golang.org/protobuf/encoding/[email protected]']
Stack-based Buffer Overflow medium google.golang.org/protobuf/encoding/protojson [] ['1.32.0'] ['github.com/portworx/[email protected]', 'github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/[email protected]', 'google.golang.org/protobuf/types/known/[email protected]', 'google.golang.org/protobuf/encoding/[email protected]']
Infinite loop medium google.golang.org/protobuf/encoding/protojson ['CVE-2024-24786'] ['1.33.0'] ['github.com/portworx/[email protected]', 'github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/[email protected]', 'google.golang.org/protobuf/types/known/[email protected]', 'google.golang.org/protobuf/encoding/[email protected]']
Stack-based Buffer Overflow medium google.golang.org/protobuf/encoding/protojson [] ['1.32.0'] ['github.com/portworx/[email protected]', 'google.golang.org/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'google.golang.org/protobuf/encoding/[email protected]']
Infinite loop medium google.golang.org/protobuf/encoding/protojson ['CVE-2024-24786'] ['1.33.0'] ['github.com/portworx/[email protected]', 'google.golang.org/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'google.golang.org/protobuf/encoding/[email protected]']
Stack-based Buffer Overflow medium google.golang.org/protobuf/encoding/protojson [] ['1.32.0'] ['github.com/portworx/[email protected]', 'google.golang.org/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'github.com/golang/protobuf/[email protected]', 'google.golang.org/protobuf/encoding/[email protected]']
Infinite loop medium google.golang.org/protobuf/encoding/protojson ['CVE-2024-24786'] ['1.33.0'] ['github.com/portworx/[email protected]', 'google.golang.org/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'github.com/golang/protobuf/[email protected]', 'google.golang.org/protobuf/encoding/[email protected]']
Infinite loop medium google.golang.org/protobuf/internal/encoding/json ['CVE-2024-24786'] ['1.33.0'] ['github.com/portworx/[email protected]', 'github.com/grpc-ecosystem/grpc-gateway/[email protected]', 'github.com/golang/protobuf/[email protected]', 'google.golang.org/protobuf/encoding/[email protected]', 'google.golang.org/protobuf/internal/encoding/[email protected]']
Infinite loop medium google.golang.org/protobuf/internal/encoding/json ['CVE-2024-24786'] ['1.33.0'] ['github.com/portworx/[email protected]', 'github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/[email protected]', 'google.golang.org/protobuf/types/known/[email protected]', 'google.golang.org/protobuf/encoding/[email protected]', 'google.golang.org/protobuf/internal/encoding/[email protected]']
Infinite loop medium google.golang.org/protobuf/internal/encoding/json ['CVE-2024-24786'] ['1.33.0'] ['github.com/portworx/[email protected]', 'google.golang.org/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'google.golang.org/grpc/internal/[email protected]', 'google.golang.org/protobuf/encoding/[email protected]', 'google.golang.org/protobuf/internal/encoding/[email protected]']
Improper Input Validation high sigs.k8s.io/aws-iam-authenticator/pkg/token ['CVE-2022-2385'] ['0.5.9'] ['github.com/portworx/[email protected]', 'sigs.k8s.io/aws-iam-authenticator/pkg/[email protected]']

Total issues: 43

Copy link

License Evaluation Results:

Title Package Name Package Version Severity License Info Introduced Dependency Type

Total License Issues: 0

@@ -64,7 +64,7 @@ vet:
go vet $(PKGS)

staticcheck:
GOFLAGS="" go install honnef.co/go/tools/cmd/staticcheck@v0.4.7
GOFLAGS="" go install honnef.co/go/tools/cmd/staticcheck@latest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why we are changing this? Because as per I remember when it was 'latest' it was giving error while building docker image due to which we had given a specific version.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 please confirm if we have to use latest or 0.4.7

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-09-02 at 12 07 44 PM Go version 1.23 with staticcheck version 0.4.7 still gives error

@@ -2062,6 +2064,8 @@ message BackupCreateRequest {
map<string, string> volume_snapshot_class_mapping = 19;
// option to take backup as direct kdmp
bool direct_kdmp = 20;
// this flag will check if the backup is a synced backup
bool isSyncedBackup = 21;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we don't need this in create request. As a synced backup is created through the backupsync

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 having the bool in BackupInfo is enough, Since backup sync objects are created through BackupSync function and not backupCreate function in px-backup. Having the variable in BackupInfo as a property of backup (BackupInfo message) should suffice here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbinnal-px @kgarg-px
When we sync the backup, we create a new backup object in the mongodb
so you need the flag in the createBackupRequest as well

@siva-portworx
Copy link
Contributor

@shkumari-px Let us add a flag called backup_variant ( generic backup type) and add enums to classify them as manual /schedule /synced backup.
cc @prashanthpx

@shkumari-px
Copy link
Collaborator Author

Closing this pr
If we have a synced backup then the clusterRef will be nil for it
This check can be used to verify if it’s a synced backup

@shkumari-px shkumari-px closed this Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants