Tampilkan postingan dengan label security. Tampilkan semua postingan
Tampilkan postingan dengan label security. Tampilkan semua postingan

Spring security pre authentication scenario Part2

In Part 1, I covered configuring Spring security. Here we will see how we can protect the controller and the service class methods by defining what roles are allowed.


Firstly, you can protect your controller as shown below.


Define the URLs to be protected in the ssoContext.xml file something like

<http auto-config="false" access-decision-manager-ref="springAccessDecisionManager" 
once-per-request="true" create-session="ifRequired" entry-point-ref="MyAppAuthenticationEntryPoint">

<session-management invalid-session-url="/j_spring_security_logout" />
<!-- TODO: Would be cleaner if we didnt have to enumerate every role that can access some URL in the system. Consider hierarchical roles -->
<intercept-url pattern="/**/*.css*" filters="none" />
<intercept-url pattern="/**/*.js*" filters="none" />
<intercept-url pattern="/**/*.png*" filters="none" />
<intercept-url pattern="/**/codemapping.rpc" access="ROLE_admin,ROLE_viewer" />
<intercept-url pattern="/**/generalLedgerService.rpc" access="ROLE_admin" />
<intercept-url pattern="/**/MyAppAdjustment.html" access="ROLE_admin,ROLE_viewer" />
<intercept-url pattern="/**/CodeMapping.html" access="ROLE_admin,ROLE_viewer" />
<intercept-url pattern="/**/myapp_test.html" access="ROLE_admin" />
<custom-filter ref="siteminderFilter" position="PRE_AUTH_FILTER" />
<access-denied-handler ref="accessDeniedHandler"/>

....

</http>


In the Spring MVC controller, you can use the annotation as shown below.

   @RolesAllowed(
{
"ROLE_viewer", "ROLE.standard", "ROLE_senior"

})
@RequestMapping(value = "/portfolio/{portfoliocd}/details.csv", method = RequestMethod.GET, produces = "text/csv")
@ResponseBody
public void getCashForecastCSV(
@PathVariable(value = "portfoliocd") String portfolioCode,
@RequestParam(value = "valuationDate", required = true) @DateTimeFormat(pattern = "yyyyMMdd") Date valuationDate,
HttpServletResponse response) throws Exception
{


//..............................

}




The service class methods can be protected by declaring the following in your spring context file where the methods reside.

 <!-- comment this line locally to bypass seurity access control in development. But dont check this in commented as security will be turned off -->
<security:global-method-security secured-annotations="enabled" pre-post-annotations="enabled" jsr250-annotations="enabled"/>


Once declared, you can protect your service class methods as shown below.

    @RolesAllowed(
{
"ROLE_viewer", "ROLE_standard", "ROLE_senior"

})
@Override
public ReconciliationResult getReconciliations(ReconciliationCriteria criteria)
{
//........................
}



Read More..

Web i e HTTP security vulnerabilities HttpOnly attribute

Q. What do you understand by the term "HttpOnly" attribute in HTTP cookies?
A. Here is a sample PEN test report comment:

"During the application test, it was detected that the tested web application set a session cookie without the "HttpOnly" attribute. Since this session cookie does not contain the "HttpOnly" attribute, it might be accessed by a malicous script injected to the site (i.e XSS), and its value can be stolen. Any information stored in session tokens may be stolen and used later for identity theft or user impersonation"

When you tag a cookie with the "HttpOnly" flag, it tells the browser that this particular cookie should only be accessed by the server. Any attempt to access the cookie from client script is strictly forbidden. This will works woth  a modern web browser that supports and actually implements "HttpOnly" functionality correctly. The most modern browsers do support the "HttpOnly" flag. This flag will make more difficult to pull off XSS attacks.


Q. What do you understand by the term "Secure" attribute in HTTP cookies?
A. Here is a sample PEN test report comment:

"During the application test, it was detected that the tested web application set a cookie without the "secure" attribute, during an encrypted session. Since this cookie does not contain the "secure" attribute, it might also be sent to the site during an unencrypted session. Any information such as cookies, session tokens or user credentials that are sent to the server as clear text, may be stolen and used later for identity theft or user impersonation."

Remedy: Basically the only required attribute for the cookie is the "name" field. Common optional attributes are: "comment", "domain", "path", etc. The "secure" and "HttpOnly" attributes must be set accordingly in order to prevent a cookie from being sent unencrypted or modified respectively.

