Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Alfresco Security Best Practices 2012

19.551 visualizaciones

Publicado el

Alfresco DevCon 2012 slides

Publicado en: Tecnología

Alfresco Security Best Practices 2012

  1. 1. Alfresco Security Best Practices Toni de la Fuente ! Alfresco Senior Solutions Engineer! Blog: Twitter: @ToniBlyx! !!
  2. 2. Who I am?•  Alfresco Senior Solutions Engineer!•  Working with Alfresco for 5 years!•  More than 2 years as part of the team!•  Always involved with:! •  Operating Systems! •  Networks! •  Security! •  Open Source!•  Consultant & Auditor: ethical hacking,penetration tests.!•  And writing about that at since 2002 !
  3. 3. Agenda•  Intro!•  Project life cycle and security! •  Planning! •  Installation! •  Post-install configuration and hardening! •  Maintenance! •  Monitoring and auditoring!•  Other security-related tasks!•  Demo: information leaks and metadata!•  Conclusions!•  Next steps!
  4. 4. The Alfresco PlatformThe Alfresco PlatformA robust, modern ECM platform
focused on scalability & usability !Consumer like UI
 Documentdrag-and-drop with MS Office intergration! ManagementBusiness Process" Electronic Team RecordsRules and workflow that users can use! Management CollaborationSocial features
