You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DESCRIPTION.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
16
16
- Added an option to exclude `botocore` and `boto3` dependencies by setting `SNOWFLAKE_NO_BOTO` environment variable during installation
17
17
- Revert changing exception type in case of token expired scenario for `Oauth` authenticator back to `DatabaseError`
18
18
- Added support for pandas conversion for Day-time and Year-Month Interval types
19
+
- Enhanced configuration file security checks with stricter permission validation.
20
+
- Configuration files writable by group or others now raise a `ConfigSourceError` with detailed permission information, preventing potential credential tampering.
19
21
- Fix "No AWS region was found" error if AWS region was set in `AWS_DEFAULT_REGION` variable instead of `AWS_REGION` for `WORKLOAD_IDENTITY` authenticator
20
22
- Add `ocsp_root_certs_dict_lock_timeout` connection parameter to set the timeout (in seconds) for acquiring the lock on the OCSP root certs dictionary. Default value for this parameter is -1 which indicates no timeout.
# Check for writable by others - this should raise an error
341
+
if (
342
+
notIS_WINDOWS# Skip checking on Windows
343
+
andsliceoptions.check_permissions# Skip checking if this file couldn't hold sensitive information
344
+
andfilep.stat().st_mode&WRITABLE_BY_OTHERS!=0
345
+
):
346
+
file_stat=filep.stat()
347
+
file_permissions=oct(file_stat.st_mode)[-3:]
348
+
raiseConfigSourceError(
349
+
f"file '{str(filep)}' is writable by group or others — this poses a security risk because it allows unauthorized users to modify sensitive settings. Your Permission: {file_permissions}"
350
+
)
351
+
340
352
# Check for readable by others or wrong ownership - this should warn
f"file '{str(c_file)}' is writable by group or others — this poses a security risk because it allows unauthorized users to modify sensitive settings. Your Permission: {file_permissions}"
662
+
),
663
+
):
664
+
c1["b"]
665
+
666
+
667
+
@pytest.mark.skipif(IS_WINDOWS, reason="chmod doesn't work on Windows")
f"file '{str(c_file)}' is writable by group or others — this poses a security risk because it allows unauthorized users to modify sensitive settings. Your Permission: {file_permissions}"
687
+
),
688
+
):
689
+
c1["b"]
690
+
691
+
# file permissions check can be skipped with unsafe_skip_file_permissions_check flag
692
+
c1.read_config(skip_file_permissions_check=True)
693
+
assertc1["b"] isTrue
694
+
695
+
642
696
@pytest.mark.skipif(IS_WINDOWS, reason="chmod doesn't work on Windows")
0 commit comments