Tip: You can use the Firefox plugin Fire cookie to view these attributes.
Read More..

The security database on the server does not have a computer account for this workstation trust relationship

We recently has this error message appear when trying to log on Windows 7 workstations to our Windows 2003 domain server.
"The security database on the server does not have a computer account for this workstation trust relationship."
We trawled through the Google searches for this message and there are pages of reports of this error.
Let me give you the circumstances.
Our domain server failed. We could not get it to get through POST and BIOS to try to find and operating system. That was the first big Ouch.
So we rebuilt the server on to new hardware and configured it, as we thought, the same. We initially had some issues with DNS and NICs not doing as they should but the upshot was that our 2 Windows 7 workstations could not connect to the domain. Please note this did not affect our remaining XP workstation which logged just fine.
After looking at the Goggle responses we noticed that we had rebuilt the domain but missed off the .local on the domain name.
So we rebuilt being more careful next time. Even so we got a capital letter in the wrong place in the domain name. So we rebuilt a third time. This time we are sure we got everything right. It made not a jot of difference.
Other websites had suggested we disconnect from the domain and reconnect to the new domain. Not an iota of difference.
Finally we had to reinstall the operating system on both our Windows 7 machines.
One side effect of this, despite having installed onto completely new hard disks to preserve the data on the old disk, is that on one of the machines we have lost ALL out Outlook pst files. Some emails going back 6 years with important information.
Couple this with the total data loss of all information on the server did not make us very happy.
I will finish with this comment. Why, oh why, Microsoft is it so hard to get your systems to talk to each other. This is hardly a ringing endorsement for the improvements in Windows 7 when XP performs better in what was already a very fraught situation. Please try to do better next time.
Read More..

Bitdefender Internet Security 2012 Giveaway! Hurry Up!

73% discount on purchase of Bitdefender Internet Security 2012 1-PC, 1-Year license. Bitdefender products provide comprehensive protection: antivirus, antispam, antiphising, firewall, and parental controls. Everything you need to stay safe online. According to av-test.org Nov/Dec 2011 test results, Bitdefender Internet Security 2012 is the number one choice for home users in terms of computer protection.

Bitdefender Internet Security 2012 giveaway link: http://giveaway.downloadcrew.com/offer/bitdefender_internet_security/26676

Quick facts about Bitdefender Internet Security 2012:
  • Active Virus Control
  • Rescue mode
  • Virtualized Browser
  • Vulnerability Scanner
  • Antispam
  • Two-way Firewall
  • Parental Control
  • Autopilot
  • Social Network Protection
  • Search Advisor
  • Antiphising
To learn more, please visit http://www.bitdefender.com/solutions/internet-security.html

Bitdefender Internet Security 2012 GUI:



Tell your friends:
Read More..

How to Remove Internet Security Essentials Uninstall Guide

Internet Security Essentials is a rogue antivirus program which acts like a real virus scanner, searching your computer for malicious software and viruses. After the fake scan, it claims to have detected Trojans, spyware, adware and other malware to make you think that your computer is infected. Then Internet Security Essentials prompts you to pay a small fee to remove the threats which do not even exist. Theres no trustworthy company behind it, so you shouldnt purchase it. Besides, it gives a false sense of security. Not to mention that it wont remove any infections from your computer. What is more, Internet Security Essentials is promoted through the use of fake online scanners, drive-by downloads and other malicious software. It is not a legal and truly legitimate anti-virus. If you somehow ended up with this rogue AV on your computer, please follow the steps in the removal guide below to remove Internet Security Essentials and any related malware for free.



Internet Security Essentials is a re-branded version of Smart Internet Protection 2011 rogueware. What does this rogue program actually do? It just copies several random files into the %UserProfile% directory and then "flags" those files as malware. Some of the files that can be listed as malicious software: PE.exe, DBOLE.exe, CLSV.tmp, kernel32.exe, std.dll, grid.sys. Furthermore, Internet Security Essentials changes your Windows settings to use a proxy server that will not allow you to browse any or certain web pages. It also modifies Windows Hosts files and may even block other programs on your computer. Last, but not least, Internet Security Essentials displays fake security warnings and notifications saying that your computer is infected with dangerous malware or under attack from a remote computer.
Attention! 20 infected files detected!
Trojan.BAT.AnitV.a
Packed.Win32.PolyCrypt
SpamTool.Win32.Delf.h
Trojan-PSW.Win32.Hooker
Warning! Identity theft attempt detected
Target: Microsoft Corporation keys
System alert
Internet Security Essentials has detected potentially harmful software in your system. It is strongly recommended that you register Internet Security Essentials to remove all found threats immediately.
As you can see, Internet Security Essentials is a scam. You should not purchase it, and if you have, please contact your credit card company and dispute the charges. To remove Internet Security Essentials and any related malware, please follow the removal instructions below. Let me know if you have any questions, comments, or suggestions. You can leave a message using the contact form below. Good luck and be safe online!