content activity feeds & social feedback!Metadata and Security
building rich context around content! Image Alfresco Rich Media Management SupportEcosystem of Integrations"CIFS, WebDAV, SharePoint, Exchange,GoogleDocs, CMIS, SAP, Salesforce, Process Web ContentKofax, and thousands more.
 Management Services!
  5. 5. Introduction
  6. 6. Introduction•  In Alfresco we must take security seriously.! •  Because we care about contents!•  If Alfresco stops working and that poses a problem for your business, security is important.!•  Security is a process not a product.!•  Think of protection, integrity and privacy.!•  Reduce as much as posible the MTBF, to guarantee minimum MTTR posible.!•  Taking into account the Security Plan of the organization, Contingency Plan and Disaster Recovery Plan.!
  7. 7. Project Life Cycle and Security
  8. 8. Planning and previous review!•  What should I secure? It depends on… •  Project needs •  Interfaces •  Users, applications or both •  Customization •  Architecture, high availability and scalability Document Collaboration Web Content Records Email Management Management Management Archive Interfaces? Number of…? Customization?
  9. 9. It depends on the network architecture B A Share Alfresco App Srv DataBaseContent Store Index
  10. 10. Installation
  11. 11. Best practices and tips 1/2•  Run Alfresco as a non-root user! •  Configure all ports beyond 1024! •  Authbind on Debian-like OS! •  IPTables port redirect!•  Avoid default password (admin, db, jmx).!•  Change default certificates and keys in SOLR.! •  Use keytool or your own certificates.! •  installRoot/alf_data/solr/CreateSSLKeystores.txt!•  Set permissions for configuration files, content store, indexes and logs. Only the user running Alfresco must be able to access this folders.! •  chown –R alfresco:alfresco installRoot/! •  chmod –R 600 installRoot/!
  12. 12. Best practices and tips 2/2•  Before installing run Alfresco Environment Validation Tool in order to avoid conflictive services and ports.!•  Keep SSL active when possible:! •  Do not use self-signed certificates in live environments.! •  Take care with SSL Strip: force using SSL and teach your users!! •  Check your certificate strength on:! •!•  Use Apache (or other web server) to protect your application server and services.!•  SELinux (review!•  When possible, run bundle installer to keep third party binary files controlled and avoid rootkits ! •  If third party applications are installed by OS rpm repository use rpm command! •  rpm –Vf /path/to/binary! •  rpm –V <rpm-name>!•  Check third party vulnerabilities often.!
  13. 13. Post Installation Configuration
  14. 14. Which ports should I open? INProtocol Port TCP/UDP IN/OUT Activated CommentsHTTP$ 8080$ TCP$ IN$ Yes$ Including$WebDav$FTP$ 21$ TCP$ IN$ Yes$ Passive$mode$SMTP$ 25$ TCP$ IN$ No$ $CIFS$ 137,138$ UDP$ IN$ Yes$ $CIFS$ 139,445$ TCP$ IN$ Yes$ $IMAP$ 143$ TCP$ IN$ No$ $Share$ 7070$ TCP$ IN$ Yes$ $Point$$Protocol$Tomcat$Admin$ 8005$ TCP$ IN$ Yes$ $Tomcat$AJP$ 8009$ TCP$ IN$ Yes$ $SOLR$admin$ 8443$ TCP$ IN$ Yes$ Cert$installation$on$the$ browser$needed$NFS$ 111,2049$ TCP/UDP$ IN$ No$ $Lotus$Quickr$ 6060$ TCP$ IN$ No$ $RMI$ 50500T50507$ TCP$ IN$ Yes$ Used$by$EHCache$for$ cluster$and$JMX$ management$JGroups$ 7800$ TCP$ IN$ No$ Cluster$discovery$$JGroups$ 7801T7802$ TCP$ IN$ No$ Ehcache$RMI$ communication$between$ node$cluster$OpenOffice$ 8100$ TCP$ IN$ Yes$ Localhost$only,$not$ needed$to$open.$$
  15. 15. Which ports should I open and keep inmind? OUTProtocol Port TCP/UDPIN/OUT Activated CommentsSMTP% 25% TCP% OUT% No% To%your%MTA.%DB%–%PostgreSQL% 5432% TCP% OUT% Yes*% Depending%on%DB%DB%–%MySQL% 3306% TCP% OUT% Yes*% Depending%on%DB%DB%–%MS%SQL%Server%1433% TCP% OUT% Yes*% Depending%on%DB%DB%–%Oracle% 1521% TCP% OUT% Yes*% Depending%on%DB%DB%–%DB2% 50000% TCP% OUT% Yes*% Depending%on%DB%LDAP% 396% TCP% OUT% No% For%authetication/sync%LDAPS% 636% TCP% OUT% No% For%authetication/ 443% TCP% OUT% No% %OpenOffice% 8100% TCP% OUT% No% Only%for%remote%OpenOffice%or% Alfresco%Transformation%Server%JGroups% 7800T7802% TCP% OUT% No% Between%cluster%nodes%NFS% 111,2049% TCP/UDP% OUT% No% Only%if%using%remote%NFS%for% contentstore%Kerberos% 88% TCP/UDP% OUT% No% If%Kerberos%SSO%is%configured%DNS% 53% UDP% OUT% Yes% Basic%DNS%service%NTP% 123% UDP% OUT% Yes% Network%Time%% * Also allow outbound traffic to Facebook, Twitter, LinkedIn, Slideshare, Youtube, Flickr, Blogs if you are able to use Publishing Framework, Target Servers for Replication or Cloud Sync.
  16. 16. Control and review!•  Controls processes and ports used by the system (Linux):#  netstat  -­‐tulpn|grep  -­‐i  java  tcp                0            0      *                  LISTEN    8591/java                tcp                0            0    *                  LISTEN    8591/java                tcp                0            0        *                  LISTEN    8591/java                tcp                0            0          *                  LISTEN    8591/java                tcp                0            0        *                  LISTEN    8591/java                tcp                0            0            *                  LISTEN    8591/java                tcp                0            0        *                  LISTEN    8591/java                tcp                0            0          *                  LISTEN    8591/java                tcp                0            0        *                  LISTEN    8591/java                udp                0            0          *                                  8591/java   !•  On Windows OS: ! •  netstat –an | findstr <port #>!
  17. 17. Activate SSL for all services required•  HTTP à HTTPS! •  Appliance supporting SSL offloading! •  Activate HTTPS on a frontal web server (Apache, IIS, etc)! •  Activate HTTPS on the application server!•  FTP à FTPS ! •  Check official documentation!•  SharePoint (jetty) à SSL! •  You will avoid MS users related workarounds! •  Check official documentation!•  SMTP à SMTPS: IN and OUT! •  Check official documentation!•  IMAP à IMAP-SSL ! •  Greenmail (based) or Perdition or Stunnel!•  JGroups! •  Stunnel or Proxy!
  18. 18. Post installation configuration - 1/5•  Redirect ports below 1024:! •  E.g. for FTP and IPTables: ! •  iptables -t nat -A PREROUTING -p tcp --dport 21-j REDIRECT --to-ports 2121! •!•  Change JMX credentials and roles! • jmx-de-alfresco/!•  Make sure you have control of your logs! •!
  19. 19. Post installation configuration - 2/5•  Are you going to use external authentication?! •  Encrypt communication between Alfresco and the LDAP/AD or SSO system (port 636 TCP for LDAPS)!•  Replication Service between on-premises?! •  HTTPS!!!•  Disable unneeded services:! •  ftp.enabled=false! •  cifs.enabled=false ! •  imap.server.enabled=false ! •  nfs.enabled=false ! •  transferservice.receiver.enabled=false! •  audit.enabled=false/true! •  webdav: disable on tomcat/webapps/alfresco/WEB-INF/web.xml! •  SharePoint: do not install VTI module if unneeded.!
  20. 20. Post installation configuration - 3/5 •  Backup configuration and sequence! •  Backup Lucene 2 AM! • installRoot/alf_data/backup-lucene-indexes! •  Backup SOLR 2 AM Alfresco core and 4 AM Archive core.! • installRoot/workspace-SpacesStore ! • installRoot/archive-SpacesStore! •  Backup SQL.! •  Backup contentStore, audit, etc.!•  Consider using LVM snapshots for the contenstore and snapshot-like backup for db!•  For small amounts of content you may use:! •!•  Try recovery often as a preventive measure !•  Add a checked Alfresco recovery procedure to your Contingence Plan!•  Consider using Replication Service for disaster recovery plan:! •  replication.enabled=true and replication.transfer.readonly=false!
  21. 21. Post installation configuration - 4/5•  Disable guest user:! •  For NTLM-Default:! • alfresco.authentication.allowGuestLogin=false (default is true)! •  For pass-through:! • passthru.authentication.guestAccess=false (default is false)! •  For LDAP/AD:! • ldap.authentication.allowGuestLogin=false (default is true)!•  Limit number of users and state of the repository:! •  server.maxusers=-1 (-1 no limit)! •  server.allowedusers=admin,toni,bill (empty for all)! •  server.transaction.allow-writes=true (false to turn the whole system into read only mode)!
  22. 22. Post installation configuration - 5/5•  Do you want to have control of deletion?! • nodes.html!•  Disable trashcan:! •  Create a file like *-context.xml with the following content:! <bean  id="storeArchiveMap"   class="org.alfresco.repo.node.StoreArchiveMap">              <property  name="archiveMap">                    <map>              </map>              </property>              <property  name="tenantService">                    <ref  bean="tenantService"  />              </property>        </bean>  
  23. 23. Maintenance
  24. 24. Maintenance•  Daily review of logs and audit records (if enabled).!•  Daily review of backup, and monthly restoring!!•  Delete orphan files, log rotation/compression and temporary files cleaning.! •  Use a crontab script, for further information:! • alfresco.html!
  25. 25. Monitoring and Auditory
  26. 26. Monitoring and Auditory•  JMX! •  Jconsole! •  VisualVM!•  Hyperic! • hyperic-auditsurf-jmx-rocks/!•  Nagios/Icinga! • hyperic-auditsurf-jmx-rocks/!•  Javamelody! •!!
  27. 27. Nagios/Icinga plugin•  Always monitoring! !•  Nagios4Alfresco Plugin!
  28. 28. Monitoring and Auditory•  Failed logins auditory:!audit.enabled=true  audit.tagging.enabled=true    audit.alfresco-­‐access.enabled=true  audit.alfresco-­‐access.sub-­‐events.enabled=true    audit.cmischangelog.enabled=true    •  To know what is being audited:!$  curl  -­‐u  admin:admin  http://localhost:8080/alfresco/service/api/audit/control!•  Rename: tomcat/shared/classes/alfresco/extension/audit/alfresco-audit-example-login.xml.sample !$  curl  -­‐u  admin:admin  "http://localhost:8080/alfresco/service/api/audit/query/AuditExampleLogin1/auditexamplelogin1/login/error/user?verbose=true"  {        "count":5,        "entries":          [    {    "id":7,                    "application":"AuditExampleLogin1",                    "user":null,                    "time":"2012-­‐03-­‐05T19:20:48.994+01:00",                    "values":                    {  "/auditexamplelogin1/login/error/user":"toni"                    }  }        
  29. 29. Other security-related tasks
  30. 30. Other security-related tasks - 1/2•  Avoid information leaks through metadata (demo)! •  content + metadata in Alfresco DB ! !vs.! •  (content + metadata) + metadata in Alfresco!•  Consider using the new type “d:encrypted”!•  Add checksum to the content (third party development)!•  User blocking after a certain number of failed authentications (LDAP or third party)!•  Change webdav visibility root!•  Session timeout for Explorer and Webdav!•  Session timeout for Share!•  Session timeout for CIFS!•  Set CIFS and FTP on read only mode if required!
  31. 31. Other security-related tasks - 2/2•  Consider using a network scanner in order to avoid storing of viruses and trojans or an internal action like ALFVIRAL (Google Code). !•  mod_security to limit file size or intercept content (audit purposes).!•  To filter which applications can access to services or remote API! ! <Location  /alfresco/service/*>    order  allow,deny    allow  from  localhost.localdomain    #  Add  additional  allowed  hosts  as  needed    #  allow  from   </Location>     <Location  /share/service/*>        order  allow,deny        allow  from  localhost.localdomain        allow  from      #  allow  from   </Location>  
  32. 32. Demo: Alfresco for avoid leaks information
  33. 33. Demo Script•  Starting an attack: gathering information! •  Google Hacking! •  FOCA!•  Exiftool & wget!•  Publishing/Replication/Sync contents with Alfresco (web sites, blog, social networks or just contents.)!•  Backdoors and metadata: yes, we can…!•  Cleaning contents with Alfresco! •  cmd-line-action-clean-metadata-1.0.1.amp! •  Configuration (script +! •  Add rule! •  Test!
  34. 34. Tools, References and Links•  Gathering info tools:! •  Cleaners:! •  FOCA - •  Exiftool! foca.aspx! •  OOMetaExtractor - •  Exiftool - oometaextractor! exiftool/ ! •  MS Office 2003 & XP •  Metagoofil - downloads/details.aspx? metagoofil.php! displaylang=en&FamilyID=144e5 4edd43e-42ca- •  Libextractor - bc7b-5446d34e5360! libextractor/! •  BatchPurifier - $19 (BatchPurifierCon.exe)! •  Shodan -! •  Explanation:!•  Alfresco Security Toolkit CMD • – theory! LINE ! • – practice / POC ! •  cmd-line-action-clean- metadata-1.0.1.amp!
  35. 35. Conclusions
  36. 36. Conclusions•  Working on Security could be sometimes a nightmare but…!!Picture from:
  37. 37. Conclusions•  Trust no one, including users!!•  Nobody cleans documents.! •  Almost everything can reveal information!•  Currently we have tools and information available to secure Alfresco, but unfortunately they are not on a single place and we have to improve some of them.!•  Remember: security measures have to be taken constantly!!•  Other topics to be covered in future related to security:! •  Security in development! •  In-depth auditory ! •  Users, roles and permissions.! •  Authentication subsystems creation (webinar already carried out in Spanish)! •  SSO with CAS, Siteminder, OpenSSO, JoSSO, ForgeRock, Oracle Identity Manager, etc. ! •  PKI integration or best practices for digital signatures, content encryption, etc.!
  38. 38. Next steps•  Lets use “Alfresco Security Toolkit” as main project for collection of security related docs and tools. ! •!•  “Hardening Alfresco Guide”.!•  “Bastille Alfresco” – useful?!•  Any idea? !
  39. 39. Any questions?
  40. 40. # while you=applause; do echo THANKS!; done Toni de la Fuente! Alfresco Senior Solutions Engineer! Blog: Twitter: @ToniBlyx! !!