Security Resources and Information from TechTarget 09月29日 10:49
API安全最佳实践
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

API安全最佳实践介绍了七种API发现方法,包括源代码分析和仓库扫描、API网关和管理平台分析、第三方集成审计、持续攻击面管理、网络流量分析和SIEM集成、EDR工具运行时发现以及持续监控和集成。这些方法帮助组织全面了解API使用情况,确保API安全,防止影子API和未文档化端点带来的风险。

🔍 源代码分析和仓库扫描:通过扫描代码仓库和配置文件,识别API定义、端点和配置,如OpenAPI规范,发现隐藏在遗留代码或实验分支中的API。

🚪 API网关和管理平台分析:利用API网关维护的API注册信息、流量分析、版本跟踪和性能指标,建立API清单,但需注意网关数据有限,需结合其他方法。

🔗 第三方集成审计:审查应用程序依赖的SaaS集成和供应商API,检查认证方法、数据共享协议和访问权限,发现未预期的数据共享关系或安全集成模式。

🛡️ 持续攻击面管理:使用自动化工具扫描外部基础设施中的暴露API,通过目录枚举、子域名发现和端口扫描等技术识别未安全审查的端点。

📊 网络流量分析和SIEM集成:利用SIEM平台分析网络流量数据,识别API使用模式,通过分析HTTP流量日志、DNS查询、端口使用和协议分析发现潜在API端点。

🕵️ EDR工具运行时发现:通过EDR工具监控端点活动,包括进程监控、网络分析、行为检测和实时发现,识别特定条件下激活的API。

🔄 持续监控和集成:建立自动化流程,整合源代码扫描、API网关分析、网络流量分析、EDR监控和第三方集成审查,创建整合仪表盘,确保API可见性随环境变化而持续更新。

<p>APIs often have access to sensitive data, making it critical for organizations to know about every single API in use. Yet many companies struggle with shadow APIs and undocumented endpoints. You can't protect what you can't see, making comprehensive API visibility fundamental to any security program.</p><div class="ad-wrapper ad-embedded"> <div id="halfpage" class="ad ad-hp"> <script>GPT.display('halfpage')</script> </div> <div id="mu-1" class="ad ad-mu"> <script>GPT.display('mu-1')</script> </div> </div> <p>Effective API discovery requires a systematic approach that spans the entire software development lifecycle (SDLC). The following are seven essential API discovery best practices security teams should implement, from source code analysis to continuous monitoring.</p> <section class="section main-article-chapter" data-menu-title="1. Conduct source code analysis and repository scanning"> <h2 class="section-title"><i class="icon" data-icon="1"></i>1. Conduct source code analysis and repository scanning</h2> <p>Comprehensive API discovery begins at the source. Modern static application security testing tools automatically scan code repositories to identify API definitions, endpoints and configurations such as <a href="https://www.techtarget.com/searchapparchitecture/definition/OpenAPI-Specification"&gt;OpenAPI&lt;/a&gt; definitions.</p> <p>Pay special attention to configuration files, environment variables and deployment scripts that might reference external APIs or define new endpoints. Many organizations discover forgotten APIs lurking in legacy codebases or experimental branches.</p> <p>Tools to consider include the following:</p> <ul class="default-list"> <li>StackHawk's API Discovery connects directly to code repositories, using an inside-out approach to discover APIs from source code with automated schema generation.</li> <li>Semgrep provides fast static analysis across most programming languages to find API patterns in code, making it an excellent open source option for identifying REST endpoint declarations, GraphQL schemas and API framework usage.</li> </ul></section> <section class="section main-article-chapter" data-menu-title="2. Perform API gateway and management platform analysis"> <h2 class="section-title"><i class="icon" data-icon="1"></i>2. Perform API gateway and management platform analysis</h2> <p><a href="https://www.techtarget.com/whatis/definition/API-gateway-application-programming-interface-gateway"&gt;API gateways</a> serve as centralized chokepoints for API traffic, making them valuable sources of truth for discovering active APIs in an organization. Gateways such as Apigee maintain comprehensive registries of deployed APIs, including metadata about endpoints, versions, traffic patterns and usage analytics.</p> <p>Gateway-based API discovery offers the following advantages:</p> <ul class="default-list"> <li>Complete API inventory from centralized registration processes.</li> <li>Traffic analytics showing actual API usage and consumption patterns.</li> <li>Version tracking across different API iterations and deployments.</li> <li>Performance metrics that indicate which APIs are actively used versus dormant.</li> </ul> <p>Gateway inventories have limitations, however. Not all APIs route through gateways -- for example, internal microservice communications, legacy endpoints and development APIs often bypass this infrastructure entirely. Use gateway data as a primary inventory baseline, but supplement with other discovery methods to capture the complete API landscape.</p></section> <section class="section main-article-chapter" data-menu-title="3. Audit third-party integrations"> <h2 class="section-title"><i class="icon" data-icon="1"></i>3. Audit third-party integrations</h2> <p>Modern applications depend heavily on external services, requiring systematic audits to understand the full scope of API dependencies. Review all SaaS integrations and vendor APIs that applications consume, examining authentication methods, data-sharing agreements and access permissions granted to external services.</p> <p>Document all outbound API calls that applications make, including the types of data exchanged and the business purpose of each integration. This audit process often reveals unexpected data sharing relationships or insecure integration patterns not captured in official API documentation.</p> <p>Pay particular attention to cloud service dependencies and their associated API endpoints, as these connections frequently bypass traditional network monitoring tools. Many organizations discover critical API dependencies only when external services experience outages or security incidents.</p></section> <section class="section main-article-chapter" data-menu-title="4. Implement continuous attack surface management"> <h2 class="section-title"><i class="icon" data-icon="1"></i>4. Implement continuous attack surface management</h2> <p>Deploy automated tools that continuously scan external-facing infrastructure for exposed APIs. Modern attack surface management tools use techniques such as directory enumeration, subdomain discovery and <a href="https://www.techtarget.com/searchsecurity/answer/What-is-a-port-scan-attack"&gt;port scanning</a> to identify endpoints that might have been deployed without proper security review.</p> <p>Focus on common API paths (<i>/api/, /rest/, /v1/</i>), HTTP methods and response patterns that indicate API interfaces. Advanced tools can differentiate between static web content and dynamic API endpoints, helping identify APIs not captured through other discovery methods.</p></section> <section class="section main-article-chapter" data-menu-title="5. Use network traffic analysis and SIEM integration"> <h2 class="section-title"><i class="icon" data-icon="1"></i>5. Use network traffic analysis and SIEM integration</h2> <p>SIEM platforms excel at ingesting and analyzing network traffic data to reveal API usage patterns, even though they don't provide native API discovery capabilities. These platforms process network flow logs, HTTP traffic data and communication patterns to identify potential API endpoints across your infrastructure.</p> <p>Configure SIEM platforms to do the following:</p> <ul class="default-list"> <li>Analyze HTTP traffic logs for API endpoint patterns and REST-like URL structures.</li> <li>Monitor DNS queries to API domains (api., rest., .amazonaws.com, .googleapis.com).</li> <li>Track port usage and protocol analysis for nonstandard API communications.</li> <li>Correlate traffic patterns with application deployment timelines to identify new APIs.</li> </ul> <p>Microsoft Sentinel demonstrates this approach well, integrating with Azure Network Watcher traffic analytics to process network security group flow logs and identify HTTP/HTTPS traffic patterns and connection dependencies.</p> <p>Other major SIEM platforms -- Splunk, IBM QRadar and Elastic Security -- offer similar network analysis capabilities, enabling security teams to build custom correlation rules that flag API-like traffic patterns and suspicious communication behaviors.</p></section> <section class="section main-article-chapter" data-menu-title="6. Configure EDR tools for runtime discovery"> <h2 class="section-title"><i class="icon" data-icon="1"></i>6. Configure EDR tools for runtime discovery</h2> <p>Endpoint detection and response (EDR) tools provide powerful runtime insights into API activity through comprehensive endpoint monitoring. For example, CrowdStrike Falcon offers real-time visibility into endpoint activities while tracking network connections, DNS requests and process-level communication patterns.</p> <p>EDR API discovery capabilities include the following:</p> <ul class="default-list"> <li><b>Process monitoring.</b> Track applications making API calls by analyzing process execution and command-line arguments.</li> <li><b>Network analysis.</b> Monitor HTTP/HTTPS connections, DNS queries to API domains and unusual port usage.</li> <li><b>Behavioral detection.</b> Identify patterns indicating unauthorized API usage or <a href="https://www.techtarget.com/searchsecurity/tip/How-API-attacks-work-plus-common-types"&gt;API abuse</a>.</li> <li><b>Real-time discovery.</b> Detect new API communications as they occur across the organization.</li> </ul> <p>EDR tools excel at identifying APIs that only activate under specific conditions or during business processes, making them essential for discovering conditional or time-based API usage that static analysis might miss.</p></section> <section class="section main-article-chapter" data-menu-title="7. Conduct continuous monitoring and integration"> <h2 class="section-title"><i class="icon" data-icon="1"></i>7. Conduct continuous monitoring and integration</h2> <p>API discovery isn't a one-time activity -- it requires ongoing integration across multiple discovery methods.</p> <p>Establish automated processes that combine the following:</p> <ul class="default-list"> <li>Source code scanning integrated into continuous integration/continuous delivery pipelines.</li> <li>API gateway analytics with automated inventory updates.</li> <li>Network traffic analysis through SIEM platforms.</li> <li><a href="https://www.darkreading.com/endpoint-security/visibility-monitoring-key-to-enterprise-endpoint-strategy" target="_blank" rel="noopener">EDR monitoring</a> for runtime API discovery.</li> <li>Regular third-party integration reviews.</li> </ul> <p>Create dashboards that consolidate findings from all discovery methods, identify gaps between different inventories and flag newly discovered APIs for security assessment. This multilayered approach ensures comprehensive visibility as an organization's API landscape evolves.</p> <p>By implementing these discovery practices across the entire SDLC, security teams can maintain thorough API visibility and ensure adequate protection for these critical integration points.</p></section> <section class="section main-article-chapter" data-menu-title="How to implement API discovery best practices"> <h2 class="section-title"><i class="icon" data-icon="1"></i>How to implement API discovery best practices</h2> <p>Implementing these best practices as an integrated security program rather than as isolated activities is key to successful API discovery.</p> <p>Start with source code analysis to establish the organization's baseline API inventory, then layer on gateway monitoring, network traffic analysis and runtime EDR to capture the full spectrum of API use across the network.</p> <p>Remember that APIs are dynamic -- new endpoints emerge through development cycles, legacy APIs get deprecated and <a href="https://www.darkreading.com/application-security/shadow-apis-an-overlooked-cyber-risk-for-orgs" target="_blank" rel="noopener">shadow APIs appear</a> when teams bypass official processes.</p> <p><i>Colin Domoney is a software security consultant who evangelizes DevSecOps and helps developers secure their software. He previously worked for Veracode and 42Crunch and authored a book on API security. He is currently a CTO and co-founder, and an independent security consultant.</i></p></section>

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

API安全 API发现 攻击面管理 源代码分析 网关安全 第三方集成 EDR SIEM
相关文章