01-Jun-2023 10:35
Hello,
is there any option to define value under "Mask Value in Logs" for JSON profile based on the OpenAPI specification?
Policy is build from the swagger file. JSON profile is created based on the schema defined in swagger (OpenAPI) file. What I cannot modify is part "Value Masking" under JSON profile in security policy. I tried to use "format": "password" in swagger file for password. But "Value Masking" was not modified. Or better value password was not added there.
Below is screen when it was added manually via GUI.
OpenAPI specification:
"Request": {
"required": [
"password",
"username"
],
"type": "object",
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string",
"format": "password"
}
},
"additionalProperties": false
},
Is there any way how I can add it via swagger?
Another option would be add it manually in security template (in JSON format) like for some other non default options what have defined but when it's added manually there are no changes in the policy configuration. JSON of the exported policy is same for policy where "Value Masking" is defined with policy where "Value Masking" is empty.
04-Jun-2023 01:03
Hi @JustJozef ,
you can modify the Sensitive Data Configuration of the JSON profile and remove the sensitive data elements. To do so, perform the following procedure:
Impact of workaround: The BIG-IP ASM security policy will no longer mask sensitive data elements.
Could you check all the elements available for this JSON profile and share the screenshot.
Please check if the password keyword is correct or do you need to use pwd as i am trying to share one example
{"app":"MyMoABC","srv":"MyMoAuthen","op":"login","header":{"pwd":"111111","user":"2222222222222"}}}
Please refer this document:
https://my.f5.com/manage/s/article/K52154401
You should consider using these procedures under the following conditions:
By default, the BIG-IP ASM system logs information about incoming requests to the request log in plain text. In some cases you may want to mask request information in the logs as some requests include sensitive information, such as authorization credentials or credit card information. When you enable Mask Value in Logs for a policy element, the system replaces the sensitive data with asterisks (***). The masked data cannot be viewed by the administrator.
You can mask data in the logs for the following policy elements.
Data to mask | Description | Example | Parameters | Masks the parameter value, including the value for positional parameters. The setting does not mask the parameter name. | GET /profiles/**** | HTTP headers | Masks the header value. The setting does not mask the header name. | GET / HTTP/1.1 Host: Example.com Connection: Keep-alive Authorization: ****** Cookie: TS-Cookie |
Cookies | Masks the values for allowed and enforced cookies types. The setting does not mask the cookie name and does not apply to BIG-IP ASM cookies. | GET / HTTP/1.1 Host: Example.com Connection: Keep-alive Cookie: ****** |
||||||
JSON Profiles | Masks elements within the JSON data whose values are should considered sensitive. | secID: ****** | XML Profiles | Masks sensitive data in an XML document. You can specify the element or attribute whose value contains sensitive data and should be masked by the policy. | <secID>******</secID>
Note: When a BIG-IP ASM policy is set to use Case Sensitive, the created parameters must match the case of the parameter presented by the client. This may require creating multiple parameters to cover variants of the Parameter (for example: password/Password/PASSWORD). Prerequisites You must meet the following prerequisites to use these procedures:
|
Best Regards
F5 Design Engineer
05-Jun-2023 01:37
Hello,
thank you for answer. I am aware about option related to mask/unmask sensitive parameters. In my case it is not possible to do modification directly via GUI as security policies for APIs are automated. When there is a new swagger file available secuirty policy is adapted by the scripts.
So my options are:
In first option I canot define property in swagger file to say ASM policy to mask parameter in tab "Value Masking". Second option does not work for me as modification of the tab "Value Masking" does not show any configuration change of the exported policy.
20-Jun-2023 16:55
I'd like to pin this one to the top of the forum for a bit - get some more eyes on it.
@JustJozef - have you made any updates/progress/decision on this in the past couple weeks?
22-Jun-2023 08:32
@LiefZimmerman . Thank you for response. Unforunately I did not move futher with this topic.