What is the use-case of security levels according to ISO 14229 Unified Diagnostic Services (UDS)? - uds

as I understand, If the security key returned by the tester (client) is correct the ECU will respond with a positive UDS-response. After this the tester will be granted security access at the requested security level.
my question is : what's the purpose of security level if tester will always be granted security access at the requested security level?

Security Access works using a shared-secret between ECU and authorized tester (secret algorithm/private key). The purpose is to restrict access to certain services/subfunctions by i.e. unauthorized tester/tools (3rd party) or users lacking certain access rights.
To request Security Access, the tester will first send a command to request a random seed from the ECU (i.e. 0x27 01). If the ECU will allow this in their current state, it may respond with a positive response including the seed (i.e. 0x67 01 AA BB CC DD).
Then the tester application needs to take this seed (0xAA BB CC DD) and apply a secret key generation algorithm to it (i.e. a cryptographic function using a private key only known to ECU and authorized tester) - once the key is calculated it needs to be sent back to the ECU (i.e. 0x27 02 66 77 88 99). The ECU can reply to this with a positive response (i.e. 0x67 02) or an Negative Response Code (i.e. 0x7F 0x27 0x35).
That means a tester will not always be granted security access at the requested security level. It is possible for the ECU to deny the access - common reasons are:
transition to this security access level is not possible from the
current session/security level (i.e. NRC 0x7F
serviceNotSupportedInActiveSession, NRC 0x22 conditionsNotCorrect,
NRC 0x31 requestOutOfRange...)
the key send by tester does not match the key which the ECU expects (NRC 0x35 invalidKey)
tester tried to many times with the wrong key (NRC 0x36 exceedNumberOfAttempts)
the ECU is not allowing unlocking security access currently due to too many wrong attempts before - tester needs to wait a certain
timeout first (NRC 0x37 requiredTimeDelayNotExpired)

UDS is not a AUTOSAR only concept, it was defined long ago as ISO-14229.
There can be more than one Security Level. Usually, they are also a bit bound to the Diagnostic Sessions.
Each Session can have a separate Security Level, with different Seed/Key and/or SecurityAlgorithms:
* ProgrammingSession -> SecurityLevel 1
* ExtendedSession -> SecurityLevel 3
* SupplierSpecific/User Session -> SecurityLevel 5 ...
As already stated, the Client has to request the seed and calculates a key, which the ECU does the same. The client then sends the Key which the ECU will compare against its own calculated expected key.
If it does not match, there will be a negative response, and the security level will not be reached.
If the Session times out or if the session is changed, the Security Level is set back to Locked state.
Services can be configured regarding availability and execution by assignment to certain Sessions and SecurityLevels.

Related

freeswitch - group dialing, registration issue

I am trying to setup a group dial for a given extension.
The bridge command I pass data specifying two call groups.
group/support|group/sales
Inside the directory I have users assigned to these call groups, some of which which are configured using only cellphone numbers by overriding the dial string parameter (no sip device).
However, when I try to call, the given user is not dialed as they are not registered (Originate Failed. Cause USER_NOT_REGISTERED. ) How can I configure a given user xml so that freeswitch will not skip over it for not being registered?
Thanks,
Matt
you can define dial-string in the user entry in the directory so that it dials the user's external number. In this example, I used loopback endpoint, and you can also define a string with the sofia gateway:
<param name="dial-string" value="[group_confirm_key=1,leg_delay_start=15]loopback/0794070224/${context}"/>
group_confirm_key defines that the user has to press 1 to accept the call -- this way you can be sure that the call does not land in voicemail.
leg_delay_start=15 is done because I have a SIP desktop phone, and I let it ring for the first 15 seconds.

Invalid Engine ID error in SNMP v3 microchip with manage engine MIB browser

I'm getting error for "SNMPv3" of invalid engine ID? what causes this error usually?
it perfectly works when i select no auth,no priv. but for other two options of auth,no priv and auth,priv it gives error of invalid engine id.
ManageEngine MibBrowser supports auto-discovery of SnmpEngineID, EngineBoots and EngineTime from an Authoritative SNMP Engine.
If user has enabled the "Set EngineID For Adding V3 entry" and entered SNMPV3 user details with EngineID parameter, MibBrowser displays the message received from Agent.
As per RFC3414, If the value of the msgAuthoritativeEngineID
field in the securityParameters is unknown then:
a) a non-authoritative SNMP engine that performs discovery may
optionally create a new entry in its Local Configuration Datastore
(LCD) and continue processing;
or
b) the usmStatsUnknownEngineIDs counter is incremented, and an error
indication (unknownEngineID) together with the OID and value of the
incremented counter are returned to the calling module.
Note in the event that a zero-length or other illegally sized
msgAuthoritativeEngineID is received,b) should be chosen to facilitate
engineID discovery. Otherwise, the choice between a) and b) is an
implementation issue.
If Authoritative SNMP Engine returns "unKnownEngineID OID"(.1.3.6.1.6.3.15.1.1.4.0) with incremental counter value to manager. Then, Mibbrowser displays the "Invalid EngineID" error.
Regards,
ManageEngine

