kubescape / operator

Operator is an in-cluster component of the Kubescape security platform. It allows clients to connect to itself, listens for commands from the connected clients and controls other in-cluster components according to received commands.
Apache License 2.0
13 stars 20 forks source link

Support backend access key #175

Closed rcohencyberarmor closed 1 year ago

rcohencyberarmor commented 1 year ago

PR Type:

Enhancement


PR Description:

This pull request introduces the use of access tokens when connecting to the backend. The access token is loaded from a secret file and added to the headers of the HTTP requests. This enhancement improves the security of the backend connection.


PR Main Files Walkthrough:

files: `config/config.go`: Added a new variable 'SD' of type SecretData to hold the access token. Also, a new function 'LoadSecret' was introduced to load the access token from a secret file. `main.go`: The 'LoadSecret' function is called to load the access token from '/etc/access-token-secret'. If an error occurs, it is logged and the program exits. `utils/typesutils.go`: A new function 'setPostResultHeaders' was added to set the 'Authorization' header with the access token for HTTP requests. The 'NewSessionObj' function was updated to use this new function when creating a new 'BaseReportSender'. `go.mod`: Updated the versions of 'github.com/kubescape/backend' and 'github.com/emicklei/go-restful/v3'. Also, 'github.com/kubescape/kubevuln' was added. `go.sum`: The checksums for the updated and new dependencies in 'go.mod' were added.

User Description:

Overview

This PR fixes #

Signed Commits

codiumai-pr-agent-free[bot] commented 1 year ago

PR Analysis

How to use

To invoke the PR-Agent, add a comment using one of the following commands: /review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option. /describe: Modify the PR title and description based on the contents of the PR. /improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback. /ask \<QUESTION>: Pose a question about the PR. /update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value For example: /review --pr_reviewer.extra_instructions="focus on the file: ..." To list the possible configuration parameters, use the /config command.

github-actions[bot] commented 1 year ago

Summary:

github-actions[bot] commented 1 year ago

Summary:

github-actions[bot] commented 1 year ago

Summary:

github-actions[bot] commented 1 year ago

Summary: