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

feat: add maas plugin #160

Merged
merged 19 commits into from
Aug 13, 2024
Merged

feat: add maas plugin #160

merged 19 commits into from
Aug 13, 2024

Conversation

TylerGillson
Copy link
Member

@TylerGillson TylerGillson commented Aug 12, 2024

Issue

Resolves #113

Description

Add support for the MAAS plugin to validatorctl.

arturshadnik and others added 5 commits August 9, 2024 13:05
## Issue
Resolves #99

## Description
Rather than prompting users to select individual vCenter privileges,
allow them to either specify a local file containing a single privilege
per line or edit a file that's pre-populated with all valid privileges.

---------

Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
N/A

Remove explicit TypeMeta initialization for direct rule evaluation. This
is no longer needed now that the `ValidationRule` interface in validator
has been updated to include `GetKind`, all plugins are updated to
satisfy the updated interface, and validator's `Build` validation result
method is now setting `APIVersion` and `Kind`.

---------

Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
Copy link

gitguardian bot commented Aug 12, 2024

⚠️ GitGuardian has uncovered 6 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
13388491 Triggered Generic High Entropy Secret 042f0c6 hack/validator.tmpl View secret
13388491 Triggered Generic High Entropy Secret 2abe222 hack/validator.tmpl View secret
13388493 Triggered Generic High Entropy Secret 2abe222 hack/validator.tmpl View secret
13388493 Triggered Generic High Entropy Secret 2927af9 tests/integration/_validator/testcases/data/validator.yaml View secret
13388493 Triggered Generic High Entropy Secret 14bd56c tests/integration/_validator/testcases/data/validator.yaml View secret
13388493 Triggered Generic High Entropy Secret 14bd56c tests/integration/_validator/testcases/data/validator.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

TylerGillson and others added 6 commits August 12, 2024 12:45
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
@arturshadnik arturshadnik marked this pull request as ready for review August 12, 2024 20:02
@arturshadnik arturshadnik requested a review from a team as a code owner August 12, 2024 20:02
@arturshadnik arturshadnik self-requested a review August 12, 2024 20:02
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. new-feature Net-new feature labels Aug 12, 2024
pkg/cmd/validator/validator.go Outdated Show resolved Hide resolved
pkg/cmd/validator/validator.go Outdated Show resolved Hide resolved
pkg/components/validator.go Outdated Show resolved Hide resolved
pkg/components/validator.go Show resolved Hide resolved
pkg/services/validator/maas.go Outdated Show resolved Hide resolved
pkg/services/validator/maas.go Outdated Show resolved Hide resolved
pkg/services/validator/maas.go Outdated Show resolved Hide resolved
pkg/services/validator/maas.go Outdated Show resolved Hide resolved
pkg/services/validator/maas.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 20.17391% with 459 lines in your changes missing coverage. Please review.

Files Patch % Lines
pkg/services/validator/maas.go 3.24% 351 Missing and 7 partials ⚠️
pkg/services/clouds/maas_service.go 18.96% 40 Missing and 7 partials ⚠️
pkg/cmd/validator/validator.go 29.72% 25 Missing and 1 partial ⚠️
pkg/components/validator.go 50.00% 11 Missing and 4 partials ⚠️
pkg/services/validator/validator_service.go 54.54% 7 Missing and 3 partials ⚠️
...integration/_validator/testcases/test_validator.go 94.82% 3 Missing ⚠️
@@           Coverage Diff           @@
##             main     #160   +/-   ##
=======================================
  Coverage        ?   31.35%           
=======================================
  Files           ?       43           
  Lines           ?     5990           
  Branches        ?        0           
=======================================
  Hits            ?     1878           
  Misses          ?     3775           
  Partials        ?      337           
Files Coverage Δ
pkg/config/constants.go 100.00% <ø> (ø)
pkg/services/validator/aws.go 14.39% <ø> (ø)
...integration/_validator/testcases/test_validator.go 81.67% <94.82%> (ø)
pkg/services/validator/validator_service.go 40.04% <54.54%> (ø)
pkg/components/validator.go 50.72% <50.00%> (ø)
pkg/cmd/validator/validator.go 27.88% <29.72%> (ø)
pkg/services/clouds/maas_service.go 18.96% <18.96%> (ø)
pkg/services/validator/maas.go 3.24% <3.24%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 416d23c...c315b3f. Read the comment docs.

pkg/services/validator/maas.go Outdated Show resolved Hide resolved
pkg/services/validator/maas.go Outdated Show resolved Hide resolved
arturshadnik and others added 3 commits August 13, 2024 13:16
fix: typo in plugin name

test: decrease scope of maas client mock

chore: change tab to spaces to satisfy lint

style: remove extra blank line

test: move mocks into maas service

chore: add nosec directive

feat: support configuring oci validationType on a rule (#161)

This PR swaps out configuring the `SkipLayerValidation` flag (which no
longer exists) for the `ValidationType` which can be set to none, fast,
or full.

For now, i've opted to only allow the tui to configure this field on the
host level (ie for all artifacts on in a rule). We can also add extra
prompts to override for a particular artifact, but i felt like it would
just make the tui flow more cumbersome.

feat: WIP - add maas plugin

feat: WIP: add maas plugin

chore: make reviewable
Signed-off-by: Artur Shad Nik <37195151+arturshadnik@users.noreply.github.com>
test: reassign maas client after tests
test: enable all integration tests
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 13, 2024
@TylerGillson TylerGillson merged commit ab9f21a into main Aug 13, 2024
7 checks passed
@TylerGillson TylerGillson deleted the feat/add-maas-plugin branch August 13, 2024 22:10
ahmad-ibra pushed a commit that referenced this pull request Aug 19, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.1.2](v0.1.1...v0.1.2)
(2024-08-19)


### Features

* add maas plugin
([#160](#160))
([ab9f21a](ab9f21a))
* allow selecting aws creds from filesystem
([#171](#171))
([c3a714c](c3a714c))
* allow specifying Azure cloud to connect to
([#170](#170))
([6a4a704](6a4a704))
* read vCenter privileges from local file or editor
([#152](#152))
([94ddd90](94ddd90))
* set exit code 2 on validation failure; restore debug log file
([#150](#150))
([2a3fe4d](2a3fe4d))
* support configuring oci validationType on a rule
([#161](#161))
([8dfc501](8dfc501))
* support direct oci validation of private registries
([#173](#173))
([9cfeab9](9cfeab9))


### Bug Fixes

* correct TUI flow for `validator install -o --apply`
([#169](#169))
([0912f6e](0912f6e))
* export creds for aws and azure direct check
([#167](#167))
([5d569de](5d569de))


### Dependency Updates

* **deps:** update anchore/sbom-action action to v0.17.1
([#163](#163))
([416d23c](416d23c))
* **deps:** update github.com/validator-labs/validator-plugin-azure
digest to b4687e5
([#149](#149))
([e7ab9a6](e7ab9a6))
* **deps:** update github.com/validator-labs/validator-plugin-vsphere
digest to a93cb70
([#147](#147))
([79304b9](79304b9))
* **deps:** update module github.com/vmware/govmomi to v0.40.0
([#162](#162))
([acf4a25](acf4a25))


### Refactoring

* lazy configuration of oci auth and signature verification secrets
([#168](#168))
([cc2c056](cc2c056))
* remove explicit TypeMetas; use vapi constants
([#154](#154))
([28b321c](28b321c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer new-feature Net-new feature size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ MAAS plugin support
2 participants