IAM Role-based permissions for data sources (namely S3) #10308

Closed
opened 2025-12-29 21:29:41 +01:00 by adam · 3 comments
Owner

Originally created by @kennedymeadows on GitHub (Sep 30, 2024).

NetBox version

v3.7.4

Feature type

Change to existing functionality

Proposed functionality

Currently, in order to add a new Amazon S3 bucket as a data source, you are required to provide an AWS access key ID and AWS secret access key. The requested change is to make these fields optional as it is possible to grant role based permissions to the server which is running Netbox to allow access to a bucket.

This is already possible for media storage via configuration.py:

# By default, uploaded media is stored on the local filesystem. Using Django-storages is also supported. Provide the
# class path of the storage driver in STORAGE_BACKEND and any configuration options in STORAGE_CONFIG. For example:
STORAGE_BACKEND = 'storages.backends.s3boto3.S3Boto3Storage'
STORAGE_CONFIG = {
    # 'AWS_ACCESS_KEY_ID': 'Key ID',
    # 'AWS_SECRET_ACCESS_KEY': 'Secret',
    'AWS_STORAGE_BUCKET_NAME': '<%= @netbox_data['s3']['bucket'] %>',
    'AWS_S3_REGION_NAME': 'us-west-2',
}

Use case

This would allow for script and report uploads for users who use role-based permissions for S3 access.

Database changes

No response

External dependencies

No response

Originally created by @kennedymeadows on GitHub (Sep 30, 2024). ### NetBox version v3.7.4 ### Feature type Change to existing functionality ### Proposed functionality Currently, in order to add a new Amazon S3 bucket as a data source, you are required to provide an AWS access key ID and AWS secret access key. The requested change is to make these fields optional as it is possible to grant role based permissions to the server which is running Netbox to allow access to a bucket. This is already possible for media storage via `configuration.py`: ``` # By default, uploaded media is stored on the local filesystem. Using Django-storages is also supported. Provide the # class path of the storage driver in STORAGE_BACKEND and any configuration options in STORAGE_CONFIG. For example: STORAGE_BACKEND = 'storages.backends.s3boto3.S3Boto3Storage' STORAGE_CONFIG = { # 'AWS_ACCESS_KEY_ID': 'Key ID', # 'AWS_SECRET_ACCESS_KEY': 'Secret', 'AWS_STORAGE_BUCKET_NAME': '<%= @netbox_data['s3']['bucket'] %>', 'AWS_S3_REGION_NAME': 'us-west-2', } ``` ### Use case This would allow for script and report uploads for users who use role-based permissions for S3 access. ### Database changes _No response_ ### External dependencies _No response_
adam closed this issue 2025-12-29 21:29:41 +01:00
Author
Owner

@kennedymeadows commented on GitHub (Sep 30, 2024):

I should add that this has actually already been asked but there was no response. It was a pretty old issue so I created this new one for clarity: https://github.com/netbox-community/netbox/issues/13072

@kennedymeadows commented on GitHub (Sep 30, 2024): I should add that this has actually already been asked but there was no response. It was a pretty old issue so I created this new one for clarity: https://github.com/netbox-community/netbox/issues/13072
Author
Owner

@github-actions[bot] commented on GitHub (May 8, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (May 8, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/main/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Jun 14, 2025):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Jun 14, 2025): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10308