Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3655d8a authored by Rubin Xu's avatar Rubin Xu
Browse files

Security log: additional events for WiFi and BLE connections

Bug: 194988881
CTS-Coverage-Bug: 218677588
Test: atest MixedDeviceOwnerTest#testSecurityLoggingWithSingleUser
Test: atest OrgOwnedProfileOwnerTest#testSecurityLogging

Change-Id: I98d1c8fcd4fae334f1f770751b047dc8ab07c7c5
parent 9c3342f9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -7849,6 +7849,8 @@ package android.app.admin {
    field public static final int TAG_ADB_SHELL_CMD = 210002; // 0x33452
    field public static final int TAG_ADB_SHELL_INTERACTIVE = 210001; // 0x33451
    field public static final int TAG_APP_PROCESS_START = 210005; // 0x33455
    field public static final int TAG_BLUETOOTH_CONNECTION = 210039; // 0x33477
    field public static final int TAG_BLUETOOTH_DISCONNECTION = 210040; // 0x33478
    field public static final int TAG_CAMERA_POLICY_SET = 210034; // 0x33472
    field public static final int TAG_CERT_AUTHORITY_INSTALLED = 210029; // 0x3346d
    field public static final int TAG_CERT_AUTHORITY_REMOVED = 210030; // 0x3346e
@@ -7881,6 +7883,8 @@ package android.app.admin {
    field public static final int TAG_SYNC_SEND_FILE = 210004; // 0x33454
    field public static final int TAG_USER_RESTRICTION_ADDED = 210027; // 0x3346b
    field public static final int TAG_USER_RESTRICTION_REMOVED = 210028; // 0x3346c
    field public static final int TAG_WIFI_CONNECTION = 210037; // 0x33475
    field public static final int TAG_WIFI_DISCONNECTION = 210038; // 0x33476
    field public static final int TAG_WIPE_FAILURE = 210023; // 0x33467
  }
+50 −0
Original line number Diff line number Diff line
@@ -92,6 +92,10 @@ public class SecurityLog {
            TAG_CAMERA_POLICY_SET,
            TAG_PASSWORD_COMPLEXITY_REQUIRED,
            TAG_PASSWORD_CHANGED,
            TAG_WIFI_CONNECTION,
            TAG_WIFI_DISCONNECTION,
            TAG_BLUETOOTH_CONNECTION,
            TAG_BLUETOOTH_DISCONNECTION,
    })
    public @interface SecurityLogTag {}

@@ -512,6 +516,52 @@ public class SecurityLog {
     */
    public static final int TAG_PASSWORD_CHANGED = SecurityLogTags.SECURITY_PASSWORD_CHANGED;

    /**
     * Indicates that the device attempts to connect to a WiFi network.
     * The log entry contains the following information about the
     * event, encapsulated in an {@link Object} array and accessible via
     * {@link SecurityEvent#getData()}:
     * <li> [0] The SSID of the network ({@code String})
     * <li> [1] The BSSID of the network ({@code String})
     * <li> [2] Whether the connection is successful ({@code Integer}, 1 if successful, 0 otherwise)
     * <li> [3] Optional human-readable failure reason, empty string if none ({@code String})
     */
    public static final int TAG_WIFI_CONNECTION = SecurityLogTags.SECURITY_WIFI_CONNECTION;

    /**
     * Indicates that the device disconnects from a connected WiFi network.
     * The log entry contains the following information about the
     * event, encapsulated in an {@link Object} array and accessible via
     * {@link SecurityEvent#getData()}:
     * <li> [0] The SSID of the connected network ({@code String})
     * <li> [1] The BSSID of the connected network ({@code String})
     * <li> [2] Optional human-readable disconnection reason, empty string if none ({@code String})
     */
    public static final int TAG_WIFI_DISCONNECTION = SecurityLogTags.SECURITY_WIFI_DISCONNECTION;

    /**
     * Indicates that the device attempts to connect to a Bluetooth device.
     * The log entry contains the following information about the
     * event, encapsulated in an {@link Object} array and accessible via
     * {@link SecurityEvent#getData()}:
     * <li> [0] The MAC address of the Bluetooth device ({@code String})
     * <li> [1] Whether the connection is successful ({@code Integer}, 1 if successful, 0 otherwise)
     * <li> [2] Optional human-readable failure reason, empty string if none ({@code String})
     */
    public static final int TAG_BLUETOOTH_CONNECTION =
            SecurityLogTags.SECURITY_BLUETOOTH_CONNECTION;

    /**
     * Indicates that the device disconnects from a connected Bluetooth device.
     * The log entry contains the following information about the
     * event, encapsulated in an {@link Object} array and accessible via
     * {@link SecurityEvent#getData()}:
     * <li> [0] The MAC address of the connected Bluetooth device ({@code String})
     * <li> [1] Optional human-readable disconnection reason, empty string if none ({@code String})
     */
    public static final int TAG_BLUETOOTH_DISCONNECTION =
            SecurityLogTags.SECURITY_BLUETOOTH_DISCONNECTION;

    /**
     * Event severity level indicating that the event corresponds to normal workflow.
     */
+5 −1
Original line number Diff line number Diff line
@@ -41,3 +41,7 @@ option java_package android.app.admin
210034 security_camera_policy_set               (package|3),(admin_user|1),(target_user|1),(disabled|1)
210035 security_password_complexity_required    (package|3),(admin_user|1),(target_user|1),(complexity|1)
210036 security_password_changed                (password_complexity|1),(target_user|1)
210037 security_wifi_connection                 (ssid|3),(bssid|3),(success|1),(reason|3)
210038 security_wifi_disconnection              (ssid|3),(bssid|3),(reason|3)
210039 security_bluetooth_connection            (addr|3),(success|1),(reason|3)
210040 security_bluetooth_disconnection         (addr|3),(reason|3)
 No newline at end of file