unlock user is not working in Webmatrix WebSecurity.IsAccountLockedOut Method

I am new to web matrix and web security concept. I used the IsAccountLockedOut(String, Int32, Int32) method to check whether the specified membership account is temporarily locked because of too many failed password attempts in the specified number of seconds. Here the thing is after unlocking (updating unlock date time in Db) the membership account I am locked out again after one bad password, but my database is configured to allow 3 attempts. can you please tell me how to resolve the problem or give unlock code sample.
I don't know if it could be useful for you, but the WebMatrix Starter Site template implements in the Account/Login.cshtml page an account lock system that uses the WebSecurity.GetPasswordFailuresSinceLastSuccess() method:
if (WebSecurity.UserExists(email) &&
WebSecurity.GetPasswordFailuresSinceLastSuccess(email) > 4 &&
WebSecurity.GetLastPasswordFailureDate(email).AddSeconds(60) > DateTime.UtcNow)
{
Response.Redirect("~/Account/AccountLockedOut");
return;
}
Edited
This snippet takes into consideration the LastPasswordFailureDate and PasswordFailuresSinceLastSuccess fields of the webpages_Membership table and locks an account if the number of failures exceed a given value (4 in the example) for a given number of seconds (60 in the example).
There is no need to manage an "UnlockDateTime" in another table.

XBee - XBee-API and multiple endpoints

Using Andrew Rapp's XBee-API, how can I sample I/O data via a coordinator from more than two endpoints?
I have 17 Series 1 XBees. I have programmed one to be a coordinator (API mode = 2) and the rest to be endpoints. Using XBee-API I am sending a Force I/O Sample ("IS") remote AT command, unicast to each endpoint. This works perfectly well when there are up to two endpoints, but as soon as a third is added, one of the three always becomes non-responsive (times out with XBeeTimeoutException). It's not always the same physical unit that stops responding, but it is always the third one (for example, if I send Force I/O Sample to Device1, Device2, and Device3, Device3 will time out, and if I change the order to Device3, Device1, Device2, Device2 will time out.
If I set up more than three XBees, about 1 out of 3 will time out - but not every third one.
I've verified that the XBees themselves are fine. I've searched the Internet and Stack Overflow in particular to no avail. I've tried using a simple ZNetRemoteAtRequest. I've tried opening and closing the XBee coordinator serial connection once for all three devices, once per device, and once per program run. I've tried varying the distance between the coordinator and endpoints (never more than five feet apart). I've tried different coordinator configuration parameters (from the Digi documentation). I've tried changing out the XBee for the coordinator.
This is the code I'm using to send the Force I/O Sample request to each endpoint and read the response:
xbee = new XBee(); // Coordinator
xbee.open("/dev/ttyUSB0, 115200)); // Happens before any of the endpoints are contacted
... // Loop through known endpoint addresses
XBeeRequest request = new ZBForceSampleRequest(new XBeeAddress64(endpointAddress));
ZNetRemoteAtResponse response = null;
response = (ZNetRemoteAtResponse) xbee.sendSynchronous(request, remoteXBeeTimeout);
if (response.isOk()) {
// Process response payload
}
... // End loop and finally close coordinator connection
What might help polling I/O samples from more than two endpoints?
EDIT: I found that Andrew Rapp's XBee-API library fakes multithreaded behavior, which causes the synchronization issues described in this question. I wrote a replacement library that is actually multithreaded and correctly maps responses from multiple XBee endpoints: https://github.com/steveperkins/xbee-api-for-java-1-4. When I wrote it Java 1.4 was necessary for use on the BeagleBone, Plug, and Zotac single-board PCs but it's an easy conversion to 1.7+.
Are you using hardware flow control on your serial port? Is it possible that you're sending requests out when the local XBee has deasserted CTS (e.g., asking you to stop sending)? I assume you're running at 115200 bps, so the XBee serial port can keep up with the network data rate.
Can you turn on debugging information, or connect some port monitoring hardware/software to display the data going over the serial port to the local XBee?

lock users in SAP

How to completely disable the lock users in SAP? What setting controls this (login / failed_user_auto_unlock)?
As far as I can see, that's not possible. You can try to set login/fails_to_user_lock to 99 and login/failed_user_auto_unlock to 1, but this will only mean that users will be licked after 99 failed attempts and unlocked again at midnight.
See http://help.sap.com/saphelp_470/helpdata/en/22/41c43ac23cef2fe10000000a114084/frameset.htm for a list of the parameters related to users and security.

Resources