-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: disable cert validation in dotnet-portable-executable-cataloger …
…by default (#3677) Signed-off-by: rogueai <[email protected]> Signed-off-by: Keith Zantow <[email protected]> Co-authored-by: Keith Zantow <[email protected]>
- Loading branch information
Showing
9 changed files
with
69 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package options | ||
|
||
import ( | ||
"github.com/anchore/clio" | ||
"github.com/anchore/syft/syft/pkg/cataloger/dotnet" | ||
) | ||
|
||
type dotnetConfig struct { | ||
EnableCertificateValidation bool `json:"enable-certificate-validation" yaml:"enable-certificate-validation" mapstructure:"enable-certificate-validation"` | ||
} | ||
|
||
var _ interface { | ||
clio.FieldDescriber | ||
} = (*dotnetConfig)(nil) | ||
|
||
func (o *dotnetConfig) DescribeFields(descriptions clio.FieldDescriptionSet) { | ||
descriptions.Add(&o.EnableCertificateValidation, `enable certificate validation -- this requires an active internet connection to download certificates and CRLs`) | ||
} | ||
|
||
func defaultDotnetConfig() dotnetConfig { | ||
def := dotnet.DefaultCatalogerConfig() | ||
return dotnetConfig{ | ||
EnableCertificateValidation: def.EnableCertificateValidation, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package dotnet | ||
|
||
type CatalogerConfig struct { | ||
EnableCertificateValidation bool `json:"enable-certificate-validation" yaml:"enable-certificate-validation" mapstructure:"enable-certificate-validation"` | ||
} | ||
|
||
func (c CatalogerConfig) WithCertificateValidation(enable bool) CatalogerConfig { | ||
c.EnableCertificateValidation = enable | ||
return c | ||
} | ||
|
||
func DefaultCatalogerConfig() CatalogerConfig { | ||
return CatalogerConfig{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters