Skip to content

Commit

Permalink
Merge pull request #17 from talsec/release-1.5.0
Browse files Browse the repository at this point in the history
Release 1.5.0
  • Loading branch information
msikyna committed Sep 26, 2024
2 parents 608eaeb + b0a17cd commit a19402f
Show file tree
Hide file tree
Showing 53 changed files with 1,217 additions and 6,949 deletions.
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,47 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [1.5.0] - 2024-09-25

- Android SDK version: 11.1.0
- iOS SDK version: 6.6.0

### Capacitor

#### Changed

- Improved error messages when validation of the freeRASP configuration fails

### Android

#### Added

- Added the auditing of the internal execution for the future check optimization and overall security improvements.

#### Fixed

- Fixed native crashes (SEGFAULT errors) in `ifpip` method
- Fixed collision for command line tools (like ping) invoked without absolute path

#### Changed

- ❗️Breaking: Changed the way TalsecConfig is created, we introduced a Builder pattern to make the process more streamlined and readable
- Updated OpenSSL to version 3.0.14
- Updated CURL to version 8.8.0
- Refactored fetching the list of installed applications for root and hook detection.

### iOS

#### Added

- [Dopamine](https://github.com/opa334/Dopamine) jailbreak detection.
- Enhanced and accelerated the data collection logic

#### Changed

- Updated OpenSSL to version 3.0.14
- Updated CURL to version 8.8.0

## [1.4.1] - 2024-07-02

### Capacitor
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

freeRASP for Capacitor is a mobile in-app protection and security monitoring plugin. It aims to cover the main aspects of RASP (Runtime App Self Protection) and application shielding.

:loudspeaker: The official documentation has been moved to a new location. You can now find it [here](https://docs.talsec.app/freerasp). :loudspeaker:
:loudspeaker: The official documentation has been moved to a new location. You can now find it [here](https://docs.talsec.app/docs-and-articles-portal). :loudspeaker:


# Overview
Expand Down Expand Up @@ -46,10 +46,12 @@ Learn more about commercial features at [https://talsec.app](https://talsec.app)

Learn more about freemium freeRASP features at [GitHub main repository](https://github.com/talsec/Free-RASP-Community).

# :book: Discover Official Documentation
Visit the [GitBook page](https://docs.talsec.app/freerasp) for comprehensive and up-to-date guides, tutorials, and technical documentation. It serves as your go-to resource, offering everything from basic instructions to advanced tips and tricks to help you get the most out of the project.
# :book: Discover the Official freeRASP Documentation

Visit the [GitBook page](https://docs.talsec.app/freerasp) for comprehensive and up-to-date guides, tutorials, and technical documentation specifically for freeRASP. It serves as your go-to resource, offering everything from basic instructions to advanced tips and tricks to help you get the most out of the project.

## :link: Integration Guide

For integrating freeRASP on the Capacitor platform, be sure to follow all the steps in the [Integration Guide](https://docs.talsec.app/freerasp/integration). This guide provides detailed instructions to help you achieve a smooth and efficient integration.

Be sure to bookmark it and stay informed! :books: :sparkles:.
Expand All @@ -61,6 +63,7 @@ If you have any suggestions for improvement or notice anything that could be cla
For information on older integration methods, you can refer to the [freeRASP wiki](https://github.com/talsec/Free-RASP-Capacitor/wiki), which includes comprehensive legacy details and guidance. Additionally, the old integration can be found when you checkout to a specific tag. Your input is invaluable in helping us improve our resources and provide even better support for your needs.

# :rocket: What's New and Changelog

Stay informed and make the most of freeRASP by checking out [What's New and Changelog](https://docs.talsec.app/freerasp/whats-new-and-changelog)! Here, you’ll discover the latest features, enhancements, and bug fixes we’ve implemented to improve your experience across all platforms, including Android, iOS, Flutter, React Native, Capacitor, and Cordova.

Don’t miss out on any updates and explore the changelog to see how we’re continually making freeRASP better for you!
Expand All @@ -70,3 +73,7 @@ Don’t miss out on any updates and explore the changelog to see how we’re con
If you have any ideas for improvements, feel free to [raise an issue](https://github.com/talsec/Free-RASP-Capacitor/issues) and mark it with an **enhancement** label. We track these enhancements using [GitHub Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects) to keep tasks organized and connected to relevant issues or pull requests.

You can check out the project board [here](https://github.com/orgs/talsec/projects/2).

# :page_facing_up: License

This project is provided as freemium software, i.e. there is a fair usage policy that imposes some limitations on the free usage. The SDK software consists of open-source and binary parts, which is the property of Talsec. The open-source part is licensed under the MIT License - see the LICENSE file for details.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ dependencies {
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"

implementation 'com.aheaditec.talsec.security:TalsecSecurity-Community-Capacitor:9.6.0'
implementation 'com.aheaditec.talsec.security:TalsecSecurity-Community-Capacitor:11.1.0'
}
39 changes: 12 additions & 27 deletions android/src/main/java/com/aheaditec/freerasp/FreeraspPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ class FreeraspPlugin : Plugin() {
return
}
try {
val talsecConfig = parseTalsecConfigThrowing(config)
val talsecConfig = buildTalsecConfigThrowing(config)
listener.registerListener(context)
bridge.activity.runOnUiThread {
Talsec.start(context, talsecConfig)
}
Talsec.start(context, talsecConfig)
call.resolve(JSObject().put("started", true))
} catch (e: Exception) {
call.reject("Error during Talsec Native plugin initialization - ${e.message}", null, e)
call.reject("Error during Talsec Native plugin initialization - ${e.message}", "TalsecInitializationError", e)
}
}

Expand Down Expand Up @@ -86,34 +89,16 @@ class FreeraspPlugin : Plugin() {
notifyListeners(THREAT_CHANNEL_NAME, JSObject().put(THREAT_CHANNEL_KEY, threat.value), true)
}

private fun parseTalsecConfigThrowing(configJson: JSObject): TalsecConfig {
private fun buildTalsecConfigThrowing(configJson: JSObject): TalsecConfig {
val androidConfig = configJson.getJSONObject("androidConfig")
val packageName = androidConfig.getString("packageName")
val certificateHashes = mutableListOf<String>()
val hashes = androidConfig.getJSONArray("certificateHashes")
if (hashes.length() == 0) {
throw IllegalArgumentException("At least 1 certificate hash is required.")
}
for (i in 0 until hashes.length()) {
certificateHashes.add(hashes.getString(i))
}
val watcherMail = configJson.getString("watcherMail")
val alternativeStores = mutableListOf<String>()
if (androidConfig.has("supportedAlternativeStores")) {
val stores = androidConfig.getJSONArray("supportedAlternativeStores")
for (i in 0 until stores.length()) {
alternativeStores.add(stores.getString(i))
}
}
val isProd = configJson.getBool("isProd") ?: true
val certificateHashes = androidConfig.getArraySafe("certificateHashes")
val talsecBuilder = TalsecConfig.Builder(packageName, certificateHashes)
.watcherMail(configJson.getString("watcherMail"))
.supportedAlternativeStores(androidConfig.getArraySafe("supportedAlternativeStores"))
.prod(configJson.getBool("isProd") ?: true)

return TalsecConfig(
packageName,
certificateHashes.toTypedArray(),
watcherMail,
alternativeStores.toTypedArray(),
isProd
)
return talsecBuilder.build()
}

companion object {
Expand Down
3 changes: 3 additions & 0 deletions android/src/main/java/com/aheaditec/freerasp/ThreatHandler.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.aheaditec.freerasp

import com.aheaditec.talsec_security.security.api.SuspiciousAppInfo
import com.aheaditec.talsec_security.security.api.ThreatListener

internal class TalsecThreatHandler(private val instance: FreeraspPlugin) :
Expand Down Expand Up @@ -37,6 +38,8 @@ internal class TalsecThreatHandler(private val instance: FreeraspPlugin) :
instance.notifyListeners(Threat.ObfuscationIssues)
}

override fun onMalwareDetected(p0: MutableList<SuspiciousAppInfo>?) {}

override fun onUnlockedDeviceDetected() {
instance.notifyListeners(Threat.Passcode)
}
Expand Down
22 changes: 22 additions & 0 deletions android/src/main/java/com/aheaditec/freerasp/Utils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.aheaditec.freerasp

import org.json.JSONArray
import org.json.JSONObject

class Utils {}

internal fun JSONArray.toArray(): Array<String> {
val output = mutableListOf<String>()
for (i in 0 until this.length()) {
this.getString(i)?.let(output::add)
}
return output.toTypedArray()
}

internal fun JSONObject.getArraySafe(key: String): Array<String> {
if (this.has(key)) {
val inputArray = this.getJSONArray(key)
return inputArray.toArray()
}
return arrayOf()
}
2 changes: 1 addition & 1 deletion dist/esm/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import type { FreeraspPlugin, FreeraspConfig, NativeEventEmitterActions } from '
declare const Freerasp: FreeraspPlugin;
declare const setThreatListeners: <T extends NativeEventEmitterActions>(callbacks: T & Record<Exclude<keyof T, keyof NativeEventEmitterActions>, []>) => Promise<void>;
declare const removeThreatListeners: () => void;
declare const startFreeRASP: <T extends NativeEventEmitterActions>(config: FreeraspConfig, reactions: T & Record<Exclude<keyof T, keyof NativeEventEmitterActions>, []>) => Promise<boolean>;
declare const startFreeRASP: <T extends NativeEventEmitterActions>(config: FreeraspConfig, reactions: T & Record<Exclude<keyof T, keyof NativeEventEmitterActions>, []>) => Promise<boolean | undefined>;
export * from './definitions';
export { Freerasp, startFreeRASP, setThreatListeners, removeThreatListeners };
11 changes: 8 additions & 3 deletions dist/esm/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a19402f

Please sign in to comment.