Overview:
In Artifactory, preventing accidental overwrites of deployed artifacts is essential for maintaining data integrity. This knowledge base provides instructions on how to prevent users or groups from overwriting artifacts.
Preventing Overwrites Using Permission Targets:
To avoid overwrites, administrators have the option to remove the "Delete/Overwrite" permission from users or groups responsible for deploying in the designated repository. By doing so, deployed artifacts are protected from unintentional overwrites. It's important to note that non-unique Maven snapshots can always be overwritten if the "Deploy" permission is granted.
That being said, please note that for the remote repository to function properly and to be able to serve fresh metadata, the “Delete/Overwrite” permission needs to be granted for the corresponding users or groups.
Refer to the Permission Details documentation for a deeper understanding of Artifactory permissions.
Using Workers:
This solution is natively supported on Cloud instances. For Self-hosted instances, it requires that both Artifactory and Workers are deployed via Kubernetes. In both cases, JFrog Advanced Security (JAS) must be enabled for this feature to work.
1. In the UI, navigate to the Administration module → Workers and click on ‘New Worker’ and ‘New Event Driven Worker’:
2. Click on ‘Add’ under ‘Before Upload’.
3. Click on the Drop down list under ‘Code samples’ and click on ‘restrict-overwrite’ and ‘Apply’:
4. Click the gear icon in the upper-right corner and add the repositories where you want to restrict artifact overwriting:
5. Enable the ‘Enable Worker’ toggle located in the top-right corner, and click Save to apply the changes.
By following these methods, Artifactory users can protect their repositories from unintended overwrites, guaranteeing the stability of their critical artifacts.