-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature/confidential-protection] Confidential Content Protection #1430
base: master
Are you sure you want to change the base?
Conversation
This update introduces screenshot protection for confidentially marked views in the app and the share sheet extension. When a screenshot is taken, confidential views will not display their content in the screenshot. To discourage taking photos of confidential views, these views now include a watermark displaying the account’s email and username. Screenshot protection can be enabled via an MDM parameter. Additionally, to prevent sharing confidential data when screenshot protection or confidential view marking is enabled, the following features are disabled: - File Provider access - Shortcuts Intents - System sharing dialog actions - Copying files - Text recognition on images This behavior can be overridden using an MDM parameter; however, overriding it is not recommended.
- Adjusted watermark angle for improved alignment - Updated GitHub Action workflow: - Fetch the latest available OS version - Retrieve iPhone simulator device for the selected OS version
To fix CI I suggest to use this action https://github.com/marketplace/actions/mxcl-xcodebuild In a second step let's define different combinations which we want to build and test in the future |
- Updated default values for confidential MDM settings - Adjusted rotation angle for confidential text - Added a subtitle to small confidential views and modified text color opacity
- Preserved accessory views by ensuring watermarks are not applied to them - Added missing file from the last commit
First, preliminary and exploratory testing, with commit Assumed: protection only affects to:
is that right? 1. Screenshot protection:Using the following set up:
ScreenRecording_12-18-2024.12-22-30_1.MP4are the username and the account sensible information? the issue is even more visible in iPad, where the sidebar menu is always in foreground.
2. Watermarkingno issues detected at this point. 3. confidential.allow-overwrite-confidential-mdm-settings
that was just a first preliminary testing, final testing will be done when CR passed. This first step helped to design the feature test plan. |
@hosy There is a redraw error when switching the collection view layout from list to grid or other formats. This issue needs to be fixed. |
ownCloudAppShared/User Interface/Confidential/SecureTextField.swift
Outdated
Show resolved
Hide resolved
ownCloudAppShared/Client/View Controllers/Location Picker/ClientLocationPicker.swift
Outdated
Show resolved
Hide resolved
ownCloudAppShared/Client/Collection Views/CollectionViewController.swift
Outdated
Show resolved
Hide resolved
…ching this point.
- ConfidentialManager: - implement OCClassSettingsSource to inject settings - remove effectless "action.allow-image-interactions" from .disallowedActions - IntentSettings, ImageScrollView, OCFileProviderSettings: remove ConfidentialManager references (=> equivalent implemented via ConfidentialManager<OCClassSettingsSource>) - Action: use actionIdentifier directly, instead of rawValue - FileProvider: add ConfidentialManager to build target
- ShareViewController: remove redundant screenshot protection code - BrowserNavigationViewController: fully adopt UIView.withScreenshotProtection - ConfidentialContentView, SecureTextField: fix SwiftLint warnings
…n from init/allowedLocationFilter to .provideViewController()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented the remaining open findings and suggestions.
is that QA-ready? @felix-schwarz @hosy |
@jesmrec Yes it is. I was just busy updating the iOS Team project and would've told you in a minute :) |
During QA phase it's assumed that protection only affects to:
|
(1) [FIXED]
with that setup, i notice that the space name is not redacted here: it should be also redacted as the other red-rounded appearances. Could you take a look @hosy @felix-schwarz iPhoneXR iOS18 |
(2) (question)This is maybe a pretty corner case, or a feature (not a bug) First three letters of space name are visible and the other letters are redacted. But, if the space name has just three letters (for example, an subject or name abbreviation), it won't be redacted at all. Should space names to be completely redacted? maybe reducing to two letters of visibilty will avoid more cases of short words or abbreviations that could be infered. |
@jesmrec (1) is fixed and some additional titles in copy and delete actions |
@hosy, thanks for fixing (1). You gave me the clue to find other visible file names:
|
conflict on submodulle .... @hosy FYI |
(3) [FIXED]with the following setup
i get the following error, not being able to open the fp's content: ScreenRecording_01-21-2025.18-03-10_1.MP4iPhoneXR iOS18 |
@hosy @felix-schwarz in one of our meetings we talked about subtitling videos to avoid recording the audio under the |
Only a POC was implemented but we left this out of this pull request to not overload this feature |
(4)
Current: here i found some problems:
Could it be a good idea to remove the iPhoneXR iOS18 |
- allow redacting item names in Move and Sharing operations (QA finding fix)
@jesmrec I made sure these are also redacted as of 6f41013, but I'm wondering if this is really necessary. To quote the original description for the redact item name feature: "[…] UI elements that are difficult to watermark are redacted after the third character". But since those areas already are watermarked, should they really also be redacted? |
@jesmrec Re (3): assuming this happened on an actual device, I'd think it's a typical memory limit crash & error message that's responsible for this. Please try again with the latest commits, which now include the latest mem-optimizations. |
(3) is fixed 👍 (1) also fixed (2) is a question, ftm we can keep 3 letters in the redacted names only (4) is pending. After that, i will do a second QA round to assure nothing was broken. |
- add markup action to list of disallowedActions. The markup action could not be modified to implement protection mechanisms - not even on the CALayer level - without interaction with the system-provided view breaking - ConfidentialContentView: - break up ConfidentialContentView into Watermark (struct) and a CGContext extension to draw watermarks - refactor ConfidentialContentView to call the CGContext extension and use the Watermark struct - implement a CALayer subclass that also draws its content via the CGContext extension using the Watermark struct - extend the UIView extension to allow choosing between watermarking by subview or sublayer - context: these changes were made in an attempt to see if watermarking can be made work with EditDocumentViewController, which eventually failed (see above) - SecureTextField: remove unused code path, eliminating the compiler warning - EditDocumentViewController: change place where the watermark view is injected, allowing it to be sized correctly directly - addresses finding (4) in #1430
Re (4): the markup feature is delivered by the Unfortunately, all attempts to add the protection features around it eventually failed. I documented it with this code commend:
I therefore added the markup action to the list of actions to disallow if protection features are used. It simply doesn't currently seem technically possible to offer that action under the protection umbrella. From my POV this PR is now ready for a final QA round @jesmrec. |
Description
Confidential View and Screenshot Protection
This update introduces screenshot protection for confidentially marked views in the app and the share sheet extension. When a screenshot is taken, confidential views will not display their content in the screenshot.
To discourage taking photos of confidential views, these views now include a watermark displaying the account’s email and username.
Screenshot protection can be enabled via an MDM parameter.
File or path names displayed in UI elements that are difficult to watermark are redacted after the third character. This ensures the user can identify the file or path name to some extent, but it remains unreadable for security.
Additionally, to prevent sharing confidential data when screenshot protection or confidential view marking is enabled, the following features are disabled:
This behavior can be overridden using an MDM parameter; however, overriding it is not recommended.
MDM Parameter
confidential.allow-screenshots
confidential.mark-confidential-views
confidential.allow-overwrite-confidential-mdm-settings
Screenshots
Confidential View
Screenshot Protection
Testing
Add at least one of the following MDM parameters to the
Branding.plist
:confidential.allow-screenshots
Boolean
NO
confidential.mark-confidential-views
Boolean
YES
If you want to allow File Provider access or Actions set the key
confidential.allow-overwrite-confidential-mdm-settings
toBoolean
YES
.Screenshot protection is only working on a physical device!
What to test:
QA:
Test plan: https://github.com/owncloud/QA/blob/master/Mobile/iOS/Executions/Version%2012.4/Content%20Protection.md
Reports:
Related Issue
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist: