Skip to content
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

Fix: exported component access should be restricted with appropriate permissions #73

Conversation

KCeh
Copy link
Collaborator

@KCeh KCeh commented Jul 14, 2024

📄 Context

Sonar reported issue
This PR fixes that issue.
Feel free to add an additional review(s)

📝 Changes

Since Sentinel activity is marked as android:exported="true" other apps can start that activity. And that is good, this is one of the ideas for Sentinel. Sonar finds this potential security issue because we don't define a mechanism by which apps that can open Sentinel should be "restricted".
To improve upon this I added custom permission that has protectionLevel signature. Meaning: only apps that are signed with the same certificate as Sentinel will be able to start Sentinel. This is perfect for our use case because Sentinel comes with apps.

Also, I ran into some compilation issues due to all modules/tools using the same package so I renamed one constant object in the Timber tool. Since this PR is not big I squeezed those changes here.

🛠️ How to test

There's not much here, just try opening Sentinel in one app that uses lib.

@KCeh KCeh added the enhancement New feature or request label Jul 14, 2024
@KCeh KCeh requested a review from AsimRibo July 14, 2024 14:15
@KCeh KCeh self-assigned this Jul 14, 2024
Copy link

sonarcloud bot commented Jul 14, 2024

Copy link
Contributor

@AsimRibo AsimRibo left a comment

Choose a reason for hiding this comment

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

Looking good. Works good.

@KCeh KCeh merged commit 3527381 into develop Jul 17, 2024
6 checks passed
@KCeh KCeh deleted the fix/Exported-component-access-should-be-restricted-with-appropriate-permissions branch August 20, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants