All Projects → ezequieljuliano → Security4Delphi

ezequieljuliano / Security4Delphi

Licence: Apache-2.0 License
Enables and use of the concept of security in your Delphi applications

Programming Languages

pascal
1382 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to Security4Delphi

W5
Security Orchestration, Automation and Response (SOAR) Platform. 安全编排与自动化响应平台,无需编写代码的安全自动化,使用 SOAR 可以让团队工作更加高效
Stars: ✭ 367 (+841.03%)
Mutual labels:  security-audit, security-automation
Sherlock
This script is designed to help expedite a web application assessment by automating some of the assessment steps (e.g., running nmap, sublist3r, metasploit, etc.)
Stars: ✭ 36 (-7.69%)
Mutual labels:  security-audit, security-automation
Fwanalyzer
a tool to analyze filesystem images for security
Stars: ✭ 382 (+879.49%)
Mutual labels:  security-audit, security-automation
Wsltools
Web Scan Lazy Tools - Python Package
Stars: ✭ 288 (+638.46%)
Mutual labels:  security-audit, security-automation
burp-aem-scanner
Burp Scanner extension to fingerprint and actively scan instances of the Adobe Experience Manager CMS. It checks the website for common misconfigurations and security holes.
Stars: ✭ 60 (+53.85%)
Mutual labels:  security-audit, security-automation
Super
Secure, Unified, Powerful and Extensible Rust Android Analyzer
Stars: ✭ 340 (+771.79%)
Mutual labels:  security-audit, security-automation
Purify
All-in-one tool for managing vulnerability reports from AppSec pipelines
Stars: ✭ 72 (+84.62%)
Mutual labels:  security-audit, security-automation
Vuls
Agent-less vulnerability scanner for Linux, FreeBSD, Container, WordPress, Programming language libraries, Network devices
Stars: ✭ 8,844 (+22576.92%)
Mutual labels:  security-audit, security-automation
Sbt Dependency Check
SBT Plugin for OWASP DependencyCheck. Monitor your dependencies and report if there are any publicly known vulnerabilities (e.g. CVEs). 🌈
Stars: ✭ 187 (+379.49%)
Mutual labels:  security-audit, security-automation
Nebulousad
NebulousAD automated credential auditing tool.
Stars: ✭ 158 (+305.13%)
Mutual labels:  security-audit, security-automation
Faraday
Faraday introduces a new concept - IPE (Integrated Penetration-Test Environment) a multiuser Penetration test IDE. Designed for distributing, indexing, and analyzing the data generated during a security audit.
Stars: ✭ 3,198 (+8100%)
Mutual labels:  security-audit, security-automation
assimilation-official
This is the official main repository for the Assimilation project
Stars: ✭ 47 (+20.51%)
Mutual labels:  security-audit, security-automation
django-security-check
Helps you continuously monitor and fix common security vulnerabilities in your Django application.
Stars: ✭ 69 (+76.92%)
Mutual labels:  security-audit, security-automation
Taipan
Web application vulnerability scanner
Stars: ✭ 359 (+820.51%)
Mutual labels:  security-audit, security-automation
Minimalistic Offensive Security Tools
A repository of tools for pentesting of restricted and isolated environments.
Stars: ✭ 135 (+246.15%)
Mutual labels:  security-audit, security-automation
default-http-login-hunter
Login hunter of default credentials for administrative web interfaces leveraging NNdefaccts dataset.
Stars: ✭ 285 (+630.77%)
Mutual labels:  security-audit, security-automation
docker-wallarm-node
⚡️ Docker official image for Wallarm Node. API security platform agent.
Stars: ✭ 18 (-53.85%)
Mutual labels:  security-audit, security-automation
cpan-audit
Check CPAN modules for known security vulnerabilities
Stars: ✭ 27 (-30.77%)
Mutual labels:  security-audit
BookCart
An e-commerce application for an online book store.
Stars: ✭ 116 (+197.44%)
Mutual labels:  authorization
graphql-auth-directives
Add authorization to your GraphQL API using schema directives.
Stars: ✭ 110 (+182.05%)
Mutual labels:  authorization

Security For Delphi

The Security4Delphi consists of an library that enables the use of the concept of security in your Delphi applications.

About The Project