Internet Security Essentials removal instructions:

1. Reboot your computer is "Safe Mode with Networking". As the computer is booting tap the "F8 key" continuously which should bring up the "Windows Advanced Options Menu" as shown below. Use your arrow keys to move to "Safe Mode with Networking" and press Enter key. Read more detailed instructions here: http://www.computerhope.com/issues/chsafe.htm


NOTE: Login as the same user you were previously logged in with in the normal Windows mode.

2. Launch Internet Explorer. In Internet Explorer go to: Tools->Internet Options->Connections tab. Click Lan Settings button and uncheck the checkbox labeled Use a proxy server for your LAN. Click OK. You may have to repeat steps 1-2 if you will have problems downloading malware removal programs.



3. Download free anti-malware software from the list below and run a full system scan.
NOTE: in some cases the rogue program may block anti-malware software. Before saving the selected program onto your computer, you may have to rename the installer to iexplore.exe or winlogon.exe With all of these tools, if running Windows 7 or Vista they MUST be run as administrator. Launch the program and follow the prompts. Dont forget to update the installed program before scanning.

4. New threats appear every day. In order to protect your PC from such (new) infections we strongly recommend you to use ESET Smart Security.


Alternate Internet Security Essentials removal instructions using HijackThis or Process Explorer (in Normal mode):

1. Launch Internet Explorer. In Internet Explorer go to: Tools->Internet Options->Connections tab. Click Lan Settings button and uncheck the checkbox labeled Use a proxy server for your LAN. Click OK.



2. Download Process Explorer.
3. Rename procexp.exe to iexplore.exe and run it. Look for similar process in the list and end it:
  • FN43g_392.exe
OR download iexplore.exe (NOTE: iexplore.exe file is renamed HijackThis tool from TrendMicro).
Launch the iexplore.exe and click "Do a system scan only" button.
If you cant open iexplore.exe file then download explorer.scr and run it. Search for similar entries in the scan results:

R1 - HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings,ProxyServer = http=127.0.0.1:18392
O4 - HKCU..Run: [Internet Security Essentials] "C:Documents and SettingsAll UsersApplication Data38gdr2FN43g_392.exe" /s /d
Select all similar entries and click once on the "Fix checked" button. Close HijackThis tool.

4. Download free anti-malware software from the list below and run a full system scan.
NOTE: in some cases the rogue program may block anti-malware software. Before saving the selected program onto your computer, you may have to rename the installer to iexplore.exe or winlogon.exe With all of these tools, if running Windows 7 or Vista they MUST be run as administrator. Launch the program and follow the prompts. Dont forget to update the installed program before scanning.

5. New threats appear every day. In order to protect your PC from such (new) infections we strongly recommend you to use ESET Smart Security.


Internet Security Essentials associated files and registry values:

Files:
  • C:Documents and SettingsAll UsersApplication Data38gdr2
  • C:Documents and SettingsAll UsersApplication Data38gdr2FN43g_392.exe
  • C:Documents and SettingsAll UsersApplication Data38gdr2[SET OF RANDOM CHARACTERS].dll
  • C:Documents and SettingsAll UsersApplication Data38gdr2[SET OF RANDOM CHARACTERS].ocx
  • C:Documents and SettingsAll UsersApplication DataSMEYFE
  • %UserProfile%Application DataInternet Security Essentials
%UserProfile% refers to:
C:Documents and Settings[UserName] (for Windows 2000/XP)
C:Users[UserName] (for Windows Vista & Windows 7)

Registry values:
  • HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerDownload "RunInvalidSignatures" = 1
  • HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settings "ProxyServer" = "http=127.0.0.1:18392"
  • HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun "Internet Security Essentials"
  • HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionImage File Execution Options "Debugger" = "svchost.exe"
Share this information with other people:
Read More..