<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ivan Piskunov on Medium]]></title>
        <description><![CDATA[Stories by Ivan Piskunov on Medium]]></description>
        <link>https://medium.com/@ivanpiskunov?source=rss-b320210c2872------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*H-VoVcAGXUrQaH84HjiOsA.jpeg</url>
            <title>Stories by Ivan Piskunov on Medium</title>
            <link>https://medium.com/@ivanpiskunov?source=rss-b320210c2872------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 18:57:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ivanpiskunov/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Firmware First-Look: Static Firmware Security Analysis for EV Chargers with EMBA, Binwalk, SBOM and…]]></title>
            <link>https://ivanpiskunov.medium.com/firmware-first-look-static-firmware-security-analysis-for-ev-chargers-with-emba-binwalk-sbom-and-6842d11b77d0?source=rss-b320210c2872------2</link>
            <guid isPermaLink="false">https://medium.com/p/6842d11b77d0</guid>
            <category><![CDATA[product-security]]></category>
            <category><![CDATA[ota]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[ev-charging]]></category>
            <category><![CDATA[software-supply-chain]]></category>
            <dc:creator><![CDATA[Ivan Piskunov]]></dc:creator>
            <pubDate>Fri, 10 Jul 2026 06:06:00 GMT</pubDate>
            <atom:updated>2026-07-10T06:06:00.832Z</atom:updated>
            <content:encoded><![CDATA[<h3>Firmware First-Look: Static Firmware Security Analysis for EV Chargers with EMBA, Binwalk, SBOM and CVE Triage</h3><blockquote><strong><em>Lead.</em></strong><em> An EV charger is a field-deployed computing device, not merely electrical equipment. It runs firmware, stores or uses credentials, exposes local interfaces, communicates over networks, depends on embedded packages, and participates in operational trust. If we cannot describe what is inside the firmware, we cannot responsibly manage the product risk around it.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A3ti5TKknut3vjFbDCUHxg.png" /></figure><h3>Series navigation</h3><ul><li>From CI/CD to Fleet Risk: Building a Secure Release Pipeline for EVSE Platforms</li><li><strong>Firmware First-Look: Static Firmware Security Analysis for EV Chargers with EMBA, Binwalk, SBOM and CVE Triage</strong> ← you are here</li><li>DAST for EVSE Web Portals: OWASP ZAP and Burp in a Safe CI/CD Workflow</li><li>OCPP Security Telemetry: Detection Logic for Charger Identity and Firmware Events</li><li>Binary-Only Firmware Fuzzing: A Lab-Safe AFL++ QEMU Workflow for Embedded Parsers</li></ul><p>The first article covered release-chain trust. This article moves one layer closer to the field device: what do we actually know about the firmware that runs on chargers?</p><h3>Safety and scope</h3><p>This is a <strong>defensive, authorization-only workflow</strong>. Use it on:</p><ul><li>your own firmware;</li><li>lab images;</li><li>vendor-provided assessment packages where the contract allows review;</li><li>deliberately vulnerable training firmware;</li><li>internal product builds.</li></ul><p>Do not run this against firmware that you are not authorized to analyze. Do not publish vendor secrets, private keys, credentials, exploit details, or proprietary binaries.</p><p>The workflow below focuses on:</p><ul><li>inventory;</li><li>extraction;</li><li>SBOM;</li><li>weak configuration indicators;</li><li>embedded package visibility;</li><li>CVE triage;</li><li>evidence preparation;</li><li>engineering remediation.</li></ul><p>It intentionally avoids exploit payloads, bypass recipes, and destructive testing.</p><h3>Lab baseline and assumptions</h3><p>The examples assume a <strong>lawfully obtained lab firmware image</strong> named charger_fw_lab.bin. The image can be a training firmware, internal sample, vendor-provided package under assessment authorization, or a synthetic firmware artifact created only for publication screenshots.</p><p>Before running any tool, write down:</p><ul><li>firmware filename and SHA-256 hash;</li><li>source of the image and authorization basis;</li><li>product family and approximate version if known;</li><li>whether extraction is allowed under the engagement scope;</li><li>what is out of scope: exploitation, bypass research, production devices, customer infrastructure, or vendor disclosure without permission.</li></ul><p><strong>Important limitation:</strong> static firmware analysis can discover suspicious artifacts and component risk, but it cannot prove runtime exploitability by itself. Treat the first pass as evidence collection and triage, not as a final vulnerability verdict.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OY52cBS6UzusFTPD6gyewg.png" /></figure><h3>Screenshot slots</h3><h3>Why firmware analysis belongs in Product Security</h3><p>A normal web application can often be patched quickly. A charger in the field is different.</p><p>It may sit in a public parking lot, a depot, a corporate garage, a highway location, or a residential installation. It may run a firmware version that is months behind the current build. It may depend on cellular connectivity. It may require a field technician for recovery. It may contain long-lived credentials or certificates. It may support local maintenance workflows. It may accept updates from a remote management backend.</p><p>That changes the risk model.</p><p>A vulnerable package in a backend container is one problem. A vulnerable package inside field firmware is another problem because the remediation path can be slower, more expensive, and more operationally risky.</p><p>A Product Security team needs to answer practical firmware questions:</p><ul><li>What firmware versions exist in the field?</li><li>Which components are inside each firmware build?</li><li>Are there hardcoded credentials, private keys, test certificates, or debug artifacts?</li><li>Which network services are enabled?</li><li>Which update mechanism is used?</li><li>Is the firmware signed?</li><li>Does rollback protection exist?</li><li>Can the device reject tampered update packages?</li><li>Are local maintenance paths protected and logged?</li><li>Which CVEs are actually relevant to the shipped firmware?</li><li>What evidence can we show to customers, auditors, or incident responders?</li></ul><p>Firmware analysis is not only a reverse-engineering exercise. It is product risk inventory.</p><h3>Lab layout</h3><p>Start with a clean evidence structure. Even for an internal review, discipline matters.</p><p>bash mkdir -p evse-firmware-lab/{firmware,extracted,logs,reports,sbom,evidence,notes} cd evse-firmware-lab</p><p>Place the lab firmware image under firmware/:</p><p>bash cp ~/Downloads/charger_fw_lab.bin firmware/</p><p>Create a first evidence record:</p><p>bash sha256sum firmware/charger_fw_lab.bin | tee evidence/firmware.sha256 file firmware/charger_fw_lab.bin | tee evidence/firmware.file.txt stat firmware/charger_fw_lab.bin | tee evidence/firmware.stat.txt</p><p>Add a short context file:</p><p>```markdown</p><h3>Firmware review context</h3><p>Product: EVSE lab charger Firmware file: charger<em>fw</em>lab.bin Source: internal lab build Authorization: internal product-security review Reviewer: Ivan Piskunov Date: 2026–07–01 Scope: static first-look only, no live device testing Out of scope: exploit development, bypass research, production systems ```</p><p>Save it as:</p><p>text evidence/review-context.md</p><p>This looks administrative, but it is what prevents later confusion about what was reviewed, under which authorization, and with which evidence.</p><h3>First fingerprinting pass</h3><p>Before running large scanners, do a small fingerprinting pass.</p><p>bash file firmware/charger_fw_lab.bin strings -a -n 8 firmware/charger_fw_lab.bin | head -100 binwalk firmware/charger_fw_lab.bin</p><p>If binwalk identifies compressed filesystems, kernels, bootloaders, certificates, or archive structures, record that output.</p><p>bash binwalk firmware/charger_fw_lab.bin | tee evidence/binwalk-summary.txt</p><p>For extraction in a lab:</p><p>bash binwalk -eM firmware/charger_fw_lab.bin --directory extracted/binwalk</p><p>Notes:</p><ul><li>extraction can be messy;</li><li>not every signature is meaningful;</li><li>not every file is recoverable;</li><li>false positives are normal;</li><li>permissions can be odd;</li><li>symbolic links and device files need careful handling.</li></ul><p>A good firmware review does not blindly trust the scanner. It uses scanner output as a map.</p><h3>EMBA: firmware analysis as an evidence generator</h3><p>EMBA is useful because it can combine extraction, static analysis, dynamic analysis via emulation in some scenarios, SBOM generation, and reporting.</p><p>A simple EMBA workflow:</p><p>bash git clone https://github.com/e-m-b-a/emba.git cd emba sudo ./installer.sh -d</p><p>Then run a lab scan:</p><p>bash sudo ./emba \ -l ../evse-firmware-lab/logs/emba-default \ -f ../evse-firmware-lab/firmware/charger_fw_lab.bin \ -p ./scan-profiles/default-scan.emba</p><p>For SBOM-oriented output:</p><p>bash sudo ./emba \ -l ../evse-firmware-lab/logs/emba-sbom \ -f ../evse-firmware-lab/firmware/charger_fw_lab.bin \ -p ./scan-profiles/default-sbom.emba</p><p>Keep the raw logs. Do not only save screenshots.</p><p>Recommended evidence:</p><p>text logs/emba-default/ logs/emba-sbom/ evidence/firmware.sha256 evidence/binwalk-summary.txt sbom/firmware-sbom.cyclonedx.json notes/firmware-triage.md</p><p>If the tool produces an HTML report, save it as a build artifact or attach it to the internal ticket. Screenshots are good for articles; raw reports are better for engineering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ff48KdOh0Fz7XJUN_vxopQ.png" /></figure><h3>What to look for in the first pass</h3><p>A first-look firmware review is not a full certification. It is a triage pass. The goal is to identify signals that deserve engineering review.</p><h3>1. Hardcoded secrets and certificates</h3><p>Look for:</p><ul><li>private keys;</li><li>test keys;</li><li>default passwords;</li><li>API tokens;</li><li>cloud credentials;</li><li>MQTT/OCPP credentials;</li><li>Wi-Fi defaults;</li><li>SSH keys;</li><li>expired certificates;</li><li>shared certificates across devices.</li></ul><p>The finding is not “strings found something.” The real question is:</p><blockquote><strong><em>Can this secret unlock a device, backend, tenant, support workflow, or fleet-level trust boundary?</em></strong></blockquote><p>A private key inside firmware may be harmless if it is a public test fixture. It may be critical if it is used for device identity or backend authentication.</p><h3>2. Network services and local interfaces</h3><p>Look for:</p><ul><li>SSH;</li><li>Telnet;</li><li>HTTP admin UI;</li><li>debug endpoints;</li><li>local RPC services;</li><li>maintenance daemons;</li><li>exposed serial/debug workflows;</li><li>update services.</li></ul><p>For each service, ask:</p><ul><li>Is it enabled by default?</li><li>Is it bound to all interfaces?</li><li>Is it documented?</li><li>Is it required in production?</li><li>Is authentication strong?</li><li>Can it access device credentials?</li><li>Can field technicians use it safely?</li></ul><h3>3. Package and library versions</h3><p>Firmware often contains old packages. That alone is not the whole story.</p><p>You need to know:</p><ul><li>Is the package reachable?</li><li>Is the vulnerable feature compiled in?</li><li>Is the device exposed to untrusted input?</li><li>Is the component used at runtime?</li><li>Is there a vendor patch path?</li><li>Is the vulnerable code in a build artifact only?</li><li>Can the device be updated safely?</li></ul><h3>4. Update and rollback logic</h3><p>Look for update scripts, package manifests, version checks, and rollback behavior.</p><p>Good questions:</p><ul><li>Does the device verify package signatures?</li><li>Is there a version floor?</li><li>Can old vulnerable firmware be reinstalled?</li><li>Is rollback allowed only through a controlled break-glass path?</li><li>Are update failures logged?</li><li>Can the backend see rejection events?</li></ul><h3>5. Debug and development artifacts</h3><p>Look for:</p><ul><li>/debug paths;</li><li>development certificates;</li><li>test scripts;</li><li>staging endpoints;</li><li>verbose logs;</li><li>symbols;</li><li>build metadata;</li><li>internal hostnames.</li></ul><p>Development artifacts are not automatically critical, but they often reveal weak process controls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rB4YItpa7CMAA1KTfe8X_Q.png" /></figure><h3>SBOM for firmware: useful, but not sufficient by itself</h3><p>SBOM for firmware is harder than SBOM for a backend image.</p><p>A container usually has a package manager, layers, labels, and a relatively familiar filesystem. Firmware may contain stripped binaries, statically linked code, vendor SDKs, binary blobs, customized BusyBox, old kernels, proprietary components, and incomplete metadata.</p><p>That means SBOM output should be treated as evidence with confidence levels.</p><p>Example triage table:</p><p>| Component | Version | Source | Confidence | Status | Notes | | — -| — -:| — -| — -| — -| — -| | BusyBox | 1.31.x | EMBA detection | Medium | Needs review | Confirm build config. | | OpenSSL | 1.1.1x | strings + file path | Medium | Affected unknown | Check linked services. | | Dropbear | 20xx.xx | binary banner | High | Production decision needed | Is SSH enabled in field? | | Vendor SDK | unknown | directory structure | Low | Supplier evidence needed | Ask vendor for SBOM. |</p><p>The key is not to pretend that the first SBOM is perfect. The key is to create a repeatable process.</p><p>A practical firmware SBOM program should include:</p><ul><li>generated SBOM from tooling;</li><li>vendor-provided SBOM where available;</li><li>confidence notes;</li><li>unknown component list;</li><li>vulnerability mapping;</li><li>VEX-style affected/not-affected statements;</li><li>release version linkage;</li><li>field deployment mapping.</li></ul><p>A firmware SBOM is useful when incident response calls at 2 a.m. and asks:</p><blockquote><em>“Do we ship this component, in which firmware versions, and on how many devices?”</em></blockquote><h3>CVE triage: avoid the dashboard trap</h3><p>A scanner may produce a frightening report. Treat it as input, not a verdict.</p><p>For each high-severity finding, record:</p><p>```markdown</p><h3>Finding: CVE-20XX-YYYY in component-name</h3><p>Firmware version: 1.8.4-lab Component: component-name Detected by: EMBA / manual verification / vendor SBOM Confidence: high / medium / low Runtime reachable: yes / no / unknown External input path: yes / no / unknown Privilege required: none / local / authenticated / unknown Operational authority impact: none / device / charger group / backend / fleet Fix available: yes / no / vendor required Recommended action: patch / disable feature / compensating control / supplier evidence / accept with expiration Owner: firmware team Due date: 2026–07–30 ```</p><p>A Product Security triage decision should separate:</p><ul><li><strong>present</strong> — component exists in firmware;</li><li><strong>affected</strong> — vulnerable code path exists and matters;</li><li><strong>reachable</strong> — attacker-controlled or untrusted input can hit it;</li><li><strong>impactful</strong> — compromise affects device trust, credentials, charging operation, safety-adjacent behavior, or fleet operations;</li><li><strong>fixable</strong> — update exists and can be shipped safely.</li></ul><p>Those are different statements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LzFTR05mXg5ARXa4UePqaw.png" /></figure><h3>Firmware remediation patterns</h3><p>The most common remediation actions are not exotic.</p><h3>Remove development artifacts</h3><ul><li>Remove test keys.</li><li>Remove staging endpoints.</li><li>Remove debug scripts.</li><li>Remove verbose logs with sensitive data.</li><li>Strip symbols where appropriate.</li></ul><h3>Reduce local attack surface</h3><ul><li>Disable unnecessary services.</li><li>Bind admin interfaces to restricted interfaces.</li><li>Require strong authentication.</li><li>Avoid shared default credentials.</li><li>Add field-service access windows and logging.</li></ul><h3>Improve secret handling</h3><ul><li>Do not store shared fleet credentials in firmware.</li><li>Use unique device credentials.</li><li>Use secure provisioning.</li><li>Support certificate rotation and revocation.</li><li>Protect keys with secure elements where feasible.</li></ul><h3>Secure update flow</h3><ul><li>Sign firmware packages.</li><li>Verify signatures before installation.</li><li>Enforce rollback policy.</li><li>Log update rejection events.</li><li>Stage rollouts.</li><li>Keep recovery procedures tested.</li></ul><h3>Improve supplier governance</h3><ul><li>Request firmware SBOM.</li><li>Request vulnerability disclosure contact.</li><li>Request security update policy.</li><li>Request cryptographic signing process description.</li><li>Request evidence for critical component remediation.</li></ul><p>The engineering goal is not “no findings.” The goal is controlled, explainable, recoverable risk.</p><h3>A first-look firmware checklist</h3><p>Use this as a practical field note.</p><ul><li>[ ] Firmware hash recorded.</li><li>[ ] Review authorization documented.</li><li>[ ] Tool versions recorded.</li><li>[ ] Binwalk summary saved.</li><li>[ ] Extraction path saved.</li><li>[ ] EMBA report saved.</li><li>[ ] SBOM generated or requested from vendor.</li><li>[ ] Hardcoded secret candidates reviewed manually.</li><li>[ ] Local services identified.</li><li>[ ] Default credentials checked.</li><li>[ ] Certificates reviewed for uniqueness and lifecycle.</li><li>[ ] Update mechanism identified.</li><li>[ ] Rollback behavior documented.</li><li>[ ] High-risk CVEs triaged with reachability notes.</li><li>[ ] Unknown components listed for supplier follow-up.</li><li>[ ] Remediation backlog created with owners.</li></ul><h3>What to put in a companion GitHub repository</h3><p>The companion repository can include:</p><p>text samples/02_firmware_first_look/</p><p>Suggested public repository structure:</p><p>text evse-firmware-first-look/ README.md scripts/ collect-evidence.sh run-emba-lab.sh templates/ review-context.md firmware-triage-template.csv supplier-questions.md docs/ screenshots.md</p><p>Do not publish proprietary firmware. Publish the workflow, templates, and synthetic output.</p><h3>Common pitfalls and limits</h3><p>The easiest mistake in firmware review is overstating what a static scan can prove. Keep the following boundaries visible:</p><ul><li><strong>A string is not automatically a secret.</strong> It may be a test artifact, public certificate, unused sample, or dead code path. Validate context.</li><li><strong>A CVE match is not automatically reachable.</strong> Embedded packages can be patched, statically linked, compiled with different options, or unreachable from exposed flows.</li><li><strong>Extraction is not emulation.</strong> Seeing a filesystem does not mean you understand runtime behavior, process supervision, permissions, or hardware dependencies.</li><li><strong>A firmware SBOM is a starting point.</strong> It supports vulnerability intelligence and supplier questions, but it does not replace secure boot, signing, rollback protection, or field update controls.</li></ul><p>This discipline keeps the review useful for engineers and fair to vendors.</p><h3>Engineering handoff template</h3><p>For every finding worth discussing, capture it in a form that firmware engineering can act on:</p><p>text Finding ID: FW-FIRSTLOOK-001 Firmware hash: &lt;sha256&gt; Component or artifact: &lt;name/path&gt; Evidence source: EMBA / binwalk / strings / manual review Confidence: low / medium / high Runtime reachability: unknown / local only / network reachable / update path / privileged flow Operational authority impact: none / device only / tenant / fleet / update chain Recommended action: remove / rotate / patch / harden / document / supplier clarification Owner: firmware / platform / supplier / product security Due date: &lt;date&gt; Validation plan: &lt;how the fix will be proven&gt;</p><p>This format prevents a first-look review from turning into a screenshot dump.</p><h3>Final thought</h3><p>Firmware analysis does not make a charger secure by itself. It gives the product team visibility.</p><p>And visibility is the beginning of control.</p><p>A strong firmware security program should be able to say:</p><blockquote><strong><em>We know what firmware we ship, what components are inside it, which findings matter, who owns them, how updates are signed, how rollback is controlled, and how field devices can recover.</em></strong></blockquote><p>That is the difference between owning firmware risk and hoping the vendor handled it.</p><h3>References and useful links</h3><ul><li>EMBA firmware security analyzer: <a href="https://github.com/e-m-b-a/emba">https://github.com/e-m-b-a/emba</a></li><li>EMBA SBOM environment: <a href="https://github.com/e-m-b-a/emba/wiki/SBOM-environment">https://github.com/e-m-b-a/emba/wiki/SBOM-environment</a></li><li>Binwalk: <a href="https://github.com/ReFirmLabs/binwalk">https://github.com/ReFirmLabs/binwalk</a></li><li>CycloneDX: <a href="https://cyclonedx.org/">https://cyclonedx.org/</a></li><li>SPDX: <a href="https://spdx.dev/">https://spdx.dev/</a></li><li>NIST National Vulnerability Database: <a href="https://nvd.nist.gov/">https://nvd.nist.gov/</a></li><li>CISA Known Exploited Vulnerabilities Catalog: <a href="https://www.cisa.gov/known-exploited-vulnerabilities-catalog">https://www.cisa.gov/known-exploited-vulnerabilities-catalog</a></li><li>FIRST EPSS: <a href="https://www.first.org/epss/">https://www.first.org/epss/</a></li><li>OWASP Firmware Security Testing Methodology: <a href="https://github.com/scriptingxss/owasp-fstm">https://github.com/scriptingxss/owasp-fstm</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6842d11b77d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From CI/CD to Fleet Risk: Building a Secure Release Pipeline for EVSE Platforms]]></title>
            <link>https://ivanpiskunov.medium.com/from-ci-cd-to-fleet-risk-building-a-secure-release-pipeline-for-evse-platforms-7638979b322b?source=rss-b320210c2872------2</link>
            <guid isPermaLink="false">https://medium.com/p/7638979b322b</guid>
            <category><![CDATA[ev-charging]]></category>
            <category><![CDATA[product-security]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[software-supply-chain]]></category>
            <category><![CDATA[appsec]]></category>
            <dc:creator><![CDATA[Ivan Piskunov]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 08:31:00 GMT</pubDate>
            <atom:updated>2026-07-04T08:31:00.848Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In a normal SaaS product, a weak CI/CD pipeline can deploy a vulnerable service. In an EVSE platform, the same weakness can move closer to charger management, firmware delivery, OCPP gateway images, telemetry services, billing-adjacent workflows, and fleet operations. That is why the pipeline is not just automation. It is a product-security control plane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0FETIOPja2GM_JqHNIZG8g.png" /></figure><h3>Series navigation</h3><p>This article starts the hands-on part of the EVSE Product Security series.</p><ul><li><strong>From CI/CD to Fleet Risk: Building a Secure Release Pipeline for EVSE Platforms</strong> ← you are here</li><li><strong>Firmware First-Look: Static Firmware Security Analysis for EV Chargers with EMBA, Binwalk, SBOM and CVE Triage</strong></li><li><strong>DAST for EVSE Web Portals: OWASP ZAP and Burp in a Safe CI/CD Workflow</strong></li><li><strong>OCPP Security Telemetry: Detection Logic for Charger Identity and Firmware Events</strong></li><li><strong>Binary-Only Firmware Fuzzing: A Lab-Safe AFL++ QEMU Workflow for Embedded Parsers</strong></li></ul><p>The previous architectural articles explain why EVSE is not just another web application and why SBOM/OTA governance matters. This one turns that logic into an engineering workflow.</p><h3>Safety and scope</h3><p>This article is written for <strong>authorized, defensive engineering work</strong>. It does not include exploit payloads, production-target scanning recipes, bypass techniques, or real credentials. The examples use lab names such as ghcr.io/example/evse-lab, csms-api, ocpp-gateway, andevse-lab.</p><p><strong>The goal is not to attack the pipeline. The goal is to make the release path observable, reproducible, auditable, and difficult to abuse.</strong></p><h3>Lab baseline and assumptions</h3><p>The examples assume a <strong>non-production lab repository</strong> that builds a single service image such as csms-api or ocpp-gateway. Replace the names with your own internal lab services before using the samples. The workflow is written for GitHub Actions because it is easy to read publicly, but the control model transfers to GitLab CI, Jenkins, Buildkite, Azure DevOps, and similar platforms.</p><p><strong>Assumptions used in the workflow:</strong></p><ul><li>the image is built from a repository owned by the organization;</li><li>scanner output is stored as release evidence, not only printed to job logs;</li><li>signing happens only from protected branches or approved release workflows;</li><li>deployment credentials are separate from build credentials;</li><li>exceptions have an owner, expiration date, and compensating control;</li><li>production admission control verifies artifact integrity before running workloads.</li></ul><p><strong>Important limitation:</strong> a CI/CD pipeline cannot prove that a product is secure. It can only make the build and release path harder to tamper with and easier to investigate.</p><h3>Screenshot slots</h3><h3>Why CI/CD becomes product risk in EVSE</h3><p>Most AppSec programs eventually learn that vulnerabilities are not only inside application code. They are also inside how the code is built, packaged, approved, deployed, and observed.</p><p>For EVSE platforms, this becomes sharper.</p><p>A charging management platform can include:</p><ul><li>customer portals;</li><li>fleet admin APIs;</li><li>OCPP gateway services;</li><li>firmware distribution services;</li><li>telemetry pipelines;</li><li>station enrollment logic;</li><li>billing-adjacent services;</li><li>support tooling;</li><li>container registries;</li><li>Kubernetes clusters;</li><li>release approval systems.</li></ul><p>If the CI/CD system can publish a backend image, push a Helm chart, change an OCPP gateway, update a firmware distribution service, or modify infrastructure-as-code, then CI/CD is not “just DevOps.” It is part of the product control plane.</p><p>A realistic risk question is not:</p><blockquote><em>“Can someone change a YAML file?”</em></blockquote><p>The better question is:</p><blockquote><strong><em>“If this workflow is changed, what operational authority can move downstream?”</em></strong></blockquote><p>Could it deploy code that changes charger status handling? Could it ship a modified API that weakens tenant checks? Could it publish a container that reads secrets? Could it change deployment permissions? Could it influence firmware metadata or OTA orchestration? Could it silently remove logging?</p><p>That is why a mature EVSE pipeline needs more than scanner badges. It needs a release chain that produces evidence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khl9-u2M5Uk3gmqCH0cPMg.png" /></figure><h3>Threat model: where the weak seams usually appear</h3><p>A clean threat model for a release pipeline starts with the obvious assets:</p><p>| Asset | Why it matters | | — -| — -| | Source repositories | Product logic, deployment manifests, build scripts, infrastructure-as-code. | | Workflow files | Define what runs, with which permissions, and under which events. | | CI runners | Execute untrusted or semi-trusted build logic; often touch secrets and artifacts. | | Secrets and tokens | Can unlock cloud, registry, deployment, signing, or SaaS services. | | Container registry | Stores the binaries that production actually runs. | | SBOM and scan outputs | Provide inventory and release evidence. | | Signing keys / keyless identity | Establish artifact integrity and provenance. | | Deployment credentials | Can turn a build compromise into production impact. | | Approval records | Prove that risky changes passed controlled gates. |</p><p>The common weak seams are usually ordinary engineering gaps:</p><ul><li>workflow files can be edited without security-owned review;</li><li>branch protection exists, but admins can bypass it casually;</li><li>runners are long-lived and shared across trust zones;</li><li>pull requests can execute dangerous logic;</li><li>cloud keys are stored as long-lived repository secrets;</li><li>build and deploy jobs use the same broad identity;</li><li>images are scanned but not signed;</li><li>signatures exist but are not enforced;</li><li>SBOMs are generated but never attached to releases;</li><li>vulnerability gates fail only on CVSS, not product context;</li><li>security reports are not preserved as evidence;</li><li>deployment logs do not connect commit → artifact → environment.</li></ul><p><strong>The first engineering objective is traceability:</strong> for every release, you should be able to answer what commit produced it, what workflow built it, what dependencies were inside it, what security gates ran, who approved it, what image digest was deployed, and what policy allowed it to run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4wqGetZL_k2o2dDfnhe0yg.png" /></figure><h3>A minimal reference pipeline</h3><p>Below is a compact GitHub Actions workflow that models a secure release path for a lab EVSE service. It is intentionally not vendor-specific beyond GitHub Actions and common open-source tools.</p><p>The workflow performs:</p><ul><li>checkout;</li><li>secret scanning with Gitleaks;</li><li>SAST with Semgrep;</li><li>container build;</li><li>SBOM generation with Syft;</li><li>vulnerability/misconfiguration scan with Trivy;</li><li>image signing with Cosign;</li><li>release evidence packaging.</li></ul><p>```yaml name: evse-secure-release</p><p>on: pull<em>request: branches: [ main ] push: branches: [ main ] workflow</em>dispatch:</p><p>permissions: contents: read id-token: write security-events: write packages: write</p><p>env: IMAGE<em>NAME: ghcr.io/example/evse-lab/csms-api SERVICE</em>NAME: csms-api</p><p>jobs: security-build: name: Security build and release evidence runs-on: ubuntu-latest timeout-minutes: 30</p><pre>steps:<br>  - name: Checkout<br>    uses: actions/checkout@v4<br>    with:<br>      fetch-depth: 0</pre><pre>  - name: Prepare evidence directory<br>    run: |<br>      mkdir -p evidence<br>      echo &quot;commit=${GITHUB_SHA}&quot; | tee evidence/build-metadata.txt<br>      echo &quot;workflow=${GITHUB_WORKFLOW}&quot; | tee -a evidence/build-metadata.txt<br>      echo &quot;actor=${GITHUB_ACTOR}&quot; | tee -a evidence/build-metadata.txt<br>      date -u | tee -a evidence/build-metadata.txt</pre><pre>  - name: Secret scan with Gitleaks<br>    run: |<br>      docker run --rm -v &quot;$PWD:/repo&quot; ghcr.io/gitleaks/gitleaks:latest detect \<br>        --source /repo \<br>        --redact \<br>        --report-format sarif \<br>        --report-path /repo/evidence/gitleaks.sarif</pre><pre>  - name: SAST with Semgrep<br>    run: |<br>      docker run --rm -v &quot;$PWD:/src&quot; semgrep/semgrep semgrep scan \<br>        --config p/owasp-top-ten \<br>        --config p/secrets \<br>        --sarif \<br>        --output /src/evidence/semgrep.sarif \<br>        /src</pre><pre>  - name: Build container image<br>    run: |<br>      docker build \<br>        --label org.opencontainers.image.revision=${GITHUB_SHA} \<br>        --label org.opencontainers.image.source=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} \<br>        -t ${IMAGE_NAME}:${GITHUB_SHA} .</pre><pre>  - name: Generate SBOM with Syft<br>    run: |<br>      docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v &quot;$PWD:/work&quot; anchore/syft:latest \<br>        ${IMAGE_NAME}:${GITHUB_SHA} \<br>        -o cyclonedx-json=/work/evidence/sbom.cyclonedx.json</pre><pre>  - name: Scan image with Trivy<br>    run: |<br>      docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v &quot;$PWD:/work&quot; aquasec/trivy:latest image \<br>        --scanners vuln,secret,misconfig \<br>        --format json \<br>        --output /work/evidence/trivy-image.json \<br>        ${IMAGE_NAME}:${GITHUB_SHA}</pre><pre>  - name: Install Cosign<br>    if: github.ref == &#39;refs/heads/main&#39;<br>    uses: sigstore/cosign-installer@v3</pre><pre>  - name: Sign image with Cosign<br>    if: github.ref == &#39;refs/heads/main&#39;<br>    env:<br>      COSIGN_YES: &quot;true&quot;<br>    run: |<br>      cosign sign ${IMAGE_NAME}:${GITHUB_SHA}</pre><pre>  - name: Verify image signature<br>    if: github.ref == &#39;refs/heads/main&#39;<br>    run: |<br>      cosign verify ${IMAGE_NAME}:${GITHUB_SHA} \<br>        --certificate-identity-regexp &quot;.*&quot; \<br>        --certificate-oidc-issuer-regexp &quot;.*&quot; \<br>        | tee evidence/cosign-verify.txt</pre><pre>  - name: Package release evidence<br>    uses: actions/upload-artifact@v4<br>    with:<br>      name: evse-release-evidence-${{ github.sha }}<br>      path: evidence/<br>      retention-days: 30</pre><p>```</p><p>This is not a perfect enterprise pipeline. It is a minimal engineering skeleton. The important part is the structure: <strong>find secrets, inspect code, build artifact, describe artifact, scan artifact, sign artifact, verify artifact, preserve evidence.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zxl0fMjPqvxA9Z1j5dZlpw.png" /></figure><h3>Tooling notes</h3><p>The workflow uses tools that fit well into a defensive product-security workflow:</p><ul><li><strong>Gitleaks</strong> — secret scanning for repositories, files, and pipelines.</li><li><strong>Semgrep</strong> — static analysis and custom guardrails.</li><li><strong>Syft</strong> — SBOM generation for images and filesystems.</li><li><strong>Trivy</strong> — vulnerability, secret, misconfiguration, SBOM, filesystem, image and Kubernetes scanning.</li><li><strong>Cosign</strong> — artifact signing and verification.</li><li><strong>GitHub OIDC</strong> — short-lived identity for cloud access instead of long-lived cloud secrets.</li><li><strong>OWASP Top 10 CI/CD Security Risks</strong> — useful mental model for pipeline abuse paths.</li><li><strong>SLSA</strong> — useful provenance and build-integrity framework.</li></ul><p>The point is not that these are the only tools. The point is to build a repeatable chain where each tool answers a release question:</p><p>| Question | Example evidence | | — -| — -| | Did we leak credentials? | gitleaks.sarif | | Did we catch obvious dangerous code patterns? |semgrep.sarif | | What is inside the image? | sbom.cyclonedx.json | | What vulnerabilities and misconfigurations are known now? |trivy-image.json | | Which artifact was signed? | image digest + cosign-verify.txt | | Which workflow produced it? | build-metadata.txt |</p><p>Security gates should not only block. They should explain.</p><h3>Hardening the workflow itself</h3><p>A pipeline that scans code but is easy to modify is security theater. Before arguing about scanners, harden the workflow.</p><h3>1. Use least-privilege permissions</h3><p>Do not let every job inherit broad token permissions. Define permissions: explicitly.</p><p>Bad pattern:</p><p>yaml permissions: write-all</p><p>Better pattern:</p><p>yaml permissions: contents: read id-token: write security-events: write packages: write</p><p>Even better: split build, scan, sign, and deploy into separate jobs or workflows with separate permissions.</p><h3>2. Protect workflow files</h3><p>For EVSE services, changes to these files should require serious review:</p><ul><li>.github/workflows/*</li><li>Dockerfile</li><li>docker-compose*.yml</li><li>helm/**</li><li>k8s/**</li><li>terraform/**</li><li>scripts/release/**</li><li>scripts/signing/**</li></ul><p>Example CODEOWNERS:</p><p>text .github/workflows/* @product-security @platform-security Dockerfile @platform-security helm/** @platform-security k8s/** @platform-security scripts/release/** @product-security @release-engineering scripts/signing/** @product-security</p><p>The policy is simple: <strong>if a file can change how production artifacts are built or deployed, it is not a normal code review.</strong></p><h3>3. Avoid long-lived cloud keys</h3><p>Long-lived cloud keys in CI are incident accelerators. Prefer OIDC-based federation where possible.</p><p>A pattern for AWS:</p><p>```yaml permissions: id-token: write contents: read</p><p>steps: — uses: actions/checkout@v4</p><ul><li>name: Configure AWS credentials through OIDC uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::123456789012:role/evse-ci-build-role aws-region: us-east-1 ```</li></ul><p>The assumed role should be scoped to the job. A build job does not need production deployment authority. A signing job does not need broad source repository access. A deployment job should deploy a known digest, not rebuild code.</p><h3>4. Separate build from deploy</h3><p>One of the best practical controls is simple:</p><blockquote><em>Build creates artifacts. Deploy consumes approved artifacts.</em></blockquote><p>Do not let the deploy stage rebuild from branch state. Deploy by digest:</p><p>bash docker pull registry.example.test/evse-lab/csms-api@sha256:...</p><p>In Kubernetes, prefer image digests in release manifests when feasible:</p><p>yaml containers: - name: csms-api image: registry.example.test/evse-lab/csms-api@sha256:111122223333...</p><p>Tags are convenient. Digests are evidence.</p><h3>Admission control: make signatures matter</h3><p>Signing an image is useful only if production checks the signature.</p><p>A common maturity gap looks like this:</p><ul><li>the team signs images;</li><li>dashboards show signed images;</li><li>production still runs unsigned images because no policy enforces it.</li></ul><p>A simple policy goal:</p><blockquote><strong><em>Production clusters should reject unsigned images or images without trusted provenance.</em></strong></blockquote><p>Depending on your stack, this can be implemented with Kyverno, Gatekeeper/OPA, Sigstore Policy Controller, or a commercial admission-control platform.</p><p>Example Kyverno-style policy shape:</p><p>yaml apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: name: require-signed-evse-images spec: validationFailureAction: Enforce background: true rules: - name: verify-evse-image-signature match: any: - resources: kinds: - Pod namespaces: - evse-prod verifyImages: - imageReferences: - &quot;registry.example.test/evse-lab/*&quot; attestors: - entries: - keyless: issuer: &quot;https://token.actions.githubusercontent.com&quot; subject: &quot;https://github.com/example/evse-platform/*&quot;</p><p>Use this as a conceptual sample. Real policy syntax and capabilities depend on your cluster admission tool and Cosign/Sigstore configuration.</p><p>The important engineering point is this:</p><p><strong>A signed image without admission enforcement is a signed hope.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LkAemdPtA_zF7nX607xgng.png" /></figure><h3>Evidence folder: what to preserve</h3><p>For every meaningful release, preserve an evidence bundle. It does not need to be beautiful. It needs to be useful during an audit, customer security review, incident response, or rollback decision.</p><p>Recommended structure:</p><p>text evidence/ build-metadata.txt gitleaks.sarif semgrep.sarif sbom.cyclonedx.json trivy-image.json cosign-verify.txt image-digest.txt release-approval.md deployment-targets.txt exceptions.md</p><p>Example release-approval.md:</p><h3>Release approval record</h3><p>Service: csms-api Commit: 4f8d…lab Image digest: sha256:… Environment: staging -&gt; production Approver: release-manager@example.test Security reviewer: product-security@example.test</p><h3>Security gates</h3><ul><li>Secret scan: passed</li><li>SAST: passed with accepted low-risk findings</li><li>SBOM generated: yes</li><li>Image scan: no critical exploitable finding in runtime path</li><li>Image signed: yes</li><li>Signature verified: yes</li><li>Deployment by digest: yes</li></ul><h3>Exceptions</h3><ul><li>CVE-20XX-YYYY: not exploitable because package is present only in build stage. Revalidate before next monthly release. ```</li></ul><p>This turns security from a Slack discussion into operational memory.</p><h3>Product-aware vulnerability gating</h3><p>A naive vulnerability gate fails the build if any critical CVE appears. That sounds strong, but in real programs it often becomes noisy and brittle.</p><p>A better gate considers:</p><ul><li>package location: build stage vs runtime image;</li><li>exploitability in the service context;</li><li>external exposure;</li><li>privilege level;</li><li>available fix;</li><li>compensating controls;</li><li>asset criticality;</li><li>whether the service can influence operational authority.</li></ul><p>For EVSE, a CVE in an internet-facing OCPP gateway image may deserve faster handling than the same CVE in an internal batch job with no network path and no privileged identity.</p><p>A practical triage label set:</p><p>text affected-runtime not-affected-build-only not-reachable compensating-control fix-available fix-not-available needs-vendor-evidence operational-authority-impact customer-exposure</p><p>The presence of operational-authority-impact should change the conversation. If a vulnerable service can alter station state, manage firmware, export tenant data, or invoke remote operations, the SLA should be stricter.</p><h3>Pipeline anti-patterns to fix first</h3><p>Use this short list for a first-week EVSE pipeline review.</p><h3>Anti-pattern 1: one CI identity can build, sign, and deploy everything</h3><p>Fix:</p><ul><li>separate build, signing, and deployment identities;</li><li>split workflows;</li><li>use environment protection rules;</li><li>require approvals for production.</li></ul><h3>Anti-pattern 2: workflow changes are reviewed like normal code</h3><p>Fix:</p><ul><li>CODEOWNERS for workflow and release files;</li><li>branch protection;</li><li>mandatory security/platform review;</li><li>no casual admin bypass.</li></ul><h3>Anti-pattern 3: self-hosted runners are shared across trust zones</h3><p>Fix:</p><ul><li>ephemeral runners;</li><li>separate runner groups;</li><li>no privileged persistent state;</li><li>no production credentials on PR runners.</li></ul><h3>Anti-pattern 4: SBOM is generated after release, if someone remembers</h3><p>Fix:</p><ul><li>generate SBOM during build;</li><li>attach it to release evidence;</li><li>scan SBOM and image;</li><li>keep SBOM connected to exact artifact digest.</li></ul><h3>Anti-pattern 5: production accepts unsigned images</h3><p>Fix:</p><ul><li>sign artifacts;</li><li>verify signatures;</li><li>enforce admission policy;</li><li>alert on policy bypass.</li></ul><h3>Anti-pattern 6: exceptions live in chat</h3><p>Fix:</p><ul><li>store risk acceptance in repository or GRC system;</li><li>include owner, expiration, reason, compensating control;</li><li>review expired exceptions automatically.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TkP7bD7oefIpqv9A_kolNw.png" /></figure><h3>A practical checklist for engineers</h3><p>Use this before promoting an EVSE service to production:</p><ul><li>[ ] Workflow permissions are explicit and least-privileged.</li><li>[ ] Workflow and release files require security/platform ownership review.</li><li>[ ] Pull request workflows cannot access production secrets.</li><li>[ ] Build and deploy are separated.</li><li>[ ] Cloud access uses OIDC or short-lived credentials where feasible.</li><li>[ ] Container image is built reproducibly enough for investigation.</li><li>[ ] SBOM is generated and preserved.</li><li>[ ] Image vulnerability scan is preserved.</li><li>[ ] Image is signed.</li><li>[ ] Signature is verified.</li><li>[ ] Production admission policy enforces signature/provenance requirements.</li><li>[ ] Deployment uses image digest or another strong artifact reference.</li><li>[ ] Release evidence is uploaded and retained.</li><li>[ ] Exceptions have owner and expiration date.</li><li>[ ] Logs can connect commit, workflow, image digest, deployment, and environment.</li></ul><p>If this checklist feels heavy, start with the first five items. They usually remove the worst easy wins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ROEDJZOwPd1uyJfdPmTWw.png" /></figure><h3>What to put in a companion GitHub repository</h3><p>A companion repository can use this structure:</p><p>text evse-release-security-lab/ README.md .github/workflows/evse-secure-release.yml Dockerfile src/ app.py evidence-examples/ build-metadata.txt release-approval.md policies/ kyverno-require-signed-images.yaml docs/ threat-model.md remediation-checklist.md</p><p>The companion repository can include:</p><p>text samples/01_secure_release_pipeline/</p><p>That makes the guidance reproducible because readers can inspect the sample structure and adapt it to their own lab.</p><h3>Common pitfalls and limits</h3><p>The tools in this workflow are reasonable, but the claims around them must stay precise. Most mistakes come from treating evidence as proof or treating one control as a complete security program.</p><p>The workflow should avoid three overclaims:</p><ul><li><strong>Scanning is not release security.</strong> Scanners are evidence inputs. They do not replace branch protection, review gates, identity design, or deployment isolation.</li><li><strong>SBOM is not impact analysis.</strong> An SBOM tells you what may be inside an artifact. It does not automatically prove exploitability or business impact.</li><li><strong>Signature is not trust by itself.</strong> A signed malicious artifact is still malicious. Signing must be paired with protected workflows, provenance, reviews, and runtime enforcement.</li></ul><p>Keeping this distinction explicit turns the workflow from a checklist into a defensible engineering process.</p><h3>Engineer-to-lead handoff</h3><p>A practical outcome of this article should be a backlog like this:</p><p>| Backlog item | Owner | Evidence of completion | | — -| — -| — -| | Workflow files require CODEOWNERS review | Platform + Product Security | Protected branch rule screenshot, CODEOWNERS file | | Build job uses least-privilege token permissions | Platform | Workflow YAML and successful run logs | | Long-lived cloud deploy keys removed | Platform / Cloud Security | OIDC trust policy and deleted repository secrets | | SBOM generated on every release candidate | DevSecOps | CycloneDX/SPDX artifact attached to release evidence | | Images signed only from protected release workflow | Release Engineering | Cosign certificate identity and verification output | | Production rejects unsigned images | Platform | Admission policy report in staging or production | | Exceptions are tracked outside chat | Security Lead | Exception register with owner and expiration date |</p><p>This makes the workflow useful not only to an engineer who wants commands, but also to a lead who needs a program increment.</p><h3>Final thought</h3><p>In EVSE security, CI/CD is not only a productivity system. It is where trust is manufactured.</p><p>A mature release pipeline should make the following statement true:</p><blockquote><strong><em>We know what we built, what is inside it, who approved it, how it was signed, where it was deployed, and what evidence proves it.</em></strong></blockquote><p>That is the difference between “we run scanners” and “we control our product release chain.”</p><h3>References and useful links</h3><ul><li>GitHub Docs — Secure use reference: <a href="https://docs.github.com/en/actions/reference/security/secure-use">https://docs.github.com/en/actions/reference/security/secure-use</a></li><li>GitHub Docs — OpenID Connect: <a href="https://docs.github.com/en/actions/concepts/security/openid-connect">https://docs.github.com/en/actions/concepts/security/openid-connect</a></li><li>GitHub Docs — Configuring OIDC in AWS: <a href="https://docs.github.com/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services">https://docs.github.com/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services</a></li><li>OWASP — Top 10 CI/CD Security Risks: <a href="https://owasp.org/www-project-top-10-ci-cd-security-risks/">https://owasp.org/www-project-top-10-ci-cd-security-risks/</a></li><li>OWASP Cheat Sheet — CI/CD Security: <a href="https://cheatsheetseries.owasp.org/cheatsheets/CICDSecurityCheatSheet.html">https://cheatsheetseries.owasp.org/cheatsheets/CI<em>CD</em>Security<em>Cheat</em>Sheet.html</a></li><li>Gitleaks: <a href="https://github.com/gitleaks/gitleaks">https://github.com/gitleaks/gitleaks</a></li><li>Semgrep: <a href="https://semgrep.dev/docs/">https://semgrep.dev/docs/</a></li><li>Syft: <a href="https://github.com/anchore/syft">https://github.com/anchore/syft</a></li><li>Trivy: <a href="https://trivy.dev/">https://trivy.dev/</a></li><li>Cosign: <a href="https://github.com/sigstore/cosign">https://github.com/sigstore/cosign</a></li><li>Kyverno image verification: <a href="https://kyverno.io/docs/writing-policies/verify-images/">https://kyverno.io/docs/writing-policies/verify-images/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7638979b322b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BUILT. REFINED. LAUNCHED. THE PRODUCT SECURITY KNOWLEDGE BASE IS LIVE.]]></title>
            <link>https://ivanpiskunov.medium.com/built-refined-launched-the-product-security-knowledge-base-is-live-f5ac3f851093?source=rss-b320210c2872------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5ac3f851093</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[appsec]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Ivan Piskunov]]></dc:creator>
            <pubDate>Sat, 02 May 2026 04:21:01 GMT</pubDate>
            <atom:updated>2026-05-02T04:21:01.413Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>I’ve finally opened public access to my Product Security Knowledge Base.</strong></p><p>It brings together and structures my experience, working materials, snippets, examples, interview prep, learning paths, leadership notes, and a wide range of insights across AppSec, DevSecOps, API Security, Cloud Security, and related areas.My goal was not to create just another collection of links or scattered notes, but a practical knowledge system people can return to in real work, learning, interview preparation, and long-term professional growth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQGc4R1MyqlhJVDTWq8wcA.gif" /></figure><p>It’s now public — <a href="http://product-security.expert/"><strong>FEEL FREE TO EXPLORE IT</strong></a>.</p><p>I hope it helps people grow faster, build a deeper understanding of Product Security in practice, and maybe even open the door to new professional opportunities.</p><p><strong><em>I’d truly appreciate your feedback, suggestions, and thoughtful contributions.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*z94A7eIPuDr8DsNk.png" /></figure><p><strong>OFFICIAL LINKS FOR SHARE:</strong></p><p><a href="https://www.product-security.expert/"><strong>OFFICIAL WEB PAGE</strong></a><strong> <br>and </strong><a href="https://docs.product-security.expert/"><strong>GITBOOK</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5ac3f851093" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Measuring the Economic Value: A Practical Guide to AppSec and DevSecOps ROI]]></title>
            <link>https://ivanpiskunov.medium.com/measuring-the-economic-value-a-practical-guide-to-appsec-and-devsecops-roi-2ffe57a03f82?source=rss-b320210c2872------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ffe57a03f82</guid>
            <dc:creator><![CDATA[Ivan Piskunov]]></dc:creator>
            <pubDate>Sun, 24 Aug 2025 12:38:14 GMT</pubDate>
            <atom:updated>2025-08-24T12:38:14.634Z</atom:updated>
            <content:encoded><![CDATA[<h3>Intro</h3><p>Struggling to balance rapid development with robust security? You’re not alone. This clash costs companies millions in vulnerabilities that are 6–15x more expensive to fix post-release!</p><p>This article provides a clear framework to measure the true ROI of AppSec and DevSecOps, translating security efforts into undeniable business value. Learn the key metrics and formulas to prove that security isn’t a cost center — it’s your biggest competitive advantage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*DeQE3vPnifKNpaau" /></figure><h4>Why Measuring AppSec/DevSecOps ROI is Different</h4><p>Traditional software cost estimation models (like COCOMO) rely on stable processes and historical data. DevSecOps represents a radical context change:</p><ul><li><strong>Continuous Everything:</strong> Integration, delivery, and deployment create a dynamic, fluid development environment.</li><li><strong>The Software Factory:</strong> Costs are split between building the product and building/maintaining the automated pipeline (factory) that produces it.</li><li><strong>Shift-Left approach:</strong> Costs are incurred earlier in the SDLC, but they prevent far greater costs downstream.</li><li><strong>Cultural\Mind Shift: </strong>Investment is needed in training and changing workflows, not just in tools.</li></ul><p>The goal is not to achieve zero cost, but to optimize the cost of security while maximizing its value in enabling speed and reducing risk.</p><h4>2. Key Performance Indicators (KPIs) and Metrics</h4><p>To measure effectiveness, you must track the right metrics. These can be categorized into four areas:</p><h4>2.1. Risk Reduction Metrics</h4><p>These show how effectively your program reduces potential threats.</p><ul><li><strong>Critical/High Vulnerability Count:</strong> Trend over time should show a decrease.</li><li><strong>Vulnerability Density: </strong>Number of vulnerabilities per 1,000 lines of code.</li><li><strong>Security Technical Debt:</strong> The accumulated cost of all known but unfixed security issues.</li><li><strong>Weighted Risk Index:</strong> Calculates application risk based on vulnerability count, severity, and business criticality of the asset.</li></ul><h4>2.2. Security Coverage and Engagement Metrics</h4><p>These measure the adoption and integration of security practices.</p><ul><li><strong>AppSec Coverage:</strong> % of applications covered by SAST, SCA, and DAST scans.</li><li><strong>Developer Training Rate:</strong> % of developers trained in secure coding.</li><li><strong>Mean Time to Engage (MTTE):</strong> Average time for the AppSec team to join the SDLC after a project starts.</li></ul><h4>2.3. Vulnerability Management Efficiency Metrics</h4><p>These gauge the performance of your security workflow.</p><ul><li><strong>Mean Time to Detect (MTTD):</strong> Time from vulnerability introduction to discovery.</li><li><strong>Mean Time to Remediate (MTTR):</strong> Time from discovery to fix.</li><li><strong>Mean Time to Triage:</strong> Time to analyze and classify a found vulnerability.</li><li><strong>False Positive Rate:</strong> % of flagged vulnerabilities that are not real threats. A high rate wastes engineering time.</li></ul><h4>2.4. Business and Development Efficiency Metrics</h4><p>These link security efforts to business outcomes.</p><ul><li><strong>Deployment Frequency &amp; Lead Time:</strong> DevSecOps should accelerate these, not slow them down.</li><li><strong>Change Failure Rate:</strong> % of deployments causing incidents. Good security should lower this.</li><li><strong>Time-to-Market: </strong>The ultimate business metric. Effective DevSecOps should reduce it.</li></ul><h4>3. Calculating Return on Investment (ROI): Formulas and Models</h4><p>The core of economic justification lies in comparing the costs of implementation against the costs avoided.</p><p>3.1. The Core ROI Formula<br>The most straightforward calculation is:<br>ROI = (Costs Avoided - Investment Cost) / Investment Cost</p><h4>3.2. Calculating Costs Avoided (The “Return”)</h4><ul><li>Prevented Rework: The biggest source of savings.</li><li>Savings = (Number of Vulnerabilities Prevented) * (Avg. Cost to Fix in Production)</li></ul><p><em>Example: Preventing 100 vulnerabilities that would cost $5,000 each to fix in production yields $500,000 in savings.</em></p><ul><li>Developer Productivity Savings:</li><li>Studies show developers spend ~3.5% of their time fixing security bugs. A mature AppSec program can cut this by 50%.</li></ul><p>Savings = (Number of Developers) * (Avg. Salary) * (0.035 * 0.5)</p><ul><li>Avoided Incident Costs: This uses a risk-based model.</li><li>ROSI (Return on Security Investment) Formula:<br>ROSI = ( (ARO * SLE * Mitigation Factor) - TCO ) / TCO</li><li>ARO (Annualized Rate of Occurrence): Estimated number of security incidents per year.</li><li>SLE (Single Loss Expectancy): Estimated financial loss from a single incident.</li><li>Mitigation Factor: The % reduction in risk provided by the security control (e.g., 0.9 for a 90% reduction).</li><li>TCO (Total Cost of Ownership): All costs of the security tool/personnel over a year.</li><li>Avoided Fines and Brand Damage: While hard to quantify, estimates from past breaches (e.g., multi-million dollar fines for Equifax, Capital One) provide a benchmark.</li></ul><h4>3.3. Calculating Investment Cost (The “Investment”)</h4><ul><li><strong>SecTool Licensing:</strong> Costs for SAST, DAST, SCA, ASPM, RASP, etc.</li><li><strong>Personnel: </strong>Salaries for AppSec engineers, dedicated DevOps security specialists.</li><li><strong>Training\E-learning: </strong>Costs for developer security training programs.</li><li><strong>Implementation &amp; Overhead:</strong> Costs of consultants, time spent integrating tools into CI/CD, and the minor inherent slowdown from security checks.</li></ul><p><strong>3.4. Practical Calculation Example</strong></p><ul><li>Investment: $150,000 (tools + part-time specialist)</li><li>Prevented Vulnerabilities: 50 critical vulnerabilities</li><li>Cost to Fix in Prod: $40,000 per vulnerability</li><li>Developer Savings: 10 developers * $150,000/yr * (0.035 * 0.5) = $26,250</li><li>Total Costs Avoided: (50 * $40,000) + $26,250 = $2,026,250</li><li>ROI: ($2,026,250 — $150,000) / $150,000 = 1,251%</li></ul><p>This simplified example shows a massive ROI, primarily driven by avoiding late-stage fixes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/0*K3XbgRxvLygZXIsi.jpg" /></figure><h4>4. The Intangible Benefits: Beyond the Spreadsheet</h4><p>Not all value is immediately quantifiable. A strong AppSec/DevSecOps program delivers:</p><ul><li><strong>Enhanced Reputation and Trust:</strong> Customers and partners prefer companies that take security seriously.</li><li><strong>Competitive Advantage: </strong>The ability to release secure software faster is a market differentiator.</li><li><strong>Easier Compliance: </strong>Automates and simplifies adherence to standards like PCI DSS, HIPAA, GDPR, etc.</li><li><strong>Improved Culture:</strong> Fosters collaboration and shared ownership between development, operations, and security teams.</li></ul><h4>5. Conclusion</h4><p>Measuring the economic efficiency of AppSec and DevSecOps is essential for securing executive buy-in and rational investment. The key is to shift the conversation from viewing security as a pure cost center to recognizing it as a business enabler that:</p><ol><li><strong>Reduces Major Financial Risks:</strong> Preventing a single major breach can justify years of investment.</li><li><strong>Accelerates Development:</strong> By reducing costly, late-stage fire drills and rework.</li><li><strong>Protects Brand Value: </strong>Safeguarding customer trust and company reputation.</li></ol><p>Start by measuring your current state: track your MTTR, vulnerability density, and development cycle times. Then, implement a targeted AppSec initiative, measure the change in these metrics, and translate that change into financial terms using the formulas provided.</p><p><strong><em>By taking this data-driven approach, you can clearly demonstrate that investing in security is, in fact, one of the most sound financial decisions a software organization can make.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ffe57a03f82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure SDLC (Part 2): ASOC, ASPM, DevSecOps and the AppSec future]]></title>
            <link>https://ivanpiskunov.medium.com/secure-sdlc-part-2-asoc-aspm-devsecops-and-the-appsec-future-a7e2e26be082?source=rss-b320210c2872------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7e2e26be082</guid>
            <category><![CDATA[kpi]]></category>
            <category><![CDATA[secure-sdlc]]></category>
            <category><![CDATA[appsec]]></category>
            <category><![CDATA[devsecops]]></category>
            <dc:creator><![CDATA[Ivan Piskunov]]></dc:creator>
            <pubDate>Mon, 22 Apr 2024 08:16:38 GMT</pubDate>
            <atom:updated>2024-04-22T11:05:36.230Z</atom:updated>
            <content:encoded><![CDATA[<p>Dive dive into Secure SDLC by SecChamp, senior engineer and AppSec manager</p><h3>Intro</h3><p>We continue to research the issues of application security (appSec), the secure software development cycle (Secure SDLC)and DevSecOps. Let’s compare orchestration platforms (ASOC and ASMP), define key metrics, KPIs for the AppSec manager, and also talk about confusion in terminology and the future of secure software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JTIZIL4pecW4vOtGDW_XHg.png" /></figure><p>Small companies and startups often used open source software to solve application security problems. Larger and more mature teams connected commercial solutions to them. But all this is already in the past. Today, all-in-one automation offers entire security platforms that are qualitatively different from manual control mechanisms. And so, let’s look!</p><h3>Application Security Orchestration and Correlation (ASOC)</h3><h4>Birth of technology</h4><p>In 2018, Gartner identified the <strong>Application Security Testing Orchestration (ASTO) </strong>space in its annual Application Security Hype Cycle report, and in 2019 the segment was renamed <strong>Application Security Orchestration and Correlation (ASOC).</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y6c3WGMMXQyE79q-.png" /></figure><p>Today, Gartner <strong>estimates market ASOC from 5% to 20% </strong>for customers in the target audience. However, in practice we see much less adoption of this technology. According to Gartner, one of the main barriers to the implementation of ASOC solutions remains the extremely low level of awareness of the fact of their existence, although interest in them is growing rapidly. Unfortunately, very often software development organizations focus their efforts on a more traditional approach in the so-called <strong>“patchwork automation”</strong> format, which is absolutely not scalable, unlike ASOC.</p><h4>What is ASOC?</h4><p>So, a full-fledged ASOC platform are consist of:<br>· <strong>integrates security analysis tools </strong>— Application Security Tools (SAST, DAST, SCA, etc) with the software development stack (DevOps);</p><p>· provides <strong>transparent real-time interaction</strong> between engineering teams and information security experts (SecOps, AppSec, DevOps, QA);</p><p>· and <strong>implements automated management of the process of creating secure software products</strong> based on data obtained from production pipelines (DevSecOps pipelines).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LFnHSPi3MopYvzn3xPO78A.png" /></figure><p>A schematic representation of the DevSecOps process and the place of the ASOC platform in it can be depicted in the form of the following diagram:</p><p>From the point of view of the DevSecOps process, the ASOC platform manages calls to all information security tools at each stage of the <strong>software product life cycle (SDLC)</strong>, records analysis results for each version of the application artifact, and controls the security level of the final distributions based on the statuses of all the latest versions of elements and components included in them.</p><p>Well, the ASOC platform for full DevSecOps management should implement a full range of tasks from all three domains (functional areas) — <strong>Orchestration, Correlation, Analytics.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZZiImuH2Si7lx_1v.png" /></figure><p>From the point of view of the main vectors influencing the DevSecOps process, we identify three — <strong>Software Engineering, Security and Business. Stakeholders </strong>from these three groups are interested in a workable process and results, but each has their own goals and motivations.</p><p>· <strong>Software Engineering </strong>— implement business functionality on time, according to the sprint and release plan; improve the engineering process to improve software quality;</p><p>· <strong>Security </strong>— increase the security of digital products and ensure the continuity of their operation, ensure compliance with industry requirements and regulatory requirements;</p><p>· <strong>Business </strong>— maintain a balance between the level of security of digital products and security costs, reduce Time-to-Market;</p><p>To simplify visualization, we present our metrics model in a DevSecOps metrics <strong>pyramid consisting of four levels </strong>(see it below):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*onGipTG5tnC6iGFz.png" /></figure><p><strong>(1) Telemetry layer </strong>is a layer of simple, disconnected data that can be obtained from any source. Example — i<strong>ndustrial standards data, scanning time for a software artifact, size of the code base, number of tasks in a certain pipeline, number of vulnerabilities detected by a scanner</strong> in any artifact in a certain version of a particular software product, etc.</p><p><strong>(2) Operations layer</strong> is an information layer that is derived from telemetry parameters. Example —<strong> the volume of technical debt, defect density, average defect lifetime</strong>, etc. Parameters at this level are typically controlled at the individual command level.</p><p><strong>(3) Operation management level</strong> is a layer of generalizing concepts that aggregates the parameters of the operational level. Example — <strong>Time-to-Market</strong> for a specific release, covering product teams with Application Security practices, eliminating vulnerabilities in a software product, etc. Concepts at this level are usually controlled at the management level of the company.</p><p><strong>(4) The level of Top Management (Executive)</strong> is the highest layer of categorization and abstraction. At this level there are generalized concepts that are decomposed through connections with parameters from all underlying layers. These are <strong>Time-to-Market, Digital Business Continuity &amp; Security, Compliance, Software Development Maturity</strong>. Achieving goals in all these areas forms the overall value of implementing DevSecOps for the organization (DevSecOps Value).</p><p>In the context of the engineering process, we can highlight the main basic metrics and indicators that should be supported by ASOC class solutions:</p><p>TABLE</p><p>Schematically, the r<strong>elationships between DevSecOps metrics</strong> within the production process are presented in the diagram below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oGLdlcOhwu-k4ChO.png" /></figure><h3>The ASOC functional areas</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*JxIrZkl3ukWvkEfPyvpPbA.png" /></figure><h4>(1) Orchestration​​​</h4><p>To simplify the management of the DevSecOps process, the platform operates on the concept of basic elements of a software product (so-called Software Assets ) — <strong>code repositories, build artifacts, distributions, containers, instances of applications deployed in testing and production environments. </strong>Also, as part of the orchestration process , for greater flexibility, the software product (application) can be decomposed into structural components (the so-called Structure Units ) — <strong>modules, microservices </strong>, since a separate engineering team is often responsible for their implementation. <br> <br> <strong>Information security tools:</strong></p><ul><li><strong>SAST:</strong> Checkmarx SAST, Fortify SAST, Veracode, SonarQuber ;</li><li><strong>OSA/SCA:</strong> Sonatype, Synopsys BlackDuck ;</li><li><strong>DAST:</strong> Netsparker , Acunetix , Stingray ;</li><li><strong>CA: </strong>Aqua Security, Clair ;</li></ul><p><strong>Development Tools:</strong></p><ul><li><strong>Source code repository:</strong> GitLab , GitHub , Git , Bitbucket ;</li><li><strong>Artifactory :</strong> Sonatype Nexus Repository, JFrog;</li><li><strong>CI/CD: </strong>Jenkins, TeamCity, CircleCI , GitLab CI;</li><li><strong>Defect management:</strong> Jira , etc;</li><li><strong>Containers:</strong> Docker ;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RpOL4Z9XSI4f10F-a2xhlw.png" /></figure><p>The ASOC allows you to create and configure all the necessary information security pipelines for each type of software product element. Pipelines can be <strong>created automatically using pre-existing templates</strong> — this greatly reduces the labor costs when initially introducing a large number of applications into the DevSecOps loop. For each pipeline, a history of its launches is maintained and the results of all tasks are tracked, and all data is placed in storage for subsequent analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*yCB-FiFBgN7NB3Hihg1aWw.png" /></figure><p>ASOC allows you to create and configure all the necessary software quality control points <strong>(Quality Gates)</strong>, which determine the criteria for successful security scanning. Profiles with threshold values and criteria for passing these control points are created separately, and the control points themselves are added to the pipeline as part of the scanning task configuration process.</p><h4>(2) Correlation​​</h4><p>The use of various tools and technological practices when identifying software vulnerabilities generates gigantic volumes of data. Within the ASOC technology, the vulnerability correlation mechanism is the <strong>basis of the secure software production pipeline.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sqetzOBUWRCanH9y8ssEYA.png" /></figure><p><strong>The correlation mechanism allows:</strong></p><ul><li>filter false positives;</li><li>identify and merge duplicate vulnerabilities;</li><li>group vulnerabilities into defects based on context;</li><li>monitor the status of resolved vulnerabilities during subsequent <br> (full and/or incremental) scans;</li><li>generate and accumulate data on typical vulnerabilities, enriching them with information on methods of identification and elimination.</li></ul><p>This approach greatly reduces <strong>MTTR ( Mean -Time-To- Resolve)</strong> in the DevSecOps cycle, allows teams (Ops, Sec and Dev) to focus on critical vulnerabilities and allows engineers to increase the speed of recognizing emerging threats in software products being developed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/0*0BuRkpRmOhMqfBYn.png" /></figure><p>ASOC matching engine minimizes labor costs for vulnerability analysis using a special <strong>Application Vulnerability engine Correlation (AVC)</strong> and a number of filters for working with lists of vulnerabilities.</p><p><strong>AVC</strong> uses machine learning technologies to analyze vulnerabilities and <strong>filter out false positives.</strong> The model was trained on more than 1 million manually analyzed vulnerabilities. <strong>AVC</strong> analyzes the source code along with the data and makes a prediction about the vulnerability status. <br> To vulnerabilities marked as <strong>True Positives</strong> , correlation rules are applied to group them into information security defects. Correlation rules are based on parameters such as type, <strong>CWE ID, file name, line of code number in the file, status, category and severity of the vulnerability.</strong></p><p><strong>The process of managing software vulnerabilities and information security defects</strong></p><ol><li>Vulnerabilities are detected by security analysis tools during the scanning process of software artifacts called from the DevSecOps pipeline.</li><li>Analysis tools are the main sources of vulnerability data. Once the scan is complete, the data is imported into ASOC.</li><li>Information security defects are created based on vulnerabilities. One information security defect may correspond to several vulnerabilities, since they may have a common cause in the source code of the software product.</li><li>Defects are created in ASOC and exported to defect management systems.</li><li>For greater flexibility, information security defects can be assigned tags, and categorization can be implemented based on the “Label” and / or “ Component ” attributes, in the case of Jira , to track defects within a specific structural component of the software product, controlled in ASOC .</li><li>To simplify the process of fixing defects, ASOC supports several options for assigning a defect to the responsible specialist in the development team’s defect tracker . Such a specialist can be in the following roles: <br> <strong>— team leader of the development team</strong>, responsible for the entire defect management process within the framework of a specific project in Jira ; <br><strong> — a leading engineer responsible for the defect management process</strong> within a specific software component; — a dedicated Security Champion, responsible for the entire range of information security tasks in the engineering team;</li><li>ASOC constantly monitors the <strong>status of vulnerabilities</strong> and compares the results of scanning new versions of applications with fixed defects with the results of analyzing previous versions of applications within the configured pipelines . Based on the scan history and defect resolution history, the platform performs an automatic check and confirms that the defects have indeed been fixed.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YfdbUgEJvMFPbA08.png" /></figure><h3>(3) Intelligence</h3><p>DevSecOps data analytics allows you to analyze the security status of applications across all teams and applications in the organization. ASOC might aggregates engineering and security data in a <strong>data warehouse (DWH)</strong> and offers a set of metrics and dashboards to work with that data.</p><p><strong>Data collection, aggregation, and analysis</strong> help implement <strong>data-driven secure application development.</strong> This gives management, development, operations and security teams complete visibility into security and software engineering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7df3cIf1E6-Jw0Xc.png" /></figure><p>As part of monitoring the DevSecOps process, at first glance, the tasks and, as a result, trends that need to be monitored are quite obvious, for example:</p><p>· Reducing the time to eliminate detected information security defects;</p><p>· Reducing technical debt;</p><p>· Reducing the number of failed software checks at different stages of development;</p><p>· Reducing the number of vulnerabilities found during security audits/pentests;</p><p>· Increasing the coverage of security checks for developed applications and code base;</p><p>· General improvement in the quality and security of developed products;</p><p>· Increasing the maturity and sustainability of the DevSecOps process;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rcUrX90ukIiIzap5.png" /></figure><h3>Next Level: Application Security Posture Management (ASPM)</h3><p><strong>Application security posture management (ASPM)</strong> is an application security approach that leverages holistic visibility into the application environment, automation, and comprehensive security measures to implement, measure, and improve application security programs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VsViYBtXC1lL-cu_n2ZHuA.png" /></figure><p>ASPM introduces <strong>an asset-first approach</strong> that allows organizations to prioritize their most critical assets (repos, teams, endpoints, web servers, etc.) based on <strong>business importance, irrespective of security tooling data</strong>. This enables AppSec teams to allocate limited resources effectively and focus on vulnerabilities that have significant business impact rather than getting overwhelmed with a backlog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*CMyLI8OKc901lHC-TFp9Qw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*8vA-fKtMI19wS_qs98ty_Q.png" /></figure><p><strong>Gartner identifies 7 key core components of an ASPM solution as follows:</strong></p><ol><li><strong>Coverage</strong>: Includes all AST technologies and development infrastructure, from code to runtime. For example, an ASPM solution has to connect to the SCM (source code management system), other SDLC systems and infrastructure, and also to the runtime environment where the application that went through this pre-production development environment ultimately deployed.</li><li><strong>Testing orchestration</strong>: This includes the ability to integrate testing tools into the pipeline. For example, controlling which tests will be running as part of a pull-request check.</li><li><strong>Remediation:</strong> An ASPM solution needs to provide guidance on how to fix vulnerabilities and help establish remediation workflows by identifying ownership, enabling triage, integrating with ticketing and alerting systems and more.</li><li><strong>Correlation</strong>: A key ASPM capability, correlation refers to data grouping of similar characteristics to allow better prioritization and faster remediation. For instance — looking at all vulnerabilities originating from the same file, or relevant to the same container. In some cases, also merging duplicate findings that reference the same problem.</li><li><strong>Prioritization and triage</strong>: ASPMs provide data and context to make better decisions — which can be intelligent risk scoring, prioritization based on business context and application criticality, and more. Most development shops have huge risk backlogs and need to surface the most critical risks to fix at any given time with their limited resources and ASPM can help.</li><li><strong>Root cause identification</strong>: Providing the means to either manually or automatically identify root causes for risks by leveraging traceability. For example, it is possible to identify the file or component that is responsible for the most risk or point out to a project that adds significantly more vulnerabilities over time relative to others. This makes remediation efforts more efficient by addressing the risky sources and trends.</li><li><strong>Risk management</strong>: ASPM solutions can aggregate and report on the overall application risk, by means of scoring, calculating business risk and impact, and more. This allows an organization to make better decisions, set goals and track progress over time.</li></ol><p><strong>ASPMs can add value in two other very important areas:</strong></p><ul><li><strong>Software supply chain security</strong> — ASPMs can protect the SDLC itself in addition to the application builds that flow through it. Software supply chain attacks have increased between 3–6X annually in recent years, and protecting this attack surface has become an essential security need. This includes the need to secure CI/CD pipelines, SDLC systems and infrastructure, <strong>generate SBOMs and verify application integrit</strong>y.</li><li><strong>Application security testing out-of-the-box</strong> — ASPM solutions can also provide their own native security scanning capabilities, such as secret scanning and IaC scanning. An ASPM should provide orchestration capabilities to the security scanners that come with the solution, in addition to connecting to pre-existing 3rd party vendors.</li></ul><h4>ASPM vs. ASOC</h4><p>ASPM and <a href="https://www.gartner.com/reviews/market/application-security-orchestration-and-correlation-asoc-tools"><strong>ASOC </strong></a>are two distinct but related concepts in application security, ASOC evolved into ASPM, and remains a key feature of ASPM solutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*l9Zb4SuGbQOd3XHd" /></figure><p>ASOC is an approach to managing and automating application security processes. This approach orchestrates and automates:</p><ul><li><strong>security tasks,</strong></li><li><strong>the correlation of data from various sources,</strong></li><li><strong>threat intelligence integration,</strong></li><li><strong>robust reporting and analytics,</strong></li><li><strong>and workflow management.</strong></li></ul><p>ASOC enhances efficiency, collaboration, and visibility in application security practices, which helps organizations proactively identify and respond to security risks to improve their security posture and reduce the likelihood of breaches.</p><p><strong>ASPM evolved out of ASOC</strong>, with the latter being one of the key capabilities in the former. ASOC tools were the first centralizing tools to bring <strong>vulnerabilities</strong> from application security tools together. ASPM tools bring the concept of ASOC a step forward, <strong>shifting from just managing vulnerabilities, to managing and scaling an AppSec program based on risk.</strong></p><h3>ASPM is Projected to Grow Fast</h3><p>Gartner predicts growth from <strong>5% to 40% adoption of ASPM within only 3 years. </strong>Like Gartner, we believe that ASPM is becoming essential to modern application security, especially for organizations with complex development environments, DevOps, CI/CD, distributed teams, and complex application portfolios.</p><p><strong>“By 2026, over 40% of organizations developing proprietary applications will adopt ASPM to more rapidly identify and resolve application security issues.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*aJV_92ypZqcIXAsBdh1akg.png" /></figure><p><a href="https://www.gartner.com/en/documents/4326999">Gartner’s Innovation Insight for Application Security Posture Management (ASPM)</a></p><h3>Measuring The Success Of Your ASPM Program</h3><p>The following<strong> key performance indicators (KPIs) </strong>are helpful when measuring the success of your new ASPM program. You’ll notice that these KPIs look at an organization’s overall security posture, efficiency metrics, as well as the developer experience:</p><ol><li>Vulnerability detection rate</li><li>False positive rate</li><li>Mean time to remediate</li><li>Coverage of application portfolio</li><li>Compliance adherence</li><li>Number of high-risk vulnerabilities</li><li>Incident response time</li><li>Cost of remediation</li><li>Developer feedback on tool usability</li><li>Incident response collaboration</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I6HNtEqbBSnKD8dt.png" /></figure><h3>Secure SDLC or AppSec or DevSecOps?</h3><p>There are many concepts and terms in the topic of cybersecurity. Newbies and even experienced security engineers often get confused about them. In non-professional literature, one term often replaces another, hence some confusion and confusion arises.</p><p>So. <strong>AppSec is application security</strong> in the context of securing primarily source code and binary code that runs on infrastructure services. This term may well include <strong>Secure SDLC. </strong>AppSec includes covering security issues throughout the use of software — from source code storage to the creation of binary artifacts, their launch in infrastructure services, compliance, patching and support for end users. Essentially, this is a set of policies, practices, technologies, mechanisms, and activities to ensure high-quality and secure software.</p><p><strong>Secure SDLC</strong> is the process of introducing security into the standard software development cycle (SDLC). These are more than purely technical means — static analysis, dynamic analysis, testing at the stages of code merging and application assembly. This also includes threat modeling, setting security requirements, describing risks and measures to reduce their impact, mitigation plan, and verifying written code. We can say that <strong>Secure SDLC is the basic story for providing secure software</strong>. And this is included in the more capacious term AppSec.</p><p><strong>DevSecOps </strong>as a direction arose quite recently, after the emergence of e.g. Docker, Kubernetes and similar technologies. Essentially, DevSecOps is accelerated DevOps with a focus on production cybersecurity. If AppSec and Secure SDLC are more about the security of code (source and compiled into binaty artifacts), then DevSecOps is more about the infrastructure security of such key elements as the Cloud environments (AWS, GCP, Azure), CD\CI platform (GitLab), orchestration container system (Kubernetes), container virtualization (Docker), code repository (GitHub), artifact storage (J-frog), and of course the servers themselves (VM, EC2) on which all this is running (Linux, nginx, Apache, etc)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oAY0w9rdivCFCCLj.png" /></figure><h4>Secure SDLC = secured software application?</h4><p>Before moving on to the topic of <strong>Secure SDLC</strong>, let’s talk a little about what should be understood by the term <strong>Software Development Life Cycle (SDLC)</strong>. It is a framework that describes the <strong>software life cycle</strong>. Its task is to help businesses build quality application development processes. The corresponding recommendations are described in the international standard ISO/IEC 12207:2008. The framework itself consists of a familiar set of steps — <strong>design, deployment, testing, support and others.</strong></p><p>Over the past five years, the number of software vulnerabilities has increased by 30%. A significant part of the problems arises due to the low efficiency of the development process, so the increased interest in the development cycle of secure applications — <strong>Secure SDLC — is understandable.</strong></p><p>Just a bit of statistics (as of year 2021 data):</p><p>· <strong>88% of users </strong>care about how secure your app is. It is to the point they <strong>will not use services if they are not secure</strong>;</p><p>· <strong>38% of users</strong> <strong>will never come back. It is</strong> after the news of the data breach or if there is information about misusing users’ data.</p><p>Secure processes not only reduce the risk of hacks, but they literally save money. <strong>Fixing a bug at the implementation stage costs six times more than a vulnerability discovered during design</strong>. Other estimates suggest that the cost of fixing bugs after release increases by a factor of thirty.</p><p>There are several Secure SDLC models, but perhaps one of the most famous is <strong>MS SDL</strong>. The basics of the concept were <strong>formulated by Bill Gates twenty years ago</strong>, but since then it has been adjusted to take into account new approaches and technologies. In particular, software design within MS SDL involves <strong>threat modeling at the component level, dynamic code analysis and fuzzing testing.</strong> All development team members undergo information security training and study best practices in this area.</p><p>According to reports, Bill Gates’ initiative has increased the corporation’s competitiveness in terms of information security — between 2004 and 2010, the number of vulnerabilities in its applications decreased by almost three orders of magnitude compared to other organizations. Immediately after this, the company decided to release the developments under a Creative Commons license, and the <strong>MS SDL model </strong>became a kind of canon from which other <strong>Secure SDLC approaches are based.</strong></p><p><strong>Microsoft Secure Software Development Lifecycle (SSDL) </strong>is a software development process created and made public by Microsoft back in January 2004. It is based on the SDLC spiral model. During the initial period of its development, the emergence of this practice mainly benefited the company by reducing software maintenance costs and increasing its reliability. Versions 1 through 3 of SSDL were only released to the public in January 2006. Version 3.2 was released in 2008.</p><p>Subsequent versions of Microsoft’s SDL have focused more on software reliability, security vulnerability patching, threat modeling, compliance, reporting, cryptography standards, and incident response. <strong>Microsoft Secure Development Lifecycle, version 5.2 (marketed in 2012)</strong>, has become the industry’s leading model for software security practices. It has been widely accepted by private and public companies around the world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/0*QOafOnRqh1lG8mqB.png" /></figure><p>Among them we can highlight <strong>OpenSAMM </strong>by OWASP community. With its help, you can assess the current level of maturity of the software development cycle and outline changes in the security context. According to the concept, the <strong>application development process includes twelve components</strong> — for example, code review and security testing, as well as improving the literacy and level of cyber hygiene of employees. Each component is rated on a scale from zero to three, where the number three implies complete mastery of information security practices in this area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*DUOjzAzmmX_0MhjE.png" /></figure><p>Another model for building a <strong>Secure SDLC is called BSIMM</strong>. It is a thematic reference book with examples of best practices and mechanisms. A business can compare its processes with the processes of hundreds of companies and, based on this, adjust goals and objectives. In total, the framework <strong>includes more than 120 different methods</strong> that cover twelve stages of the application development and deployment life cycle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*8W8_EarEA5eHttjwYomKrg.png" /></figure><h4>DevSecOps = Infrastructure security or product environment?</h4><p>DevSecOps integrates <strong>application and infrastructure security</strong> seamlessly into Agile and DevOps processes and tools. It addresses security issues as they emerge, when they’re easier, faster, and less expensive to fix, and before deployment into production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JG3IpWZ2MQXwZ5M2.png" /></figure><h4>Application security (AppSec) = Secure SDLC?</h4><p>The terms “application security” and “secure SDLC” are often used interchangeably. However, there is in fact a difference between the two. Information security pioneer <a href="https://www.garymcgraw.com/">Gary McGraw</a> maintains that application security is a reactive approach, taking place once software has been deployed. <strong>Software security</strong>, on the other hand, involves a proactive approach, taking place within the pre-deployment phase.</p><p>To ensure that a piece of software is secure, security must be built into all phases of the <strong>software development life cycle (SDLC)</strong>. Thus, software security isn’t application security — it’s much bigger.</p><p><strong>AppSec</strong> in a simpler sense is the security of all software beyond its development stages. And<strong> DevSecOps</strong> is security focused on Agile-oriented development teams using appropriate tools and technologies. But overall security, what the company wants to do and what the end user gets, is achieved by bringing all these parts together. The final security of the product is <strong>AppSec (include Secure SDLC) + DevSecOps</strong> in action.</p><h3>The future of security</h3><p>As technological solutions have become more available and popular, businesses are increasing their usage of them. Due to this movement, the global DevSecOps market is set to <strong>grow tenfold by 2029, hitting £19 billion, showing a CAGR of 31.5%</strong>. Automation and consolidated development processes have allowed businesses to increase efficiency within their team and operations, saving both time and money in the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*siT_2944t9YxLLOdIfJkdQ.png" /></figure><p><strong>Sources: </strong><a href="https://www.cobalt.io/blog/appsec-vs-devsecops"><strong>1</strong></a><strong>, </strong><a href="https://chpk.medium.com/whats-the-difference-between-devsecops-and-application-security-appsec-c0fe7ef79289"><strong>2</strong></a><strong>, </strong><a href="https://iosentrix.com/blog/appsec-and-devsecops/"><strong>3</strong></a><strong>,</strong><a href="https://devsecops.pagerduty.com/secure_sdlc/"><strong> 4</strong></a><strong>, </strong><a href="https://www.linkedin.com/pulse/secure-sdlc-devsecops-chidhanandham-arunachalam/"><strong>5</strong></a><strong>, </strong><a href="https://www.linkedin.com/pulse/devsecops-tools-secure-software-delivery-alexandre-wagner/"><strong>6</strong></a><strong>, 7, 8, 9, 10, 11, 12, 13</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7e2e26be082" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure SDLC (Part 1): issues, approach, tech metrics, team’s KPI]]></title>
            <link>https://ivanpiskunov.medium.com/secure-sdlc-part-1-issues-approach-tech-metrics-teams-kpi-8ea7d5f1226b?source=rss-b320210c2872------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ea7d5f1226b</guid>
            <category><![CDATA[appsec]]></category>
            <category><![CDATA[kpi]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[secure-sdlc]]></category>
            <dc:creator><![CDATA[Ivan Piskunov]]></dc:creator>
            <pubDate>Sun, 14 Apr 2024 12:12:59 GMT</pubDate>
            <atom:updated>2024-04-24T07:57:31.505Z</atom:updated>
            <content:encoded><![CDATA[<p>Dive dive into Secure SDLC by SecChamp, senior DevSecOps engineer and AppSec manager</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wI6RnWhJtFI_LxhL.png" /></figure><h3>Intro</h3><p>Building a secure software development cycle <strong>(Secure SDLC)</strong> is one of the priority tasks for companies which are developing software, making digital products and providing own services. Many specialists unfamiliar with cybersecurity incorrectly interpret application security<strong>(AppSec)</strong> only as the introduction of static (SAST) and dynamic( DAST) analyzers into the development pipeline.</p><p>Today we will look in detail at what a secure software development cycle consists of, how the effectiveness of practices is measured, such measurement approaches exist, and how to evaluate the work of a security champion (the entire AppSec team)</p><h3>How to measure SSDLC progress?</h3><p>As companies increasingly adopt agile development methods, many are looking for ways to improve their application security program. One of the first questions which they must address - <strong>is how to measure progress? </strong><br>For every application-security program, there are two tracks of the problem that companies need to pursue: <strong>(1) how to measure risk</strong> in a way that informs action, and<strong> (2) how to use metrics to train the development staff </strong>in ways that prevent the creation of new vulnerabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/0*ukE8mg9AFgKUG0bX.png" /></figure><p><strong>Metrics </strong>— or perhaps more accurately, the right metrics — are crucial for understanding what’s really happening in your AppSec program. So, the metrics serve a dual purpose: they demonstrate where your organization is at but also show what progress it’s making in achieving its objectives.<br>The key to a truly effective AppSec program is to identify the right metrics and present them in a way that your executives and key business decision-makers can understand and use. An overly cumbersome approach, or one that presents information in an obtuse and burdensome way, isn’t likely to succeed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*msHUayE_W0T2E_4o.jpg" /></figure><h4>Why Is metrics important? — management vs dev</h4><p>Executives need to understand the story behind the metrics. It’s a basic truth: <strong>No enterprise initiative succeeds without executive buy-in</strong>. However, enterprises cybersecurity and AppSec are particularly challenging tasks. For them to succeed, thought leadership and messaging are crucial; funding for the right tools, systems, and technologies is critical. Organizations achieve best-practice results when they deliver the right level of information in the right format to executives — while providing your executives and development teams with more detailed metrics, as appropriate.</p><p><strong>The executive team</strong> needs to understand the metrics being used and how they’re related to success and reduced risk.</p><p><strong>The developers (and operation also) team</strong> must understand why metrics matter. It’s logical to think that your developers should understand the need for metrics and key performance indicators. But, historically, cybersecurity and application security haven’t been the primary focus for developers. Writing code and producing applications is at the center of their world.</p><h3>The Main Software Security Metrics</h3><p>Understanding a few of the most common Secure SDLC metrics</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/0*nOrzJPNg9ilFgzSg.png" /></figure><ol><li><strong>Mean-time to Remediate (MTTR)</strong><br>This metric tracks the average time it takes to resolve or mitigate a discovered security vulnerability, from the time it is identified to the time it is fixed. Faster remediation reduces the window of opportunity for attackers.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sgkgnHwaErGvmr4l" /></figure><p><strong>2. Threat Risk Index (TRI)</strong><br>TRI assesses the overall risk of a software application based on the number and severity of identified threats and vulnerabilities. Lower TRI values represent more secure software.</p><p><strong>3. Vulnerability Density</strong><br>This metric measures the number of discovered security vulnerabilities per thousand lines of code <strong>(KLOC)</strong>. Lower vulnerability density means better security.<br><br>4<strong>. Code Review Coverage</strong><br>This metric tracks the percentage of source code covered by formal code reviews, including manual and automated tools. Higher code review coverage improves the likelihood of identifying and resolving vulnerabilities.</p><p><strong>5. Patch Management Efficiency</strong><br>This metric measures the % of security patches applied within a specified time frame. Higher patch management efficiency ensures a more secure software environment.</p><p>6<strong>. Static Analysis Defect Density</strong><br>This measures the number of security vulnerabilities discovered through <strong>static analysis tools per KLOC</strong>. Lower defect density indicates better code quality and fewer potential security issues.<br><br><strong>7. Security Training Effectiveness</strong><br>This metric measures the % of the organization’s developers who have undergone security training and their level of proficiency. Higher training effectiveness indicates a more security-aware development team.</p><p><strong>8. Application Security Compliance(e.g. OWASP Top10)</strong><br>This metric tracks the adherence of a software application to OWASP’s Top Ten security risks. Higher compliance with OWASP’s guidelines results in better security posture.<br><br>9<strong>. False-Positive Rate</strong><br>This metric measures the proportion of reported security vulnerabilities that turn out to be false positives. Lower false-positive rates indicate more accurate vulnerability detection tools and processes.</p><p>10<strong>. Security Debt Ratio</strong><br>This metric compares the number of unresolved security vulnerabilities to the total number of open issues in a software project. A lower security debt ratio indicates that security vulnerabilities are being more effectively managed.</p><p><strong>11. Security Testing Coverage</strong><br>This metric measures the extent to which security testing (e.g., penetration testing, fuzz testing, etc.) covers different parts of the application. Higher testing coverage ensures a more secure application.</p><p><strong>12. Incident Response Time</strong><br>This measures the average duration between the detection of a security incident and the initiation of an appropriate response. Faster response times minimize the potential impact of an attack.</p><p><strong>13. Runtime Security Event Rate</strong><br>This metric tracks the number of security-related events (e.g., attack attempts, policy violations) detected by monitoring tools while the software is running. Lower event rates indicate a more secure runtime environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0zVwx4MB9uhWPoO5.png" /></figure><p><strong>Efficiency indicators</strong> may already be available in your bug tracking system. These may include:</p><ul><li><strong>Time to Remediate (TTR) </strong>— how long between when a specific vulnerability is first identified and when it’s fully remediated</li><li><strong>Average TTR — TTR per time period</strong></li><li><strong>Current/Average Remediation Queue Size</strong> — how much technical security debt exists</li><li><strong>Velocity </strong>— bug fixes completed per time period</li><li><strong>Pipeline Stress</strong> — how many requests for things like manual testing or code review were expedited</li></ul><p><strong>Other indicators can be designed to track efficiency in security operations</strong>, like time to assign an AppSec resource for internal assurance services, time to complete and so on.</p><ul><li><strong>Coverage</strong> — the number of applications per assurance activity (code scan, dynamic analysis) per time period; applications can be ranked according to risk or mission criticality</li><li><strong>Top Vulnerability Types</strong> — per time period</li><li><strong>Rate of Recurrence</strong> — how often known defects come back</li><li><strong>Churn</strong> — how many times a specific vulnerability was incorrectly remediated</li><li><strong>Composite Risk Rating</strong> — often shown graphically, this is a somewhat arbitrary visualization of business risk, defined by something similar to: vulnerability severity x defect count x application risk rating</li><li><strong>Security Defect Ratio </strong>— number of security defects divided by the total number of defects</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AYCXCwqJPg4BGRm3.png" /></figure><h3>Software Security Metrics Explained</h3><p>Software Security Metrics are crucial in maintaining a secure software environment, as they provide insights into vulnerabilities, remediation efforts, and overall risk management. Vulnerability Density, for instance, helps identify the number of security vulnerabilities in a given amount of code, with a lower density indicating better security. Meanwhile, metrics like <strong>Mean-time to Remediate (MTTR)</strong> and <strong>Patch Management Efficiency</strong> focus on the speed and effectiveness of addressing security vulnerabilities, as a faster response minimizes the opportunity for attackers to exploit any weaknesses.</p><p>Tools like <strong>Static Analysis Defect Density</strong> and <strong>Code Review Coverage</strong> help ensure code quality and security, while the <strong>Threat Risk Index (TRI)</strong> provides a comprehensive assessment of overall risk. In addition, <strong>Security Training Effectiveness </strong>highlights the importance of cultivating security-aware development teams, and OWASP Compliance (or another) measures adherence to established security standards.</p><p>Metrics such as <strong>Security Testing Coverage, Incident Response Time</strong>, and <strong>False-Positive Rate</strong> provide insights into the effectiveness and accuracy of security testing processes, helping teams prioritize vulnerabilities efficiently. Lastly, the <strong>Security Debt Ratio </strong>and <strong>Runtime Security Event Rate</strong> offer valuable information about the management of vulnerabilities, potential attack indicators, and the runtime security of the software.</p><p>Together, these metrics allow organizations to maintain and improve their software security posture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/0*MKSeuj2k5DNopXZZ.jpg" /></figure><h3>Which security KPIs should you measure?</h3><p>Teams should measure the effectiveness of their AppSec program from a few different angles. Well, by following a variety of KPIs, they can ensure that their application security program aligns with their organization’s unique needs and structure.</p><p><strong>These five metrics are a great place to start:</strong></p><ol><li><strong>Exploitable vulnerabilities.</strong> How many of your assets have exploitable and reachable vulnerabilities? And how many are in the high-critical CVSS score range?</li><li><strong>Alignment with compliance frameworks.</strong> How does your program measure up to <strong>compliance frameworks</strong> such as NIST 800, SOC2, PCI DSS, and ISO? Are you meeting standards for your specific industry and location, such as HIPAA or GDPR?</li><li><strong>Organizational policy compliance</strong>. What percentage of your applications align with the <strong>internal security policies</strong>? These company-specific policies often focus on mission-critical applications and other business priorities.</li><li><strong>Time-to-fix.</strong> How long does it take the security and development teams to fix major vulnerabilities after a tool uncovers them?</li><li><strong>Tool coverage.</strong> Are there gaps in your overall coverage that your team needs to resolve? These metrics are especially crucial for recently acquired or merged businesses, as they will likely bring in new critical assets that existing security tooling isn’t covering.</li></ol><p>Next reading<a href="https://ivanpiskunov.medium.com/secure-sdlc-part-2-asoc-aspm-devsecops-and-the-appsec-future-a7e2e26be082"> <strong>Secure SDLC (Part 2): ASOC, ASPM, DevSecOps and the AppSec future </strong></a>will be soon..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ea7d5f1226b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A little bit about Node.JS security by hands]]></title>
            <link>https://ivanpiskunov.medium.com/a-little-bit-about-node-js-security-by-hands-17470dddf4d0?source=rss-b320210c2872------2</link>
            <guid isPermaLink="false">https://medium.com/p/17470dddf4d0</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[appsec]]></category>
            <category><![CDATA[java-security]]></category>
            <category><![CDATA[devsecops]]></category>
            <dc:creator><![CDATA[Ivan Piskunov]]></dc:creator>
            <pubDate>Wed, 05 Apr 2023 17:31:40 GMT</pubDate>
            <atom:updated>2023-04-05T17:31:40.906Z</atom:updated>
            <content:encoded><![CDATA[<p>This short doc intend provide a simple guidelines on how to secure a Node.js application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ew9726xbRjubbban" /></figure><h3>1. Code Security</h3><h4>1.1 SQL Injection Attack</h4><p>SQL injection is an exploit where malicious users can pass unexpected data and change the SQL queries. Let’s understand with the example. Assume your SQL query looks like this:</p><pre>UPDATE users<br>    SET first_name=&quot;&#39; + req.body.first_name +  &#39;&quot; WHERE id=1332;</pre><p>In a normal scenario, you would expect that this query will look like this:</p><pre>UPDATE users<br>    SET first_name = &quot;John&quot; WHERE id = 1332;</pre><p>Now, if someone passes the first_name as the value shown below:</p><pre>John&quot;, last_name=&quot;Wick&quot;; --</pre><p>Then, your SQL query will look like this:</p><pre>UPDATE users<br>    SET first_name=&quot;John&quot;, last_name=&quot;Wick&quot;; --&quot; WHERE id=1001;</pre><p>If you observe, the <strong>WHERE</strong> condition is commented out and now the query will update the users table and sets every user’s first name as <strong><em>“John”</em></strong><em> </em>and last name as<strong><em> “Wick”</em></strong>. This will eventually lead to system failure and if your database has no backup, then you’re doomed.</p><h4>How to prevent</h4><p>The most useful way to prevent SQL injection attacks is to sanitize input data. You can either validate every single input or validate using parameter binding. Parameter binding is mostly used by the developers as it offers efficiency and security.</p><pre>var mysql = require(&#39;mysql&#39;);<br>var connection = mysql.createConnection({<br>  host     : &#39;localhost&#39;,<br>  user     : &#39;me&#39;,<br>  password : &#39;secret&#39;,<br>  database : &#39;my_db&#39;<br>});</pre><pre>connection.connect();</pre><pre>connection.query(<br>    &#39;UPDATE users SET ?? = ? WHERE ?? = ?&#39;,<br>    [&#39;first_name&#39;,req.body.first_name, ,&#39;id&#39;,1001],<br>    function(err, result) {<br>    //...<br>});</pre><p>The double question mark is replaced with the field name and the single question mark is replaced with the value. This will make sure that input is safe. You can also use a stored procedure to increase the level of security but due to lack of maintainability developers tend to avoid using stored procedures. You should also perform the server-side data validation. I do not recommend you to validate each field manually, you can use modules like <a href="https://www.npmjs.com/package/joi"><strong>joi</strong></a>.</p><h4>1.2 Password Hashing</h4><p>Hashing is a function that generates a fixed-size string from input. The output from the hashing function cannot be decrypted hence it’s “one-way” in nature. For data such as passwords, you must always use hashing algorithms to generate a hash version of the input password string which is a plaintext string.</p><p>Well, as I mentioned above, hashing takes an input string and generates a fixed-length output. So attackers take a reverse approach and they generate the hashes from the general password list, then they compare the hash with the hashes in your system to find the password. This attack is called <strong>lookup tables</strong> attack.</p><p>This is the reason why you as an architect of the system must not allow generic used passwords in your system. To overcome this attack, you can something called <strong>“salt”</strong>. Salt is attached to the password hash to make it unique irrespective of the input. Salt has to be generated securely and randomly so that it is not predictable. The Hashing algorithm we suggest you is <strong>BCrypt</strong>. At the time of writing this article, Bcrypt has not been exploited and considered cryptographically secure. In Node.js, you can use <strong>bcyrpt</strong> node module to perform the hashing.</p><p>Please refer to the example code below.</p><pre>const bcrypt = require(&#39;bcrypt&#39;);</pre><pre>const saltRounds = 10;<br>const password = &quot;Some-Password@2020&quot;;</pre><pre>bcrypt.hash(<br>    password,<br>    saltRounds,<br>    (err, passwordHash) =&gt; {</pre><pre>    //we will just print it to the console for now<br>    //you should store it somewhere and never logs or print it</pre><pre>    console.log(&quot;Hashed Password:&quot;, passwordHash);<br>});</pre><p>The <strong>SaltRounds</strong> function is the cost of the hash function. The higher the cost, the more secure hash would be generated. You should decide the salt based on the computing power of your server. Once the hash is generated for a password, the password entered by the user will be compared to the hash stored in the database. Refer to the code below for reference.</p><pre>const bcrypt = require(&#39;bcrypt&#39;);</pre><pre>const incomingPassword = &quot;Some-Password@2020&quot;;<br>const existingHash = &quot;some-hash-previously-generated&quot;</pre><pre>bcrypt.compare(<br>    incomingPassword,<br>    existingHash,<br>    (err, res) =&gt; {<br>        if(res &amp;&amp; res === true) {<br>            return console.log(&quot;Valid Password&quot;);<br>        }<br>        //invalid password handling here<br>        else {<br>            console.log(&quot;Invalid Password&quot;);<br>        }<br>});</pre><h4>1.3 Password Storage</h4><p>Whether you use the database, files to store passwords, you must not store a plain text version. As we studied above, you should generate the hash and store the hash in the system. I generally recommend using <strong>varchar(255)</strong> data type in case of a password. You can opt for an unlimited length field as well. If you are using <strong>bcrypt</strong> then you can use <strong>varchar(60)</strong> field because <strong>bcrypt</strong> will generate fixed size 60 character hashes.</p><h4>1.4 Bruteforce Attack</h4><p>Bruteforce is an attack where a hacker uses software to try different passwords repetitively until access is granted i.e valid password is found. To prevent a Bruteforce attack, one of the simplest ways is to <strong>wait it out</strong> approach. When someone is trying to login into your system and tried an invalid password more than 3 times, make them wait for 60 seconds or so before trying again. This way the attacker is going to be slow and it’s gonna take them forever to crack a password.</p><p>Another approach to preventing it is to ban the IP that is generating invalid login requests. Your system allows 3 wrong attempts per IP in 24 hours. If someone tries to do brute-forcing then block the IP for 24 hours. This rate-limiting approach is been used by lots of companies to prevent brute-force attacks. If you are using the Express framework, there is a middleware module to enable rate-limiting in incoming requests. Its called <strong>express=brute</strong>.</p><p>You can check the example code below.</p><p>Install the dependency.</p><pre>npm install express-brute --save</pre><p>Enable it in your route.</p><pre>const ExpressBrute = require(&#39;express-brute&#39;);<br>const store = new ExpressBrute.MemoryStore(); // stores state locally, don&#39;t use this in production<br>const bruteforce = new ExpressBrute(store);</pre><pre>app.post(&#39;/auth&#39;,<br>    bruteforce.prevent, // error 429 if we hit this route too often<br>    function (req, res, next) {<br>        res.send(&#39;Success!&#39;);<br>    }<br>);<br>//...</pre><p>The example code is taken from <a href="https://www.npmjs.com/package/express-brute"><strong>express-brute</strong></a> module documentation.</p><h4>1.6 Also simply suggestion for developer</h4><p><strong>Always use “use strict” mode</strong><br>With use strict, you can use a strict JavaScript <strong><em>“variant”</em></strong>. This allows you to identify some hidden errors and display them.</p><pre>&#39;use strict&#39;<br>delete Object.prototype<br>// input error<br>var obj = {<br>    a: 1,<br>    a: 2<br>}<br>// syntax error</pre><p><strong>Finding vulnerabilities with Retire.js</strong><br>The main goal of Retire.js — to help detect vulnerable versions of modules.</p><p>Just install it:</p><pre>npm install -g retire</pre><p>After that, using the retire command will allow you to detect vulnerabilities in the node_modules directory.</p><p><strong>Auditing modules with Node Security Platform CLIENT</strong><br>nsp is the main command interface for Node Security Platform. It allows you to audit package.json or npm-shrinkwrap.json, comparing it with a list of vulnerable NSP API modules.</p><pre>npm install nsp --global<br># Из директории вашего проекта<br>nsp check</pre><p>Reading on the topic: How to protect a web application: basic tips, tools, useful links</p><h3>2. Server Security</h3><h4>Use appropriate security headers</h4><p>There are several <a href="https://owasp.org/www-project-secure-headers/">HTTP security headers</a> that can help you prevent some common attack vectors. The <a href="https://www.npmjs.com/package/helmet">helmet</a> package can help to set those headers:</p><pre>const express = require(&quot;express&quot;);<br>const helmet = require(&quot;helmet&quot;);</pre><pre>const app = express();</pre><pre>app.use(helmet()); // Add various HTTP headers</pre><p>The top-level helmet function is a wrapper around 14 smaller middlewares. Bellow is a list of HTTP security headers covered by helmet middlewares:</p><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security">Strict-Transport-Security</a>: <a href="https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Strict_Transport_Security_Cheat_Sheet.html">HTTP Strict Transport Security (HSTS)</a> dictates browsers that the application can only be accessed via HTTPS connections. In order to use it in your application, add the following codes:</li></ul><pre>app.use(helmet.hsts()); // default configuration<br>app.use(<br>  helmet.hsts({<br>    maxAge: 123456,<br>    includeSubDomains: false,<br>  })<br>); // custom configuration</pre><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options">X-Frame-Options</a>: determines if a page can be loaded via a &lt;frame&gt; or an &lt;iframe&gt; element. Allowing the page to be framed may result in <a href="https://owasp.org/www-community/attacks/Clickjacking">Clickjacking</a> attacks.</li></ul><pre>app.use(helmet.frameguard()); // default behavior (SAMEORIGIN)</pre><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection">X-XSS-Protection</a>: stops pages from loading when they detect reflected cross-site scripting (XSS) attacks. This header has been deprecated by modern browsers and its use can introduce additional security issues on the client side. As such, it is recommended to set the header as X-XSS-Protection: 0 in order to disable the XSS Auditor, and not allow it to take the default behavior of the browser handling the response.</li></ul><pre>app.use(helmet.xssFilter()); // sets &quot;X-XSS-Protection: 0&quot;</pre><p>For moderns browsers, it is recommended to implement a strong Content-Security-Policy policy, as detailed in the next section.</p><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy">Content-Security-Policy</a>: Content Security Policy is developed to reduce the risk of attacks like <a href="https://owasp.org/www-community/attacks/xss/">Cross-Site Scripting (XSS)</a> and <a href="https://owasp.org/www-community/attacks/Clickjacking">Clickjacking</a>. It allows content from a list that you decide. It has several directives each of which prohibits loading specific type of a content. You can refer to <a href="https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html">Content Security Policy Cheat Sheet</a> for detailed explanation of each directive and how to use it. You can implement these settings in your application as follows:</li></ul><pre>app.use(<br>  helmet.contentSecurityPolicy({<br>    // the following directives will be merged into the default helmet CSP policy<br>    directives: {<br>      defaultSrc: [&quot;&#39;self&#39;&quot;],  // default value for all directives that are absent<br>      scriptSrc: [&quot;&#39;self&#39;&quot;],   // helps prevent XSS attacks<br>      frameAncestors: [&quot;&#39;none&#39;&quot;],  // helps prevent Clickjacking attacks<br>      imgSrc: [&quot;&#39;self&#39;&quot;, &quot;&#39;http://imgexample.com&#39;&quot;],<br>      styleSrc: [&quot;&#39;none&#39;&quot;]<br>    }<br>  })<br>);</pre><p>As this middleware performs very little validation, it is recommended to rely on CSP checkers like <a href="https://csp-evaluator.withgoogle.com/">CSP Evaluator</a> instead.</p><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options">X-Content-Type-Options</a>: Even if the server sets a valid Content-Type header in the response, browsers may try to sniff the MIME type of the requested resource. This header is a way to stop this behavior and tell the browser not to change MIME types specified in Content-Type header. It can be configured in the following way:</li></ul><pre>app.use(helmet.noSniff());</pre><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control">Cache-Control</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Pragma">Pragma</a>: Cache-Control header can be used to prevent browsers from caching the given responses. This should be done for pages that contain sensitive information about either the user or the application. However, disabling caching for pages that do not contain sensitive information may seriously affect the performance of the application. Therefore, caching should only be disabled for pages that return sensitive information. Appropriate caching controls and headers can be set easily using the <a href="https://www.npmjs.com/package/nocache">nocache</a> package:</li></ul><pre>const nocache = require(&quot;nocache&quot;);</pre><pre>app.use(nocache());</pre><p>The above code sets Cache-Control, Surrogate-Control, Pragma and Expires headers accordingly.</p><ul><li>X-Download-Options: This header prevents Internet Explorer from executing downloaded files in the site’s context. This is achieved with noopen directive. You can do so with the following piece of code:</li></ul><pre>app.use(helmet.ieNoOpen());</pre><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect-CT">Expect-CT</a>: Certificate Transparency is a new mechanism developed to fix some structural problems regarding current SSL infrastructure. Expect-CT header may enforce certificate transparency requirements. It can be implemented in your application as follows:</li></ul><pre>const expectCt = require(&#39;expect-ct&#39;);<br>app.use(expectCt({ maxAge: 123 }));<br>app.use(expectCt({ enforce: true, maxAge: 123 }));<br>app.use(expectCt({ enforce: true, maxAge: 123, reportUri: &#39;http://example.com&#39;}));</pre><ul><li>X-Powered-By: X-Powered-By header is used to inform what technology is used in the server side. This is an unnecessary header causing information leakage, so it should be removed from your application. To do so, you can use the hidePoweredBy as follows:</li></ul><pre>app.use(helmet.hidePoweredBy());</pre><p>Also, you can lie about the technologies used with this header. For example, even if your application does not use PHP, you can set X-Powered-By header to seem so.</p><pre>app.use(helmet.hidePoweredBy({ setTo: &#39;PHP 4.2.0&#39; }));</pre><h3><strong>Also simple tips for engeneer</strong></h3><h4>Keep your packages up-to-date</h4><p>Security of your application depends directly on how secure the third-party packages you use in your application are. Therefore, it is important to keep your packages up-to-date. It should be noted that <a href="https://owasp.org/www-project-top-ten/OWASP_Top_Ten_2017/Top_10-2017_A9-Using_Components_with_Known_Vulnerabilities">Using Components with Known Vulnerabilities</a> is still in the OWASP Top 10. You can use <a href="https://jeremylong.github.io/DependencyCheck/analyzers/nodejs.html">OWASP Dependency-Check</a> to see if any of the packages used in the project has a known vulnerability. Also, you can use <a href="https://github.com/retirejs/retire.js/">Retire.js</a> to check JavaScript libraries with known vulnerabilities.</p><p>Starting with version 6, npm introduced audit, which will warn about vulnerable packages:</p><pre>npm audit</pre><p>npm also introduced a simple way to upgrade the affected packages:</p><pre>npm audit fix</pre><p>There are several other tools you can use to check your dependencies. A more comprehensive list can be found in <a href="https://cheatsheetseries.owasp.org/cheatsheets/Vulnerable_Dependency_Management_Cheat_Sheet.html#tools">Vulnerable Dependency Management CS</a>.</p><h4>Run security linters</h4><p>When developing code, keeping all security tips in mind can be really difficult. Also, keeping all team members obey these rules is nearly impossible. This is why there are Static Analysis Security Testing (SAST) tools. These tools do not execute your code, but they simply look for patterns that can contain security risks. As JavaScript is a dynamic and loosely-typed language, linting tools are really essential in the software development life cycle. The linting rules should be reviewed periodically and the findings should be audited. Another advantage of these tools is the feature that you can add custom rules for patterns that you may see dangerous. <a href="https://eslint.org/">ESLint</a> and <a href="http://jshint.com/">JSHint</a> are commonly used SAST tools for JavaScript linting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17470dddf4d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Express Guide Sysdig Falco — install and config]]></title>
            <link>https://ivanpiskunov.medium.com/express-guide-sysdig-falco-install-and-config-c504480d2cac?source=rss-b320210c2872------2</link>
            <guid isPermaLink="false">https://medium.com/p/c504480d2cac</guid>
            <dc:creator><![CDATA[Ivan Piskunov]]></dc:creator>
            <pubDate>Mon, 25 Jul 2022 04:23:09 GMT</pubDate>
            <atom:updated>2022-07-25T04:23:09.504Z</atom:updated>
            <content:encoded><![CDATA[<h3>Express Guide Sysdig Falco — install and config</h3><p>Sysdig Falco — a tool for detecting anomalies and monitoring system activity. It works both on the host and in containers, if required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*9Bop7-Z_RUaludnS.png" /></figure><p>Falco consists of two parts — the <strong>falco_probe kernel module</strong>, and the <strong>daemon</strong> itself, which processes the collected information, generates reports, and so on.yaml files. We will look at Falco in the framework of this note in CentOS 7.</p><h4>Installation and basic configuration.</h4><p>To install, run one command. In the process, the script will install the kernel headers required for building the packages module, build the kernel module, and launch it.:</p><pre># curl -s <a href="https://s3.amazonaws.com/download.draios.com/stable/install-falco">https://s3.amazonaws.com/download.draios.com/stable/install-falco</a> | sudo bash</pre><p>As soon as the process is completed, we make sure that the module is working:</p><pre># lsmod | grep falco<br>falco_probe 614337 0</pre><p>Next, let’s look at the main configuration file — <strong><em>/etc/falco/falco. yaml</em></strong> Here we can specify which files with rules should be used for monitoring, in what format to display notifications, where to display them, and with what priority. By default, notifications are sent to stderr, stdout, and syslog. If we want to set up recording notifications in a separate log, pay attention to the section:</p><pre>file_output:<br>enabled: false<br>keep_alive: false<br>filename: ./events.txt</pre><p>To set up email notifications, go down to the bottom of the config and find the appropriate option there:</p><pre>program_output:<br>enabled: false<br>keep_alive: false<br>program: mail -s &quot;Falco Notification&quot; someone1@myexample.com</pre><p>We make the necessary changes, if necessary, and save the file. For this note, I didn’t change anything, leaving the default settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0QcqJ4itrHzvH_zc.jpg" /></figure><h4>Sysdig Falco rules.</h4><p>Let’s immediately look at a simple example-a rule for monitoring the network activity of system binaries:</p><pre>- rule: system_binaries_network_activity<br> desc: network activity by system binaries that are not expected generate any network traffic<br> condition: ((inbound or outbound) and (fd.sockfamily = ip)) and (fd.name != &#39;&#39;)<br> output: &quot;Binary generate network traffic by (user=%user.name command=%proc.cmdline connection=%fd.name type=%evt.type)&quot;<br> priority: WARNING<br> tags: [filesystem, network]</pre><ul><li>The rule starts with <strong>rule</strong>, then specifies the name that will be used by falco during processing.</li><li><strong>desc</strong> — free form description of the rule.</li><li><strong>condition</strong> — condition for triggering the rule. <a href="https://translated.turbopages.org/proxy_u/ru-en.ru.67be207b-62d805be-1ddfd72d-74722d776562/https/github.com/draios/sysdig/wiki/sysdig-user-guide#filtering">Written using the sysdig syntax</a>.</li><li><strong>output</strong>-a string that will be written to the log.</li><li><strong>priority</strong> — priority for the rule.</li><li><strong>tags</strong> — tags for the rule.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*bvDBHbbSAFTkacWZ.jpg" /></figure><h4>Monitoring network activity.</h4><p>When installing Falco on the server, in the <strong><em>/etc/falco/falco_rules file.yaml</em></strong> already has a certain number of rules, so you should take a look there before writing something of your own. We will write our custom rules in <strong><em>/etc/falco / falco_rules. local. yaml.</em></strong></p><p>Save the above rule and restart the service:</p><pre># systemctl restart falco</pre><p>Now just ping any domain, and then check /var/log/messages. There we will find the following:</p><pre>213.82.11.98:53 type=connect) &quot; data-translation=&quot;Oct 11 12:59:50 centos-2gb-hel1-1 falco: 12:59:50.343148030: Warning Binary generate network traffic by (user=root command=ping -c1 ya.ru connection=95.216.162.218:32820-&gt;213.133.98.98:53 type=connect) &quot; data-ch=&quot;0&quot; data-type=&quot;trSpan&quot; style=&quot;box-sizing: inherit; font-size: inherit !important; min-height: 0px; min-width: 0px;&quot;&gt;Oct 11 12:59:50 centos-2gb-hel1-1 falco: 12:59:50.343148030: Warning Binary generate network traffic by (user=root command=ping -c1 ya.ru connection=95.216.162.218:32820-&gt;213.133.98.98:53 type=connect)<br>213.82.11.98:53 type=sendto) &quot; data-translation=&quot;Oct 11 12:59:50 centos-2gb-hel1-1 falco: 12:59:50.343197498: Warning Binary generate network traffic by (user=root command=ping -c1 ya.ru connection=95.216.162.218:32820-&gt;213.133.98.98:53 type=sendto) &quot; data-ch=&quot;0&quot; data-type=&quot;trSpan&quot; style=&quot;box-sizing: inherit; font-size: inherit !important; min-height: 0px; min-width: 0px;&quot;&gt;Oct 11 12:59:50 centos-2gb-hel1-1 falco: 12:59:50.343197498: Warning Binary generate network traffic by (user=root command=ping -c1 ya.ru connection=95.216.162.218:32820-&gt;213.133.98.98:53 type=sendto)<br>213.133.98.98:53 type=ioctl) &quot; data-translation=&quot;Oct 11 12:59:50 centos-2gb-hel1-1 falco: 12:59:50.345198065: Warning Binary generate network traffic by (user=root command=ping -c1 ya.ru connection=95.216.162.218:32820-&gt;213.133.98.98:53 type=ioctl) &quot; data-ch=&quot;0&quot; data-type=&quot;trSpan&quot; style=&quot;box-sizing: inherit; font-size: inherit !important; min-height: 0px; min-width: 0px;&quot;&gt;Oct 11 12:59:50 centos-2gb-hel1-1 falco: 12:59:50.345198065: Warning Binary generate network traffic by (user=root command=ping -c1 ya.ru connection=95.216.162.218:32820-&gt;213.133.98.98:53 type=ioctl)<br>213.133.98.98:53 type=recvfrom)&quot; data-translation=&quot;Oct 11 12:59:50 centos-2gb-hel1-1 falco: 12:59:50.345205363: Warning Binary generate network traffic by (user=root command=ping -c1 ya.ru connection=95.216.162.218:32820-&gt;213.133.98.98:53 type=recvfrom)&quot; data-ch=&quot;0&quot; data-type=&quot;trSpan&quot; style=&quot;box-sizing: inherit; font-size: inherit !important; min-height: 0px; min-width: 0px;&quot;&gt;Oct 11 12:59:50 centos-2gb-hel1-1 falco: 12:59:50.345205363: Warning Binary generate network traffic by (user=root command=ping -c1 ya.ru connection=95.216.162.218:32820-&gt;213.133.98.98:53 type=recvfrom)</pre><h4>File system monitoring.</h4><p>The standard set of rules includes conditions that allow monitoring changes in the /etc directory.:</p><pre>- rule: Write below etc<br> desc: an attempt to write to any file below /etc<br> condition: write_etc_common<br> output: &quot;File below /etc opened for writing (user=%user.name command=%proc.cmdline parent=%proc.pname pcmdline=%proc.pcmdline file=%fd.name program=%proc.name gparent=%proc.aname[2] ggparent=%proc.aname[3] gggparent=%proc.aname[4])&quot;<br> priority: ERROR<br> tags: [filesystem]</pre><p>To check its performance, you can, for example, modify /etc/resolv. conf, and then check /var/log/messages, where the record will settle:</p><pre>Oct 11 13:16:46 centos-2gb-hel1-1 falco: 13:16:46.994403084: Error File below /etc opened for writing (user=root command=nano -w /etc/resolv.conf parent=bash pcmdline=bash file=/etc/resolv.conf program=nano gparent=sshd ggparent=sshd gggparent=systemd)<br>Oct 11 13:16:48 centos-2gb-hel1-1 falco: 13:16:48.967124902: Error File below /etc opened for writing (user=root command=nano -w /etc/resolv.conf parent=bash pcmdline=bash file=/etc/resolv.conf program=nano gparent=sshd ggparent=sshd gggparent=systemd)</pre><h4>Monitoring of work in the container</h4><p>For this note, I work on a test server, so we install Docker, and run a simple container with CentOS:</p><pre># yum install docker<br># systemctl restart docker<br># docker pull centos</pre><p>Let’s take the above rule and slightly modify it to monitor network activity in the container:</p><pre>- rule: system_binaries_network_activity_docker<br> desc: network activity by system binaries that are not expected generate any network traffic in container<br> condition: ((inbound or outbound) and (fd.sockfamily = ip)) and fd.name != &#39;&#39; and container<br> output: &quot;Binary generate network traffic from container %container.id by (user=%user.name command=%proc.cmdline connection=%fd.name type=%evt.type)&quot;<br> priority: WARNING<br> tags: [container, network]</pre><p>Adding the rule to /etc/falco/falco_rules. local.yaml, save the changes, and restart the service.</p><pre># systemctl restart falco</pre><p>Now just go to the container, popinguem ya.ru and exit back to the host OS.</p><pre># docker run --rm -it centos /bin/bash<br>[root@0a6ed013ee29 /]# ping -c1 ya.ru<br>...<br>[root@0a6ed013ee29 /]# exit<br>exit<br>#</pre><p>Once again, we will check <strong><em>/var/log/messages</em></strong>, where warnings will be available according to the rule we specified:</p><pre>213.133.98.98:53 type=sendto) &quot; data-translation=&quot;Oct 11 13:43:58 centos-2gb-hel1-1 falco: 13:43:58.887939368: Warning Binary generate network traffic from container 0a6ed013ee29 by (user=root command=ping -c1 ya.ru connection=172.17.0.2:49217-&gt;213.133.98.98:53 type=sendto) &quot; data-ch=&quot;0&quot; data-type=&quot;trSpan&quot; style=&quot;box-sizing: inherit; font-size: inherit !important; min-height: 0px; min-width: 0px;&quot;&gt;Oct 11 13:43:58 centos-2gb-hel1-1 falco: 13:43:58.887939368: Warning Binary generate network traffic from container 0a6ed013ee29 by (user=root command=ping -c1 ya.ru connection=172.17.0.2:49217-&gt;213.133.98.98:53 type=sendto)<br>213.133.98.98:53 type=ioctl) &quot; data-translation=&quot;Oct 11 13:43:58 centos-2gb-hel1-1 falco: 13:43:58.888361623: Warning Binary generate network traffic from container 0a6ed013ee29 by (user=root command=ping -c1 ya.ru connection=172.17.0.2:49217-&gt;213.133.98.98:53 type=ioctl) &quot; data-ch=&quot;0&quot; data-type=&quot;trSpan&quot; style=&quot;box-sizing: inherit; font-size: inherit !important; min-height: 0px; min-width: 0px;&quot;&gt;Oct 11 13:43:58 centos-2gb-hel1-1 falco: 13:43:58.888361623: Warning Binary generate network traffic from container 0a6ed013ee29 by (user=root command=ping -c1 ya.ru connection=172.17.0.2:49217-&gt;213.133.98.98:53 type=ioctl)<br>213.133.98.98:53 type=recvfrom)&quot; data-translation=&quot;Oct 11 13:43:58 centos-2gb-hel1-1 falco: 13:43:58.888382571: Warning Binary generate network traffic from container 0a6ed013ee29 by (user=root command=ping -c1 ya.ru connection=172.17.0.2:49217-&gt;213.133.98.98:53 type=recvfrom)&quot; data-ch=&quot;0&quot; data-type=&quot;trSpan&quot; style=&quot;box-sizing: inherit; font-size: inherit !important; min-height: 0px; min-width: 0px;&quot;&gt;Oct 11 13:43:58 centos-2gb-hel1-1 falco: 13:43:58.888382571: Warning Binary generate network traffic from container 0a6ed013ee29 by (user=root command=ping -c1 ya.ru connection=172.17.0.2:49217-&gt;213.133.98.98:53 type=recvfrom)</pre><p>This way, quite simply, we can take control of almost any action in the system, both on the host and in containers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c504480d2cac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K8s security audit: run Kube-bench as job in pipeline]]></title>
            <link>https://ivanpiskunov.medium.com/k8s-security-audit-run-kube-bench-as-job-in-pipeline-9a35ca1a1614?source=rss-b320210c2872------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a35ca1a1614</guid>
            <dc:creator><![CDATA[Ivan Piskunov]]></dc:creator>
            <pubDate>Wed, 20 Jul 2022 13:24:19 GMT</pubDate>
            <atom:updated>2022-07-20T13:24:19.937Z</atom:updated>
            <content:encoded><![CDATA[<h3>Intro</h3><p>The kube-bench is a Go application that checks whether <a href="https://www.kitploit.com/search/label/Kubernetes">Kubernetes</a> is deployed securely by running the checks documented in the <a href="https://www.cisecurity.org/benchmark/kubernetes/">CIS Kubernetes Benchmark</a>. Tests are configured with YAML files, making this tool easy to update as test specifications evolve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zAgPOIAIGQQXU4rM.png" /></figure><h4>Create a job file</h4><p>Create a job file named job-eks.yaml using the command below.</p><pre>cat &lt;&lt; EOF &gt; job-eks.yaml<br>---<br>apiVersion: batch/v1<br>kind: Job<br>metadata:<br>  name: kube-bench<br>spec:<br>  template:<br>    spec:<br>      hostPID: true<br>      containers:<br>        - name: kube-bench<br>          image: aquasec/kube-bench:latest<br>          command: [&quot;kube-bench&quot;, &quot;--benchmark&quot;, &quot;eks-1.0.1&quot;]<br>          volumeMounts:<br>            - name: var-lib-kubelet<br>              mountPath: /var/lib/kubelet<br>              readOnly: true<br>            - name: etc-systemd<br>              mountPath: /etc/systemd<br>              readOnly: true<br>            - name: etc-kubernetes<br>              mountPath: /etc/kubernetes<br>              readOnly: true<br>      restartPolicy: Never<br>      volumes:<br>        - name: var-lib-kubelet<br>          hostPath:<br>            path: &quot;/var/lib/kubelet&quot;<br>        - name: etc-systemd<br>          hostPath:<br>            path: &quot;/etc/systemd&quot;<br>        - name: etc-kubernetes<br>          hostPath:<br>            path: &quot;/etc/kubernetes&quot;<br>EOF</pre><h3>Run the job on your cluster</h3><p>Run the kube-bench job on a pod in your cluster using the command below.</p><pre>kubectl apply -f job-eks.yaml</pre><h3>View job assessment results</h3><p>Find the pod that was created. It should be in the default namespace.</p><pre>kubectl get pods --all-namespaces</pre><p>Retrieve the value of this pod and the output report. Note the pod name will be different for your environment.</p><pre>kubectl logs kube-bench-&lt;value&gt;</pre><p><strong>Output</strong></p><pre>[INFO] 3 Worker Node Security Configuration<br>[INFO] 3.1 Worker Node Configuration Files<br>[PASS] 3.1.1 Ensure that the proxy kubeconfig file permissions are set to 644 or more restrictive (Scored)<br>[PASS] 3.1.2 Ensure that the proxy kubeconfig file ownership is set to root:root (Scored)<br>[PASS] 3.1.3 Ensure that the kubelet configuration file has permissions set to 644 or more restrictive (Scored)<br>[PASS] 3.1.4 Ensure that the kubelet configuration file ownership is set to root:root (Scored)<br>[INFO] 3.2 Kubelet<br>[PASS] 3.2.1 Ensure that the --anonymous-auth argument is set to false (Scored)<br>[PASS] 3.2.2 Ensure that the --authorization-mode argument is not set to AlwaysAllow (Scored)<br>[PASS] 3.2.3 Ensure that the --client-ca-file argument is set as appropriate (Scored)<br>[PASS] 3.2.4 Ensure that the --read-only-port argument is set to 0 (Scored)<br>[PASS] 3.2.5 Ensure that the --streaming-connection-idle-timeout argument is not set to 0 (Scored)<br>[PASS] 3.2.6 Ensure that the --protect-kernel-defaults argument is set to true (Scored)<br>[PASS] 3.2.7 Ensure that the --make-iptables-util-chains argument is set to true (Scored) <br>[PASS] 3.2.8 Ensure that the --hostname-override argument is not set (Scored)<br>[WARN] 3.2.9 Ensure that the --event-qps argument is set to 0 or a level which ensures appropriate event capture (Scored)<br>[PASS] 3.2.10 Ensure that the --rotate-certificates argument is not set to false (Scored)<br>[PASS] 3.2.11 Ensure that the RotateKubeletServerCertificate argument is set to true (Scored)</pre><pre>== Remediations ==<br>3.2.9 If using a Kubelet config file, edit the file to set eventRecordQPS: to an appropriate level.<br>If using command line arguments, edit the kubelet service file<br>/etc/systemd/system/kubelet.service on each worker node and<br>set the below parameter in KUBELET_SYSTEM_PODS_ARGS variable.<br>Based on your system, restart the kubelet service. For example:<br>systemctl daemon-reload<br>systemctl restart kubelet.service<br></pre><pre>== Summary ==<br>14 checks PASS<br>0 checks FAIL<br>1 checks WARN<br>0 checks INFO</pre><h3>Cleanup</h3><ul><li>Delete the resources</li></ul><pre>kubectl delete -f job-eks.yaml<br>rm -f job-eks.yaml</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a35ca1a1614" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API Security Checklist]]></title>
            <link>https://ivanpiskunov.medium.com/api-security-checklist-a4456f5d3263?source=rss-b320210c2872------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4456f5d3263</guid>
            <dc:creator><![CDATA[Ivan Piskunov]]></dc:creator>
            <pubDate>Wed, 13 Jul 2022 04:12:30 GMT</pubDate>
            <atom:updated>2022-07-15T13:23:38.678Z</atom:updated>
            <content:encoded><![CDATA[<p>Checklist of the most important security countermeasures when designing, testing, and releasing your API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*lhXQ1jl9eaeIfa_0.jpg" /></figure><h3>Authentication</h3><ul><li>Don’t use Basic Auth. Use standard authentication instead (e.g. <a href="https://jwt.io/">JWT</a>, <a href="https://oauth.net/">OAuth</a>).</li><li>Don’t reinvent the wheel in Authentication, token generation, password storage. Use the standards.</li><li>Use Max Retry and jail features in Login.</li><li>Use encryption on all sensitive data.</li></ul><h3>JWT (JSON Web Token)</h3><ul><li>Use a random complicated key (JWT Secret) to make brute forcing the token very hard.</li><li>Don’t extract the algorithm from the header. Force the algorithm in the backend (HS256 or RS256).</li><li>Make token expiration (TTL, RTTL) as short as possible.</li><li>Don’t store sensitive data in the JWT payload, it can be decoded <a href="https://jwt.io/#debugger-io">easily</a>.</li></ul><h3>OAuth</h3><ul><li>Always validate redirect_uri server-side to allow only whitelisted URLs.</li><li>Always try to exchange for code and not tokens (don’t allow response_type=token).</li><li>Use state parameter with a random hash to prevent CSRF on the OAuth authentication process.</li><li>Define the default scope, and validate scope parameters for each application.</li></ul><h3>Access</h3><ul><li>Limit requests (Throttling) to avoid DDoS / brute-force attacks.</li><li>Use HTTPS on server side to avoid MITM (Man in the Middle Attack).</li><li>Use HSTS header with SSL to avoid SSL Strip attack.</li><li>For private APIs, only allow access from whitelisted IPs/hosts.</li></ul><h3>Input</h3><ul><li>Use the proper HTTP method according to the operation: GET (read), POST (create), PUT/PATCH (replace/update), and DELETE (to delete a record), and respond with 405 Method Not Allowed if the requested method isn&#39;t appropriate for the requested resource.</li><li>Validate content-type on request Accept header (Content Negotiation) to allow only your supported format (e.g. application/xml, application/json, etc.) and respond with 406 Not Acceptable response if not matched.</li><li>Validate content-type of posted data as you accept (e.g. application/x-www-form-urlencoded, multipart/form-data, application/json, etc.).</li><li>Validate user input to avoid common vulnerabilities (e.g. XSS, SQL-Injection, Remote Code Execution, etc.).</li><li>Don’t use any sensitive data (credentials, Passwords, security tokens, or API keys) in the URL, but use standard Authorization header.</li><li>Use an API Gateway service to enable caching, Rate Limit policies (e.g. Quota, Spike Arrest, or Concurrent Rate Limit) and deploy APIs resources dynamically.</li></ul><h3>Processing</h3><ul><li>Check if all the endpoints are protected behind authentication to avoid broken authentication process.</li><li>User own resource ID should be avoided. Use /me/orders instead of /user/654321/orders.</li><li>Don’t auto-increment IDs. Use UUID instead.</li><li>If you are parsing XML files, make sure entity parsing is not enabled to avoid XXE (XML external entity attack).</li><li>If you are parsing XML files, make sure entity expansion is not enabled to avoid Billion Laughs/XML bomb via exponential entity expansion attack.</li><li>Use a CDN for file uploads.</li><li>If you are dealing with huge amount of data, use Workers and Queues to process as much as possible in background and return response fast to avoid HTTP Blocking.</li><li>Do not forget to turn the DEBUG mode OFF.</li></ul><h3>Output</h3><ul><li>Send X-Content-Type-Options: nosniff header.</li><li>Send X-Frame-Options: deny header.</li><li>Send Content-Security-Policy: default-src &#39;none&#39; header.</li><li>Remove fingerprinting headers — X-Powered-By, Server, X-AspNet-Version, etc.</li><li>Force content-type for your response. If you return application/json, then your content-type response is application/json.</li><li>Don’t return sensitive data like credentials, Passwords, or security tokens.</li><li>Return the proper status code according to the operation completed. (e.g. 200 OK, 400 Bad Request, 401 Unauthorized, 405 Method Not Allowed, etc.).</li></ul><h3>CI &amp; CD</h3><ul><li>Audit your design and implementation with unit/integration tests coverage.</li><li>Use a code review process and disregard self-approval.</li><li>Ensure that all components of your services are statically scanned by AV software before pushing to production, including vendor libraries and other dependencies.</li><li>Design a rollback solution for deployments.</li></ul><h3>Security Configuration</h3><ul><li>Make sure that APIs are exposed through secure channels such as TLS</li><li>Make sure that debug logging or error messages are disabled in production deployments</li><li>Make sure that monitoring and diagnostic endpoints provided by frameworks (e.g. <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-endpoints">Spring Boot Actuator</a>) are either disabled or secured (HTTPS) and the exposure is controlled</li></ul><h3>Logging</h3><ul><li>Do not log entire the HTTP request or the HTTP headers or the entire request body as they can potentially contain sensitive information</li><li>Do not log user and system credentials</li><li>Do not log user session information (Cookies, JWT tokens, etc)</li></ul><h3>Build</h3><ul><li>Use third-party components that do not have vulnerabilities</li><li>Make sure to incorporate security testing into CI/CD processes</li></ul><h3>Security Testing</h3><ul><li>Make sure that static application security testing (SAST) is performed</li><li>Make sure that software composition analysis (SCA) scanning is performed</li><li>Make sure that dynamic application security testing (DAST) is performed</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4456f5d3263" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>