synopsys_scancli

package
v0.0.0-...-b9085d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Copyright (C) 2020 Synopsys, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (C) 2020 Synopsys, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (C) 2020 Synopsys, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (C) 2020 Synopsys, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (C) 2020 Synopsys, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (C) 2020 Synopsys, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (C) 2020 Synopsys, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchGithubArchive

func FetchGithubArchive(repo string) (string, string, error)

FetchGithubArchive returns tempDir, unzippedDir, error the caller is responsible for removing tempDir

func GitClone

func GitClone(repo string) (string, error)

func RunContainerizedCLI

func RunContainerizedCLI(configPath string)

Types

type BlackduckConfig

type BlackduckConfig struct {
	Host                 string
	Username             string
	Password             string
	Port                 int
	OSType               hubcli.OSType
	ClientTimeoutSeconds int
}

type CodeLocation

type CodeLocation struct {
	GitRepo     *GitRepo
	FileSystem  *FileSystem
	DockerImage *DockerImage
	None        bool
}

type Config

type Config struct {
	Blackduck   *BlackduckConfig
	ImageFacade *ImageFacadeConfig
	ScanQueue   *ScanQueueConfig
	//Scanner     *ScannerConfig // TODO do we need this for anything?
	Polaris *PolarisConfig

	LogLevel string
	Port     int
}

func GetConfig

func GetConfig(configPath string) (*Config, error)

type ContainerizedCLI

type ContainerizedCLI struct {
	// contains filtered or unexported fields
}

func NewContainerizedCLI

func NewContainerizedCLI(scanner *Scanner, client *scanqueue.Client, stop <-chan struct{}) *ContainerizedCLI

type DockerImage

type DockerImage struct {
	PullSpec string
}

type FileSystem

type FileSystem struct {
	Path string
}

type GitRepo

type GitRepo struct {
	Repo string
}

type ImageFacadeConfig

type ImageFacadeConfig struct {
	ImageDirectory          string
	ImagePullerType         string
	PrivateDockerRegistries []docker.RegistryAuth
	DeleteImageAfterScan    bool
}

type ImageSpec

type ImageSpec struct {
	Repository            string
	Tag                   string
	Sha                   string
	HubURL                string
	HubProjectName        string
	HubProjectVersionName string
	HubScanName           string
	Priority              int
	ScanType              string
}

ImageSpec .....

func (*ImageSpec) ImageTag

func (is *ImageSpec) ImageTag() string

type PolarisConfig

type PolarisConfig struct {
	CLIPath  string
	URL      string
	Email    string
	Password string
	OSType   polarisapi.OSType
	JavaHome string
}

type PolarisScanConfig

type PolarisScanConfig struct {
	UseLocalAnalysis bool
}

type ScanConfig

type ScanConfig struct {
	Key          string
	ScanType     *ScanTypeConfig
	CodeLocation *CodeLocation
}

type ScanQueueConfig

type ScanQueueConfig struct {
	Host string
	Port int
}

type ScanTypeConfig

type ScanTypeConfig struct {
	Polaris   *PolarisScanConfig
	Blackduck *hubcli.ScanConfig
}

type Scanner

type Scanner struct {
	Polaris     polaris.ScannerInterface
	Blackduck   hubcli.ScanClientInterface
	ImagePuller docker.ImagePullerInterface
}

func NewScanner

func NewScanner(polaris polaris.ScannerInterface, blackduck hubcli.ScanClientInterface, imagePuller docker.ImagePullerInterface) *Scanner

func NewScannerFromConfig

func NewScannerFromConfig(blackduckCfg *BlackduckConfig, polarisCfg *PolarisConfig, imagePuller *ImageFacadeConfig) (*Scanner, error)

func (*Scanner) Scan

func (sc *Scanner) Scan(scanConfig *ScanConfig) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL