You can investigate an unrecognized Soracom Access Management (SAM) user in two ways. Check the user's details to see when it was created and when its AuthKeys were last used. Then review Audit Logs to see which user called the Soracom API and from which IP address. Finding out who created the user requires the Audit Logs Enterprise Option to have been enabled when the user was created.
Step 1: Review the SAM User's Details
Use the Get User API (GET /operators/{operator_id}/users/{user_name}, or soracom users get in the Soracom CLI) to get the user's details. To review every SAM user in your account, use the List Users API (GET /operators/{operator_id}/users). These fields help with your investigation:
-
createDateTime: when the SAM user was created (UNIX time in seconds) -
updateDateTime: when the SAM user was last updated -
hasPassword: whether a User Console sign-in password is set -
authKeyList: each AuthKey'sauthKeyId,createDateTime, andlastUsedDateTime -
roleListandpermission: what the user is allowed to do
If an AuthKey has a lastUsedDateTime value, that key has been used to authenticate with the Soracom API.
Step 2: Check the API Audit Logs
Audit Logs record calls to the Soracom API made from your account. What is recorded, and for how long, depends on your Audit Logs option:
-
Standard Option (included by default): Only logins to the User Console and calls to the
/v1/authAPI are recorded. Logs are kept for 24 hours. - Enterprise Option (paid subscription): Calls to all APIs are recorded. Logs are kept for 366 days.
To view the logs in the User Console, open the Menu, expand Logs & Statistics, and select Audit Logs. You can also use the API Audit Log API (GET /audit_logs/api, or soracom audit-logs api get in the Soracom CLI). Each entry includes:
-
userName: the SAM user who made the call. For calls made by the root user, this field is empty in the API response, and the User Console shows<root user>. -
requestPathandapiKind: which API was called -
remoteIpAddress: the IP address of the caller -
requestedTimeEpochMs: when the call was made
What you can find depends on your option:
-
With the Enterprise Option: To find out who created the user, look for entries around the user's
createDateTimewhoserequestPathrelates to that user. To see what the user has done, look for entries whereuserNamematches the unrecognized SAM user. -
With the Standard Option: You can only see sign-ins and
/v1/authcalls from the last 24 hours, including theiruserNameand IP address. The call that created the user is not recorded.
Subscribing to the Enterprise Option does not make earlier activity available. API calls made before the subscription was enabled, other than /v1/auth calls from the last 24 hours, can't be viewed. For details, see Audit Logs.
Step 3: Secure the Account if Needed
You can manage the user under account menu > Security > Users in the User Console. You must be signed in as the Root user or as a SAM user with User:* permissions.
To block access:
- Remove the user's password. In the dialog that follows, check Invalidate user sessions to end the user's current User Console and API sessions right away.
- Delete the user's AuthKeys. Removing the password doesn't affect AuthKeys, so delete any AuthKey you don't recognize with the Delete User AuthKey API (
soracom users auth-keys deletein the Soracom CLI), using theauthKeyIdfrom Step 1.
If the user isn't needed at all, you can delete it instead.
For more information, see the Users & Roles documentation.