Fortify Password Management Password In Configuration File

0 views
Skip to first unread message

Manric Hock

unread,
Aug 4, 2024, 2:40:40 PM8/4/24
to healhlitbnercha
Iagree this is wrong, then i try to obfuscate with several methods using -configuration.html, OBS, CRYPT and ENC types. But I always get the same warning from fortify when i scan my code. Am I doing something wrong?

Basic principle is that you want to avoid accidental leak of the credentials, and so put them in a place outside of code (where all developers will see it) and in a configuration file that is outside of the main code root and is carefully access controlled. Ideally, you can avoid passwords altogether by properly configuring database access according to user permissions.


Note: Fortify finds the password issue by basically grepping for "password" (and some variants). So other times this is false positive, if you just have a variable named "password" or a comment that mentions "password," but are not hard coding a password into the file.


I'm developing a desktop application and it required connecting to a remote MySQL database server, currently I save all information (server IP, TCP port, username, password, database name) needed for the connection in a configuration file call app_config.property.

I realize this is not secure way of doing things and I would like to know the most secure and professional way of keeping secure data like this.


If possible don't store the username and password in the configuration file, ask the user to provide a username and password when they open the application and create a login for the user on the database and only give that user the minimum set of permissions to the db tables that they need for the application to run.


There is not a secure way to do that. You can obfuscate, hide or do whatever you want, but if the user/password is in a configuration file or inside the code it will never be secure. Someone can always access the data/executable and get the user/password, the only difference is the difficulty to get that information (just reading a file or having to reverse engeneer the code). The only secure way is having the user introducing that data.


You could setup a webservice that interacts with the database, and limit access and rights to the database more precisely, but I'm not sure if that really improves security, and I don't have time to think that out.


but if you want a config file, you can have encrypted files in java, I myself have written a few encryption applications using AES and PPK (RSA). encrypt the file you can either encrypt the file with a key only your application code will know or you can use hardware IDs and salts so you cant move the config file across different computers.


This master key is recovered when the system starts up, and is used to decrypt the data encrypting key (DEK). The master key is then cleared from memory. Its only purpose is to de/encrypt the DEK, which is stored in encrypted form in a config file. This DEK is used to encrypt any other secrets (like DB creds). Like the master key, the DEK is generated at installation time, encrypted with the KEK, and stored in a config file.


In addition to the initial configuration you performed on the Setup wizard, you must also configure several core attributes in the Configuration section of the ADMINISTRATION view. These attributes include user account timeout and lockout settings, the display of user information, maximum events per Fortify WebInspect AgentFortify WebInspect Agent (named SecurityScope in Software Security Center 4.00 and earlier versions) runs atop the Fortify Runtime platform, allowing it to monitor your code for software vulnerabilities as it runs. When used in conjunction with Fortify Static Code Analyzer and Fortify WebInspect. Fortify WebInspect Agent provides Runtime technology to help connect your dynamic results to your static results. issue, the base URL for the runtime event description server, and the user administrator's email address. You also configure the proxy used for Rulepack updates on this page. For information about the Rulepacks updates proxy, see About Configuring a Proxy for Rulepack Updates.


If Fortify Software Security Center locks a user out, that user is prevented from attempting a new login for the number of minutes specified in the Lockout time (minutes) box. (For information about how to unlock a user account, see Unlocking User Accounts (Local Users Only).


If a user attempts and fails to log in to Fortify Software Security Center the number of times specified for Login Attempts before Lockout, Fortify Software Security Center locks the user account for the number of minutes specified in the Lockout time (minutes) box.


Search local users first, then search LDAP users. To avoid potential authorizationAccess control. After a user has been authenticated (proven his or her identify, typically via a password), the operating system or application identifies what resources the user can access during this session, and provides access accordingly. errors and user confusion, make sure that usernames are not duplicated on the LDAP server and local storage.


Laravel Fortify is a frontend agnostic authentication backend implementation for Laravel. Fortify registers the routes and controllers needed to implement all of Laravel's authentication features, including login, registration, password reset, email verification, and more. After installing Fortify, you may run the route:list Artisan command to see the routes that Fortify has registered.


Since Fortify does not provide its own user interface, it is meant to be paired with your own user interface which makes requests to the routes it registers. We will discuss exactly how to make requests to these routes in the remainder of this documentation.


As mentioned previously, Laravel Fortify is a frontend agnostic authentication backend implementation for Laravel. Fortify registers the routes and controllers needed to implement all of Laravel's authentication features, including login, registration, password reset, email verification, and more.


You are not required to use Fortify in order to use Laravel's authentication features. You are always free to manually interact with Laravel's authentication services by following the documentation available in the authentication, password reset, and email verification documentation.


If you are new to Laravel, you may wish to explore the Laravel Breeze application starter kit before attempting to use Laravel Fortify. Laravel Breeze provides an authentication scaffolding for your application that includes a user interface built with Tailwind CSS. Unlike Fortify, Breeze publishes its routes and controllers directly into your application. This allows you to study and get comfortable with Laravel's authentication features before allowing Laravel Fortify to implement these features for you.


Laravel Fortify essentially takes the routes and controllers of Laravel Breeze and offers them as a package that does not include a user interface. This allows you to still quickly scaffold the backend implementation of your application's authentication layer without being tied to any particular frontend opinions.


You may be wondering when it is appropriate to use Laravel Fortify. First, if you are using one of Laravel's application starter kits, you do not need to install Laravel Fortify since all of Laravel's application starter kits already provide a full authentication implementation.


If you are not using an application starter kit and your application needs authentication features, you have two options: manually implement your application's authentication features or use Laravel Fortify to provide the backend implementation of these features.


If you choose to manually interact with Laravel's authentication services instead of using Fortify, you may do so by following the documentation available in the authentication, password reset, and email verification documentation.


Some developers become confused regarding the difference between Laravel Sanctum and Laravel Fortify. Because the two packages solve two different but related problems, Laravel Fortify and Laravel Sanctum are not mutually exclusive or competing packages.


Laravel Sanctum is only concerned with managing API tokens and authenticating existing users using session cookies or tokens. Sanctum does not provide any routes that handle user registration, password reset, etc.


If you are attempting to manually build the authentication layer for an application that offers an API or serves as the backend for a single-page application, it is entirely possible that you will utilize both Laravel Fortify (for user registration, password reset, etc.) and Laravel Sanctum (API token management, session authentication).


This command will publish Fortify's actions to your app/Actions directory, which will be created if it does not exist. In addition, the FortifyServiceProvider, configuration file, and all necessary database migrations will be published.


The fortify configuration file contains a features configuration array. This array defines which backend routes / features Fortify will expose by default. If you are not using Fortify in combination with Laravel Jetstream, we recommend that you only enable the following features, which are the basic authentication features provided by most Laravel applications:


By default, Fortify defines routes that are intended to return views, such as a login screen or registration screen. However, if you are building a JavaScript driven single-page application, you may not need these routes. For that reason, you may disable these routes entirely by setting the views configuration value within your application's config/fortify.php configuration file to false:


If you choose to disable Fortify's views and you will be implementing password reset features for your application, you should still define a route named password.reset that is responsible for displaying your application's "reset password" view. This is necessary because Laravel's Illuminate\Auth\Notifications\ResetPassword notification will generate the password reset URL via the password.reset named route.

3a8082e126
Reply all
Reply to author
Forward
0 new messages