Security is a an concern of great importance for most applications and the focus of endless discussions on development teams. The implementation of the security context has been designed in a simple and flexible way, regardless of presentation or technology layer, leaving you free to implement their own solution or use the existing extensions.

The authentication mechanism aims to verify the user's identity of a system.

Already io authorization mechanism is responsible for ensuring that only authorized users are granted access to certain features of a system. The authorization may happen in two ways: permission functionality and enable by role.

Key validation features

  • Login
  • Logout
  • IsLoggedIn
  • CheckLoggedIn
  • HasRole
  • HasAnyRole
  • HasAuthority
  • HasAnyAuthority
  • GetAuthenticatedUser

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

To use this library an updated version of Delphi IDE (XE or higher) is required.

Installation

Clone the repo

git clone https://github.com/ezequieljuliano/Security4Delphi.git

Add the "Search Path" of your IDE or your project the following directories:

Security4Delphi\src

Usage

To provide the security context paradigm in your project with Security4Delphi you need:

  • Create your implementation of the IAuthenticator interface.
  • Create your implementation of the IAuthorizer interface.
  • Register your implementations in context.
  • Use the context and validate authentication and authorization.

Sample

To illustrate usage let's look at a solution for managing logs of an application.

Create your implementation of the IAuthenticator interface:

  TAuthenticator = class(TAbstractSecurityProvider, IAuthenticator)
  private
    fAuthenticated: Boolean;
    fAuthenticatedUser: IUser;
  protected
    function GetAuthenticatedUser: IUser;

    procedure Authenticate(user: IUser);
    procedure Unauthenticate;
  public
    procedure AfterConstruction; override;
  end;

Create your implementation of the IAuthorizer interface:

  TAuthorizer = class(TAbstractSecurityProvider, IAuthorizer)
  private
    { private declarations }
  protected
    function HasRole(role: string): Boolean;
    function HasAnyRole(roles: array of string): Boolean;

    function HasAuthority(authority: string): Boolean;
    function HasAnyAuthority(authorities: array of string): Boolean;
  public
    { public declarations }
  end;

Register your implementations in context:

function SecurityContext: ISecurityContext;
begin
  if (SecurityContextInstance = nil) then
  begin
    SecurityContextInstance := TSecurityContext.Create;
    SecurityContextInstance.RegisterAuthenticator(TAuthenticator.Create(SecurityContextInstance));
    SecurityContextInstance.RegisterAuthorizer(TAuthorizer.Create(SecurityContextInstance));
  end;
  Result := SecurityContextInstance;
end;

Use the context and validate authentication and authorization:

function TPersonRepository.Delete(personId: Integer): Boolean;
begin
  if not SecurityContext.HasAnyRole(['ROLE_ADMIN', 'ROLE_MANAGER']) then
    raise EAuthorizationException.Create('You do not have role to access this feature.');

  if not SecurityContext.HasAuthority('PERSON_DELETE') then
    raise EAuthorizationException.Create('You do not have permission to access this feature.');

  Result := True;
end;

Optional Feature - Aspects

Protecting the system with [RequiredRole], [RequiredAnyRole], [RequiredAuthority] and [RequiredAnyAuthority] aspects:

Using Security4Delphi together with Aspect4Delphi is possible to make use of the concept of aspect-oriented programming (AOP).

  TPersonRepository = class
  private
    { private declarations }
  protected
    { protected declarations }
  public
    constructor Create;
    destructor Destroy; override;

    [RequiredRole('ROLE_ADMIN')]
    [RequiredAuthority('PERSON_INSERT')]
    function Insert(person: TPerson): TPerson; virtual;

    [RequiredAnyRole('ROLE_ADMIN,ROLE_MANAGER')]
    [RequiredAuthority('PERSON_UPDATE')]
    function Update(person: TPerson): TPerson; virtual;

    [RequiredAnyRole('ROLE_ADMIN,ROLE_MANAGER')]
    [RequiredAuthority('PERSON_DELETE')]
    function Delete(personId: Integer): Boolean; virtual;

    [RequiredAnyRole('ROLE_ADMIN,ROLE_MANAGER,ROLE_GUEST')]
    [RequiredAuthority('PERSON_VIEW')]
    function FindById(personId: Integer): TPerson; virtual;
  end;

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the APACHE LICENSE. See LICENSE for more information.

Contact

To contact us use the options:

Project Link

https://github.com/ezequieljuliano/Security4Delphi

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].