Skip to content

Conversation

@micsthepick
Copy link
Contributor

Set 0600 as the mode for the config file.

@google-cla
Copy link

google-cla bot commented Oct 10, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@micsthepick
Copy link
Contributor Author

@plusvic I can certainly agree to a cla, but this repo has neither a security.md nor a contributing.md?

vt/main.go Outdated
cfg = filepath.Join(home, ".vt.toml")
}

if _, err := os.Stat(cfg); os.IsNotExist(err) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this should be done here. I would put this in the init command, where the .vt.toml file is initially created.

configFile, err := os.Create(configFilePath)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would we still know where the config path is from though? the current solution grabs the correct path from the lib (maybe this is an upstream issue anyways?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I say that because it seems as if the path may be configured through command line args?

Copy link
Member

@plusvic plusvic Oct 10, 2025

Choose a reason for hiding this comment

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

The path for the config file is always the user's home directory. My concern with the proposed change is that the file permissions are set on every execution of the tool, and the file is created if it doesn't exist. This shouldn't be tool's behavior in my opinion. The config file should be created only when the init command is executed, and I agree on setting 0600 permissions when the file is initially created, as it contains the user's API key and it shouldn't be visible to other others.

However, if the user later decides to change the initial permissions for whatever reason, the tool shouldn't be enforcing 0600 permission every time it runs.

… of the tool.

Set 0600 permissions when the file is originally created. From that moment, if the user decides to change the initial permissions, the tool should not be messing up with manually assigned permissions. Also the tool should not create a `.vt.toml` file if it doesn't exist, except when the `init` command is run.
@plusvic plusvic merged commit aa944f0 into VirusTotal:master Oct 10, 2025
2 checks passed
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.

2 participants